From d381f7336a4b84efc0d4ba458ea486b23a9723e0 Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Thu, 8 Oct 2020 11:08:20 -0700 Subject: [PATCH 1/4] Add GKI global variable. Add BOARD_USES_GENERIC_KERNEL_IMAGE to be the global variable to indicate the device uses GKI image. Test: pass Bug: 156098440 Change-Id: Ica553bbdb791e25dfa9bafb524ab2de5e3f8720d --- core/board_config.mk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/board_config.mk b/core/board_config.mk index 05b6b29c1..873650562 100644 --- a/core/board_config.mk +++ b/core/board_config.mk @@ -97,6 +97,13 @@ _board_strip_readonly_list += \ BOARD_KERNEL_BINARIES \ BOARD_KERNEL_MODULE_INTERFACE_VERSIONS \ +# Variables related to generic kernel image (GKI) and generic boot image +# - BOARD_USES_GENERIC_KERNEL_IMAGE is the global variable that defines if the +# board uses GKI and generic boot image. +# Update mechanism of the boot image is not enforced by this variable. +_board_strip_readonly_list += \ + BOARD_USES_GENERIC_KERNEL_IMAGE \ + _build_broken_var_list := \ BUILD_BROKEN_DUP_RULES \ BUILD_BROKEN_DUP_SYSPROP \ From 63c5ca19abc75202656da2657632e84d4a7b7480 Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Thu, 8 Oct 2020 11:54:02 -0700 Subject: [PATCH 2/4] Add BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE. BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE removes kernel from the recovery image. Test: build recovery image and unpack_bootimg Test: build target files and unpack_bootimg IMAGES/recovery.img on device with GKI and dedicated recovery partition. Bug: 156098440 Change-Id: I5f37d74ed954b26fe3dd778708b6ab9cfdc51f1e --- core/Makefile | 17 +++++++++++------ core/board_config.mk | 9 +++++++++ tools/releasetools/common.py | 18 ++++++++++++------ 3 files changed, 32 insertions(+), 12 deletions(-) diff --git a/core/Makefile b/core/Makefile index 2bbf68821..9d13593ee 100644 --- a/core/Makefile +++ b/core/Makefile @@ -1936,13 +1936,13 @@ $(recovery_ramdisk): $(MKBOOTFS) $(COMPRESSION_COMMAND_DEPS) \ $(MKBOOTFS) -d $(TARGET_OUT) $(TARGET_RECOVERY_ROOT_OUT) | $(COMPRESSION_COMMAND) > $(recovery_ramdisk) # $(1): output file -# $(2): kernel file +# $(2): optional kernel file define build-recoveryimage-target $(if $(filter true,$(PRODUCT_SUPPORTS_VBOOT)), \ - $(MKBOOTIMG) --kernel $(2) $(INTERNAL_RECOVERYIMAGE_ARGS) \ + $(MKBOOTIMG) $(if $(strip $(2)),--kernel $(strip $(2))) $(INTERNAL_RECOVERYIMAGE_ARGS) \ $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_RECOVERY_MKBOOTIMG_ARGS) \ --output $(1).unsigned, \ - $(MKBOOTIMG) --kernel $(2) $(INTERNAL_RECOVERYIMAGE_ARGS) \ + $(MKBOOTIMG) $(if $(strip $(2)),--kernel $(strip $(2))) $(INTERNAL_RECOVERYIMAGE_ARGS) \ $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_RECOVERY_MKBOOTIMG_ARGS) \ --output $(1)) $(if $(filter true,$(PRODUCT_SUPPORTS_BOOT_SIGNER)),\ @@ -1994,7 +1994,8 @@ $(INSTALLED_BOOTIMAGE_TARGET): $(recoveryimage-deps) endif # BOARD_USES_RECOVERY_AS_BOOT $(INSTALLED_RECOVERYIMAGE_TARGET): $(recoveryimage-deps) - $(call build-recoveryimage-target, $@, $(recovery_kernel)) + $(call build-recoveryimage-target, $@, \ + $(if $(filter true, $(BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE)),, $(recovery_kernel))) ifdef RECOVERY_RESOURCE_ZIP $(RECOVERY_RESOURCE_ZIP): $(INSTALLED_RECOVERYIMAGE_TARGET) | $(ZIPTIME) @@ -2006,7 +2007,8 @@ endif .PHONY: recoveryimage-nodeps recoveryimage-nodeps: @echo "make $@: ignoring dependencies" - $(call build-recoveryimage-target, $(INSTALLED_RECOVERYIMAGE_TARGET), $(recovery_kernel)) + $(call build-recoveryimage-target, $(INSTALLED_RECOVERYIMAGE_TARGET), \ + $(if $(filter true, $(BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE)),, $(recovery_kernel))) else # BUILDING_RECOVERY_IMAGE RECOVERY_RESOURCE_ZIP := @@ -4151,6 +4153,9 @@ endif ifeq ($(BOARD_BOOTLOADER_IN_UPDATE_PACKAGE),true) $(hide) echo "bootloader_in_update_package=true" >> $@ endif +ifeq ($(BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE),true) + $(hide) echo "exclude_kernel_from_recovery_image=true" >> $@ +endif .PHONY: misc_info misc_info: $(INSTALLED_MISC_INFO_TARGET) @@ -4428,7 +4433,7 @@ ifneq (,$(INSTALLED_RECOVERYIMAGE_TARGET)$(filter true,$(BOARD_USES_RECOVERY_AS_ ifdef INSTALLED_KERNEL_TARGET ifneq (,$(filter true,$(BOARD_USES_RECOVERY_AS_BOOT))) cp $(INSTALLED_KERNEL_TARGET) $(zip_root)/$(PRIVATE_RECOVERY_OUT)/ -else # BOARD_USES_RECOVERY_AS_BOOT not true +else ifneq (true,$(BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE)) cp $(firstword $(INSTALLED_KERNEL_TARGET)) $(zip_root)/$(PRIVATE_RECOVERY_OUT)/kernel endif endif diff --git a/core/board_config.mk b/core/board_config.mk index 873650562..73900a686 100644 --- a/core/board_config.mk +++ b/core/board_config.mk @@ -101,8 +101,11 @@ _board_strip_readonly_list += \ # - BOARD_USES_GENERIC_KERNEL_IMAGE is the global variable that defines if the # board uses GKI and generic boot image. # Update mechanism of the boot image is not enforced by this variable. +# - BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE controls whether the recovery image +# contains a kernel or not. _board_strip_readonly_list += \ BOARD_USES_GENERIC_KERNEL_IMAGE \ + BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE \ _build_broken_var_list := \ BUILD_BROKEN_DUP_RULES \ @@ -752,3 +755,9 @@ $(foreach m,$(filter-out BUILD_COPY_HEADERS,$(DEFAULT_ERROR_BUILD_MODULE_TYPES)) $(if $(filter true,$(BUILD_BROKEN_USES_$(m))),\ $(KATI_deprecated_var $(m),Please convert to Soong),\ $(KATI_obsolete_var $(m),Please convert to Soong))) + +ifndef BUILDING_RECOVERY_IMAGE + ifeq (true,$(BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE)) + $(error Should not set BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE if not building recovery image) + endif +endif diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py index f5dfbecff..f8fc1419e 100644 --- a/tools/releasetools/common.py +++ b/tools/releasetools/common.py @@ -1257,23 +1257,27 @@ def _BuildBootableImage(image_name, sourcedir, fs_config_file, info_dict=None, for building the requested image. """ + if info_dict is None: + info_dict = OPTIONS.info_dict + # "boot" or "recovery", without extension. partition_name = os.path.basename(sourcedir).lower() + kernel = None if partition_name == "recovery": - kernel = "kernel" + if info_dict.get("exclude_kernel_from_recovery_image") == "true": + logger.info("Excluded kernel binary from recovery image.") + else: + kernel = "kernel" else: kernel = image_name.replace("boot", "kernel") kernel = kernel.replace(".img", "") - if not os.access(os.path.join(sourcedir, kernel), os.F_OK): + if kernel and not os.access(os.path.join(sourcedir, kernel), os.F_OK): return None if has_ramdisk and not os.access(os.path.join(sourcedir, "RAMDISK"), os.F_OK): return None - if info_dict is None: - info_dict = OPTIONS.info_dict - img = tempfile.NamedTemporaryFile() if has_ramdisk: @@ -1283,7 +1287,9 @@ def _BuildBootableImage(image_name, sourcedir, fs_config_file, info_dict=None, # use MKBOOTIMG from environ, or "mkbootimg" if empty or not set mkbootimg = os.getenv('MKBOOTIMG') or "mkbootimg" - cmd = [mkbootimg, "--kernel", os.path.join(sourcedir, kernel)] + cmd = [mkbootimg] + if kernel: + cmd += ["--kernel", os.path.join(sourcedir, kernel)] fn = os.path.join(sourcedir, "second") if os.access(fn, os.F_OK): From 881df39d237044fba5d440e23963a315c5aab2dd Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Fri, 9 Oct 2020 14:29:39 -0700 Subject: [PATCH 3/4] Add BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT. This variable indicates whether recovery resources are moved to vendor_boot. If true: - $OUT/recovery.img will not be built - $OUT/recovery/root will be included in vendor_boot ramdisk Bug: 156098440 Test: set to true and check output Test: `m target-files-package` and manually inspect output Change-Id: I56dda56bab7def1540f4fb506323e3e605620cd4 --- core/Makefile | 32 +++++++++++++++++++++++++++++--- core/board_config.mk | 22 ++++++++++++++++++++++ 2 files changed, 51 insertions(+), 3 deletions(-) diff --git a/core/Makefile b/core/Makefile index 9d13593ee..1cf0a0c38 100644 --- a/core/Makefile +++ b/core/Makefile @@ -162,11 +162,19 @@ endif $(call dist-for-goals,sdk,$(API_FINGERPRINT)) INSTALLED_RECOVERYIMAGE_TARGET := +# Build recovery image if +# BUILDING_RECOVERY_IMAGE && !BOARD_USES_RECOVERY_AS_BOOT && !BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT. +# If BOARD_USES_RECOVERY_AS_BOOT is true, leave empty because INSTALLED_BOOTIMAGE_TARGET is built +# with recovery resources. +# If BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT is true, leave empty to build recovery resources +# but not the final recovery image. ifdef BUILDING_RECOVERY_IMAGE ifneq ($(BOARD_USES_RECOVERY_AS_BOOT),true) +ifneq ($(BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT),true) INSTALLED_RECOVERYIMAGE_TARGET := $(PRODUCT_OUT)/recovery.img endif endif +endif include $(BUILD_SYSTEM)/sysprop.mk @@ -868,6 +876,12 @@ INSTALLED_BOOTIMAGE_TARGET := endif # BOARD_PREBUILT_BOOTIMAGE endif # TARGET_NO_KERNEL +# ----------------------------------------------------------------- +# declare recovery ramdisk files +ifeq ($(BUILDING_RECOVERY_IMAGE),true) +INTERNAL_RECOVERY_RAMDISK_FILES_TIMESTAMP := $(call intermediates-dir-for,PACKAGING,recovery)/ramdisk_files-timestamp +endif + # ----------------------------------------------------------------- # vendor boot image ifeq ($(BUILDING_VENDOR_BOOT_IMAGE),true) @@ -881,8 +895,14 @@ INTERNAL_VENDOR_RAMDISK_FILES := $(filter $(TARGET_VENDOR_RAMDISK_OUT)/%, \ $(ALL_DEFAULT_INSTALLED_MODULES)) INTERNAL_VENDOR_RAMDISK_TARGET := $(call intermediates-dir-for,PACKAGING,vendor-boot)/vendor-ramdisk.cpio$(RAMDISK_EXT) + +ifeq (true,$(BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT)) +$(INTERNAL_VENDOR_RAMDISK_TARGET): $(INTERNAL_RECOVERY_RAMDISK_FILES_TIMESTAMP) +$(INTERNAL_VENDOR_RAMDISK_TARGET): PRIVATE_ADDITIONAL_DIR := $(TARGET_RECOVERY_ROOT_OUT) +endif + $(INTERNAL_VENDOR_RAMDISK_TARGET): $(MKBOOTFS) $(INTERNAL_VENDOR_RAMDISK_FILES) | $(COMPRESSION_COMMAND_DEPS) - $(MKBOOTFS) -d $(TARGET_OUT) $(TARGET_VENDOR_RAMDISK_OUT) | $(COMPRESSION_COMMAND) > $@ + $(MKBOOTFS) -d $(TARGET_OUT) $(TARGET_VENDOR_RAMDISK_OUT) $(PRIVATE_ADDITIONAL_DIR) | $(COMPRESSION_COMMAND) > $@ ifdef BOARD_INCLUDE_DTB_IN_BOOTIMG INTERNAL_VENDOR_BOOTIMAGE_ARGS += --dtb $(INSTALLED_DTBIMAGE_TARGET) @@ -1897,7 +1917,7 @@ ifndef BOARD_RECOVERY_MKBOOTIMG_ARGS BOARD_RECOVERY_MKBOOTIMG_ARGS := $(BOARD_MKBOOTIMG_ARGS) endif -$(recovery_ramdisk): $(MKBOOTFS) $(COMPRESSION_COMMAND_DEPS) \ +$(INTERNAL_RECOVERY_RAMDISK_FILES_TIMESTAMP): $(MKBOOTFS) $(COMPRESSION_COMMAND_DEPS) \ $(INTERNAL_ROOT_FILES) \ $(INSTALLED_RAMDISK_TARGET) \ $(INTERNAL_RECOVERYIMAGE_FILES) \ @@ -1933,6 +1953,9 @@ $(recovery_ramdisk): $(MKBOOTFS) $(COMPRESSION_COMMAND_DEPS) \ cp -f $(recovery_wipe) $(TARGET_RECOVERY_ROOT_OUT)/system/etc/recovery.wipe) ln -sf prop.default $(TARGET_RECOVERY_ROOT_OUT)/default.prop $(BOARD_RECOVERY_IMAGE_PREPARE) + $(hide) touch $@ + +$(recovery_ramdisk): $(INTERNAL_RECOVERY_RAMDISK_FILES_TIMESTAMP) $(MKBOOTFS) -d $(TARGET_OUT) $(TARGET_RECOVERY_ROOT_OUT) | $(COMPRESSION_COMMAND) > $(recovery_ramdisk) # $(1): output file @@ -4214,8 +4237,11 @@ endif $(BUILT_TARGET_FILES_PACKAGE): $(updater_dep) # If we are using recovery as boot, output recovery files to BOOT/. +# If we are moving recovery resources to vendor_boot, output recovery files to VENDOR_BOOT/. ifeq ($(BOARD_USES_RECOVERY_AS_BOOT),true) $(BUILT_TARGET_FILES_PACKAGE): PRIVATE_RECOVERY_OUT := BOOT +else ifeq ($(BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT),true) +$(BUILT_TARGET_FILES_PACKAGE): PRIVATE_RECOVERY_OUT := VENDOR_BOOT else $(BUILT_TARGET_FILES_PACKAGE): PRIVATE_RECOVERY_OUT := RECOVERY endif @@ -4425,7 +4451,7 @@ $(BUILT_TARGET_FILES_PACKAGE): \ @echo "Package target files: $@" $(hide) rm -rf $@ $@.list $(zip_root) $(hide) mkdir -p $(dir $@) $(zip_root) -ifneq (,$(INSTALLED_RECOVERYIMAGE_TARGET)$(filter true,$(BOARD_USES_RECOVERY_AS_BOOT))) +ifneq (,$(INSTALLED_RECOVERYIMAGE_TARGET)$(filter true,$(BOARD_USES_RECOVERY_AS_BOOT))$(filter true,$(BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT))) @# Components of the recovery image $(hide) mkdir -p $(zip_root)/$(PRIVATE_RECOVERY_OUT) $(hide) $(call package_files-copy-root, \ diff --git a/core/board_config.mk b/core/board_config.mk index 73900a686..03d2b3e78 100644 --- a/core/board_config.mk +++ b/core/board_config.mk @@ -103,9 +103,12 @@ _board_strip_readonly_list += \ # Update mechanism of the boot image is not enforced by this variable. # - BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE controls whether the recovery image # contains a kernel or not. +# - BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT controls whether ramdisk +# recovery resources are built to vendor_boot. _board_strip_readonly_list += \ BOARD_USES_GENERIC_KERNEL_IMAGE \ BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE \ + BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT \ _build_broken_var_list := \ BUILD_BROKEN_DUP_RULES \ @@ -374,6 +377,9 @@ BUILDING_RECOVERY_IMAGE := ifeq ($(PRODUCT_BUILD_RECOVERY_IMAGE),) ifeq ($(BOARD_USES_RECOVERY_AS_BOOT),true) BUILDING_RECOVERY_IMAGE := true + else ifeq ($(BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT),true) + # Set to true to build recovery resources for vendor_boot + BUILDING_RECOVERY_IMAGE := true else ifdef BOARD_RECOVERYIMAGE_PARTITION_SIZE ifeq (,$(filter true, $(TARGET_NO_KERNEL) $(TARGET_NO_RECOVERY))) BUILDING_RECOVERY_IMAGE := true @@ -761,3 +767,19 @@ ifndef BUILDING_RECOVERY_IMAGE $(error Should not set BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE if not building recovery image) endif endif + +ifndef BUILDING_VENDOR_BOOT_IMAGE + ifeq (true,$(BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT)) + $(error Should not set BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT if not building vendor_boot image) + endif +endif + +# If BOARD_USES_GENERIC_KERNEL_IMAGE is set, BOARD_USES_RECOVERY_AS_BOOT must not be set. +# Devices without a dedicated recovery partition uses BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT to +# build recovery into vendor_boot. +ifeq (true,$(BOARD_USES_GENERIC_KERNEL_IMAGE)) + ifeq (true,$(BOARD_USES_RECOVERY_AS_BOOT)) + $(error BOARD_USES_RECOVERY_AS_BOOT cannot be true if BOARD_USES_GENERIC_KERNEL_IMAGE is true. \ + Use BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT instead) + endif +endif From aad34e5b7edd474e0aafaa1d6fb00946d2d39b32 Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Mon, 12 Oct 2020 11:08:30 -0700 Subject: [PATCH 4/4] Exclude board cmdline/dtb/pagesize/base in generic boot image When building with BOARD_USES_GENERIC_KERNEL_IMAGE, even if BUILDING_VENDOR_BOOT_IMAGE is not set, do not include board-specific cmdline, dtb, page size, and base in the generic boot image. This change drops buildvariant=* in the cmdline of the generic boot image Bug: 156098440 Test: manual. Deliberately set BOARD_KERNEL_CMDLINE for aosp_arm64 and ensure it doesn't go into the boot image. Change-Id: I846f600058a4a9b349d55c9773d6dd81bbe49312 --- core/Makefile | 50 +++++++++++++++++++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/core/Makefile b/core/Makefile index 1cf0a0c38..b307ce5cb 100644 --- a/core/Makefile +++ b/core/Makefile @@ -754,7 +754,19 @@ endif INTERNAL_KERNEL_CMDLINE := $(strip $(INTERNAL_KERNEL_CMDLINE) buildvariant=$(TARGET_BUILD_VARIANT) $(VERITY_KEYID)) -ifndef BUILDING_VENDOR_BOOT_IMAGE +boot_uses_generic_kernel_image := +ifdef BUILDING_VENDOR_BOOT_IMAGE + # building vendor boot image, dtb/base/pagesize go there + boot_uses_generic_kernel_image := true +else ifeq (true,$(BOARD_USES_GENERIC_KERNEL_IMAGE)) + boot_uses_generic_kernel_image := true +endif + +ifeq (true,$(boot_uses_generic_kernel_image)) + ifdef GENERIC_KERNEL_CMDLINE + INTERNAL_BOOTIMAGE_ARGS += --cmdline "$(GENERIC_KERNEL_CMDLINE)" + endif +else # boot_uses_generic_kernel_image != true ifdef BOARD_KERNEL_BASE INTERNAL_BOOTIMAGE_ARGS += --base $(BOARD_KERNEL_BASE) endif @@ -764,12 +776,8 @@ endif ifdef INTERNAL_KERNEL_CMDLINE INTERNAL_BOOTIMAGE_ARGS += --cmdline "$(INTERNAL_KERNEL_CMDLINE)" endif -else -# building vendor boot image, dtb/base/pagesize go there -ifdef GENERIC_KERNEL_CMDLINE - INTERNAL_BOOTIMAGE_ARGS += --cmdline "$(GENERIC_KERNEL_CMDLINE)" -endif -endif +endif # boot_uses_generic_kernel_image == true +boot_uses_generic_kernel_image := INTERNAL_MKBOOTIMG_VERSION_ARGS := \ --os_version $(PLATFORM_VERSION_LAST_STABLE) \ @@ -1882,17 +1890,23 @@ endif ifeq (truetrue,$(strip $(BUILDING_VENDOR_BOOT_IMAGE))$(strip $(AB_OTA_UPDATER))) INTERNAL_RECOVERYIMAGE_ARGS := --ramdisk $(recovery_ramdisk) + +ifneq (true,$(BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE)) ifdef GENERIC_KERNEL_CMDLINE INTERNAL_RECOVERYIMAGE_ARGS += --cmdline "$(GENERIC_KERNEL_CMDLINE)" -endif +endif # GENERIC_KERNEL_CMDLINE != "" +endif # BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE != true + else # not (BUILDING_VENDOR_BOOT_IMAGE and AB_OTA_UPDATER) INTERNAL_RECOVERYIMAGE_ARGS := \ $(addprefix --second ,$(INSTALLED_2NDBOOTLOADER_TARGET)) \ --ramdisk $(recovery_ramdisk) # Assumes this has already been stripped +ifneq (true,$(BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE)) ifdef INTERNAL_KERNEL_CMDLINE INTERNAL_RECOVERYIMAGE_ARGS += --cmdline "$(INTERNAL_KERNEL_CMDLINE)" -endif +endif # INTERNAL_KERNEL_CMDLINE != "" +endif # BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE != true ifdef BOARD_KERNEL_BASE INTERNAL_RECOVERYIMAGE_ARGS += --base $(BOARD_KERNEL_BASE) endif @@ -4464,7 +4478,9 @@ else ifneq (true,$(BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE)) endif endif ifeq (truetrue,$(strip $(BUILDING_VENDOR_BOOT_IMAGE))$(strip $(AB_OTA_UPDATER))) +ifneq (true,$(BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE)) echo "$(GENERIC_KERNEL_CMDLINE)" > $(zip_root)/$(PRIVATE_RECOVERY_OUT)/cmdline +endif # BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE != true else # not (BUILDING_VENDOR_BOOT_IMAGE and AB_OTA_UPDATER) ifdef INSTALLED_2NDBOOTLOADER_TARGET cp $(INSTALLED_2NDBOOTLOADER_TARGET) $(zip_root)/$(PRIVATE_RECOVERY_OUT)/second @@ -4482,9 +4498,11 @@ endif ifdef INSTALLED_DTBIMAGE_TARGET cp $(INSTALLED_DTBIMAGE_TARGET) $(zip_root)/$(PRIVATE_RECOVERY_OUT)/dtb endif +ifneq (true,$(BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE)) ifdef INTERNAL_KERNEL_CMDLINE echo "$(INTERNAL_KERNEL_CMDLINE)" > $(zip_root)/$(PRIVATE_RECOVERY_OUT)/cmdline -endif +endif # INTERNAL_KERNEL_CMDLINE != "" +endif # BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE != true ifdef BOARD_KERNEL_BASE echo "$(BOARD_KERNEL_BASE)" > $(zip_root)/$(PRIVATE_RECOVERY_OUT)/base endif @@ -4507,23 +4525,25 @@ endif ifdef INSTALLED_KERNEL_TARGET $(hide) cp $(INSTALLED_KERNEL_TARGET) $(zip_root)/BOOT/ endif -ifndef INSTALLED_VENDOR_BOOTIMAGE_TARGET +ifdef INSTALLED_VENDOR_BOOTIMAGE_TARGET + echo "$(GENERIC_KERNEL_CMDLINE)" > $(zip_root)/BOOT/cmdline +else ifeq (true,$(BOARD_USES_GENERIC_KERNEL_IMAGE)) + echo "$(GENERIC_KERNEL_CMDLINE)" > $(zip_root)/BOOT/cmdline +else # INSTALLED_VENDOR_BOOTIMAGE_TARGET == "" && BOARD_USES_GENERIC_KERNEL_IMAGE != true + echo "$(INTERNAL_KERNEL_CMDLINE)" > $(zip_root)/BOOT/cmdline ifdef INSTALLED_2NDBOOTLOADER_TARGET cp $(INSTALLED_2NDBOOTLOADER_TARGET) $(zip_root)/BOOT/second endif ifdef INSTALLED_DTBIMAGE_TARGET cp $(INSTALLED_DTBIMAGE_TARGET) $(zip_root)/BOOT/dtb endif - echo "$(INTERNAL_KERNEL_CMDLINE)" > $(zip_root)/BOOT/cmdline ifdef BOARD_KERNEL_BASE echo "$(BOARD_KERNEL_BASE)" > $(zip_root)/BOOT/base endif ifdef BOARD_KERNEL_PAGESIZE echo "$(BOARD_KERNEL_PAGESIZE)" > $(zip_root)/BOOT/pagesize endif -else # INSTALLED_VENDOR_BOOTIMAGE_TARGET defined - echo "$(GENERIC_KERNEL_CMDLINE)" > $(zip_root)/BOOT/cmdline -endif # INSTALLED_VENDOR_BOOTIMAGE_TARGET defined +endif # INSTALLED_VENDOR_BOOTIMAGE_TARGET == "" && BOARD_USES_GENERIC_KERNEL_IMAGE != true endif # BOARD_USES_RECOVERY_AS_BOOT not true $(hide) $(foreach t,$(INSTALLED_RADIOIMAGE_TARGET),\ mkdir -p $(zip_root)/RADIO; \