From ab079af28f43c35977bdf4aa6d8328f4686bb6a9 Mon Sep 17 00:00:00 2001 From: Bowgo Tsai Date: Wed, 14 Jul 2021 15:39:53 +0800 Subject: [PATCH] Revert "Re-land removing RECOVERY_AS_BOOT check for init_first_stage" This reverts commit 4818f74888bfe528d7a2090d18478c95aa88c497. The previous commit might introduce a build break on legacy devices that with a smaller /boot partition size, because it outputs the first-stage init and the second-stage init binaries in the following locations, respectively (when BOARD_USES_RECOVERY_AS_BOOT is true). * $OUT/recovery/root/first_stage_ramdisk/init * $OUT/recovery/root/system/bin/init The first one is not needed because there is already a symlink under $OUT/recovery/root: init -> /system/bin/init. Bug: 193565271 Test: `lunch aosp_flame-userdebug`, `make bootimage_debug` then checks the output under $OUT/debug_ramdisk/. Test: Performs the same check for `lunch aosp_bramble-userdebug`. Change-Id: I6277a6c4c0980bd976cc35db6ca99eafc6bf3f5a --- init/Android.bp | 5 ++++- init/Android.mk | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/init/Android.bp b/init/Android.bp index 46fa1f62c..3e8d4e3e7 100644 --- a/init/Android.bp +++ b/init/Android.bp @@ -257,7 +257,7 @@ soong_config_module_type { name: "init_first_stage_cc_defaults", module_type: "cc_defaults", config_namespace: "ANDROID", - bool_variables: ["BOARD_BUILD_SYSTEM_ROOT_IMAGE"], + bool_variables: ["BOARD_BUILD_SYSTEM_ROOT_IMAGE", "BOARD_USES_RECOVERY_AS_BOOT"], properties: ["installable"], } @@ -269,6 +269,9 @@ init_first_stage_cc_defaults { BOARD_BUILD_SYSTEM_ROOT_IMAGE: { installable: false, }, + BOARD_USES_RECOVERY_AS_BOOT: { + installable: false, + }, }, } diff --git a/init/Android.mk b/init/Android.mk index c1b0cf9d2..c08fe0393 100644 --- a/init/Android.mk +++ b/init/Android.mk @@ -9,8 +9,10 @@ LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 LOCAL_LICENSE_CONDITIONS := notice LOCAL_NOTICE_FILE := $(LOCAL_PATH)/NOTICE ifneq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true) +ifneq ($(BOARD_USES_RECOVERY_AS_BOOT),true) LOCAL_REQUIRED_MODULES := \ init_first_stage \ +endif # BOARD_USES_RECOVERY_AS_BOOT endif # BOARD_BUILD_SYSTEM_ROOT_IMAGE include $(BUILD_PHONY_PACKAGE)