diff --git a/core/Makefile b/core/Makefile index c8878b964e..603bb8adee 100644 --- a/core/Makefile +++ b/core/Makefile @@ -1249,6 +1249,8 @@ INTERNAL_MKBOOTIMG_VERSION_ARGS := \ 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) @@ -1319,6 +1321,7 @@ bootimage-nodeps: $(MKBOOTIMG) $(hide) $(call assert-max-image-size,$(INSTALLED_BOOTIMAGE_TARGET),$(BOARD_BOOTIMAGE_PARTITION_SIZE)) endif # TARGET_BOOTIMAGE_USE_EXT2 +endif # BOARD_CUSTOM_BOOTIMG_MK not defined endif # BUILDING_BOOT_IMAGE else # TARGET_NO_KERNEL == "true" @@ -1928,6 +1931,7 @@ IGNORE_RECOVERY_SEPOLICY := $(patsubst $(TARGET_RECOVERY_OUT)/%,--exclude=/%,$(r recovery_kernel := $(INSTALLED_KERNEL_TARGET) # same as a non-recovery system recovery_ramdisk := $(PRODUCT_OUT)/ramdisk-recovery.img +recovery_uncompressed_ramdisk := $(PRODUCT_OUT)/ramdisk-recovery.cpio recovery_resources_common := $(call include-path-for, recovery)/res # Set recovery_density to a density bucket based on TARGET_SCREEN_DENSITY, PRODUCT_AAPT_PREF_CONFIG, @@ -2191,7 +2195,7 @@ ifndef BOARD_RECOVERY_MKBOOTIMG_ARGS BOARD_RECOVERY_MKBOOTIMG_ARGS := $(BOARD_MKBOOTIMG_ARGS) endif -$(recovery_ramdisk): $(MKBOOTFS) $(COMPRESSION_COMMAND_DEPS) \ +$(recovery_uncompressed_ramdisk): $(MKBOOTFS) \ $(INTERNAL_ROOT_FILES) \ $(INSTALLED_RAMDISK_TARGET) \ $(INTERNAL_RECOVERYIMAGE_FILES) \ @@ -2226,7 +2230,13 @@ $(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) - $(MKBOOTFS) -d $(TARGET_OUT) $(TARGET_RECOVERY_ROOT_OUT) | $(COMPRESSION_COMMAND) > $(recovery_ramdisk) + @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): kernel file @@ -2285,8 +2295,12 @@ $(INSTALLED_BOOTIMAGE_TARGET): $(recoveryimage-deps) $(call build-recoveryimage-target, $@, $(PRODUCT_OUT)/$(subst .img,,$(subst boot,kernel,$(notdir $@)))) endif # BOARD_USES_RECOVERY_AS_BOOT +ifndef BOARD_CUSTOM_BOOTIMG_MK $(INSTALLED_RECOVERYIMAGE_TARGET): $(recoveryimage-deps) $(call build-recoveryimage-target, $@, $(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) @@ -2315,6 +2329,11 @@ ifneq ($(BOARD_NAND_SPARE_SIZE),) $(error MTD device is no longer supported and thus BOARD_NAND_SPARE_SIZE is deprecated.) endif +ifdef BOARD_CUSTOM_BOOTIMG_MK +include $(BOARD_CUSTOM_BOOTIMG_MK) +endif + + ifneq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true) # ----------------------------------------------------------------- # the debug ramdisk, which is the original ramdisk plus additional @@ -4707,6 +4726,12 @@ ifdef BOARD_KERNEL_PAGESIZE endif echo "$(INTERNAL_KERNEL_CMDLINE)" > $(zip_root)/VENDOR_BOOT/vendor_cmdline 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, \