diff --git a/core/Makefile b/core/Makefile index ecdad6cb49..b6cae02575 100644 --- a/core/Makefile +++ b/core/Makefile @@ -1073,6 +1073,8 @@ endif ifdef BUILDING_BOOT_IMAGE INSTALLED_BOOTIMAGE_TARGET := $(BUILT_BOOTIMAGE_TARGET) +ifndef BOARD_CUSTOM_BOOTIMG_MK + ifeq ($(TARGET_BOOTIMAGE_USE_EXT2),true) $(error TARGET_BOOTIMAGE_USE_EXT2 is not supported anymore) endif # TARGET_BOOTIMAGE_USE_EXT2 @@ -1185,6 +1187,7 @@ bootimage-nodeps: $(MKBOOTIMG) $(foreach b,$(INSTALLED_BOOTIMAGE_TARGET),$(call build_boot_novboot,$(b))) endif # BOARD_AVB_ENABLE +endif # BOARD_CUSTOM_BOOTIMG_MK not defined endif # BUILDING_BOOT_IMAGE else # TARGET_NO_KERNEL == "true" @@ -2121,6 +2124,7 @@ IGNORE_RECOVERY_SEPOLICY := $(patsubst $(TARGET_RECOVERY_OUT)/%,--exclude=/%,$(r # for the recovery image recovery_kernel := $(firstword $(INSTALLED_KERNEL_TARGET)) recovery_ramdisk := $(PRODUCT_OUT)/ramdisk-recovery.img +recovery_uncompressed_ramdisk := $(PRODUCT_OUT)/ramdisk-recovery.cpio recovery_resources_common := bootable/recovery/res # Set recovery_density to a density bucket based on TARGET_SCREEN_DENSITY, PRODUCT_AAPT_PREF_CONFIG, @@ -2380,7 +2384,7 @@ ifndef BOARD_RECOVERY_MKBOOTIMG_ARGS BOARD_RECOVERY_MKBOOTIMG_ARGS := $(BOARD_MKBOOTIMG_ARGS) endif -$(INTERNAL_RECOVERY_RAMDISK_FILES_TIMESTAMP): $(MKBOOTFS) $(COMPRESSION_COMMAND_DEPS) \ +$(INTERNAL_RECOVERY_RAMDISK_FILES_TIMESTAMP): $(MKBOOTFS) \ $(INTERNAL_ROOT_FILES) \ $(INSTALLED_RAMDISK_TARGET) \ $(INTERNAL_RECOVERYIMAGE_FILES) \ @@ -2418,8 +2422,13 @@ $(INTERNAL_RECOVERY_RAMDISK_FILES_TIMESTAMP): $(MKBOOTFS) $(COMPRESSION_COMMAND_ $(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) +$(recovery_uncompressed_ramdisk): $(INTERNAL_RECOVERY_RAMDISK_FILES_TIMESTAMP) + @echo ----- Making uncompressed recovery ramdisk ------ + $(MKBOOTFS) $(TARGET_RECOVERY_ROOT_OUT) > $@ + +$(recovery_ramdisk): $(recovery_uncompressed_ramdisk) $(COMPRESSION_COMMAND_DEPS) + @echo ----- Making compressed recovery ramdisk ------ + $(COMPRESSION_COMMAND) < $(recovery_uncompressed_ramdisk) > $@ # $(1): output file # $(2): optional kernel file @@ -2484,9 +2493,13 @@ $(call declare-container-license-deps,$(INSTALLED_BOOTIMAGE_TARGET),$(recoveryim UNMOUNTED_NOTICE_DEPS += $(INSTALLED_BOOTIMAGE_TARGET) endif # BOARD_USES_RECOVERY_AS_BOOT +ifndef BOARD_CUSTOM_BOOTIMG_MK $(INSTALLED_RECOVERYIMAGE_TARGET): $(recoveryimage-deps) $(call build-recoveryimage-target, $@, \ $(if $(filter true, $(BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE)),, $(recovery_kernel))) +else +INTERNAL_RECOVERYIMAGE_ARGS += --kernel $(recovery_kernel) +endif # BOARD_CUSTOM_BOOTIMG_MK ifdef RECOVERY_RESOURCE_ZIP $(RECOVERY_RESOURCE_ZIP): $(INSTALLED_RECOVERYIMAGE_TARGET) | $(ZIPTIME) @@ -2568,6 +2581,9 @@ $(eval $(call declare-0p-target,$(INSTALLED_FILES_JSON_DEBUG_RAMDISK))) ifdef BUILDING_DEBUG_BOOT_IMAGE +ifdef BOARD_CUSTOM_BOOTIMG_MK +include $(BOARD_CUSTOM_BOOTIMG_MK) +endif # ----------------------------------------------------------------- # the debug ramdisk, which is the original ramdisk plus additional # files: force_debuggable, adb_debug.prop and userdebug sepolicy. @@ -5756,6 +5772,12 @@ ifdef BOARD_KERNEL_PAGESIZE echo "$(BOARD_KERNEL_PAGESIZE)" > $(zip_root)/VENDOR_KERNEL_BOOT/pagesize endif endif # INSTALLED_VENDOR_BOOTIMAGE_TARGET +ifdef BOARD_CUSTOM_BOOTIMG + @# Prebuilt boot images + $(hide) mkdir -p $(zip_root)/BOOTABLE_IMAGES + $(hide) $(ACP) $(INSTALLED_BOOTIMAGE_TARGET) $(zip_root)/BOOTABLE_IMAGES/ + $(hide) $(ACP) $(INSTALLED_RECOVERYIMAGE_TARGET) $(zip_root)/BOOTABLE_IMAGES/ +endif ifdef BUILDING_SYSTEM_IMAGE @# Contents of the system image $(hide) $(call package_files-copy-root, \