diff options
author | dhacker29 <dhackerdvm@gmail.com> | 2015-10-17 04:46:33 -0400 |
---|---|---|
committer | dhacker29 <dhackerdvm@gmail.com> | 2015-10-17 04:53:05 -0400 |
commit | 3d1c612e5c829a6b621f3bb20f6e361743c094a1 (patch) | |
tree | 93f72317fcb404e10d37ae1a019be70dc97e265d /core/Makefile | |
parent | 8e0ac2481e3e664deb3357ccd1b1c965d08aa267 (diff) | |
download | build-3d1c612e5c829a6b621f3bb20f6e361743c094a1.zip build-3d1c612e5c829a6b621f3bb20f6e361743c094a1.tar.gz build-3d1c612e5c829a6b621f3bb20f6e361743c094a1.tar.bz2 |
Revert "Revert "core: Makefile: Build install-recovery into the system image""
This reverts commit 468ddd95411ca8616d2a11038161e5f776c36d53.
Change-Id: I09e65907ad0f6374b55deaca1fa380b304fb10f6
Diffstat (limited to 'core/Makefile')
-rw-r--r-- | core/Makefile | 75 |
1 files changed, 73 insertions, 2 deletions
diff --git a/core/Makefile b/core/Makefile index 9c9f61b..f6748de 100644 --- a/core/Makefile +++ b/core/Makefile @@ -872,6 +872,7 @@ recovery_fstab := $(strip $(wildcard $(TARGET_DEVICE_DIR)/recovery.fstab)) endif # Named '.dat' so we don't attempt to use imgdiff for patching it. RECOVERY_RESOURCE_ZIP := $(TARGET_OUT)/etc/recovery-resource.dat +RECOVERY_PATCH_INSTALL := $(TARGET_OUT)/bin/install-recovery.sh ifeq ($(recovery_resources_private),) $(info No private recovery resources for TARGET_DEVICE $(TARGET_DEVICE)) @@ -991,6 +992,69 @@ $(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTIMG) $(recovery_ramdisk) $(recovery_k $(call build-recoveryimage-target, $@) endif # BOARD_CUSTOM_BOOTIMG_MK +recovery_patch_path := $(call intermediates-dir-for,PACKAGING,recovery_patch) +ota_temp_root := $(PRODUCT_OUT)/ota_temp +$(RECOVERY_PATCH_INSTALL): PRIVATE_RECOVERY_API_VERSION := $(RECOVERY_API_VERSION) +$(RECOVERY_PATCH_INSTALL): PRIVATE_RECOVERY_FSTAB_VERSION := $(RECOVERY_FSTAB_VERSION) +$(RECOVERY_PATCH_INSTALL): $(INSTALLED_RECOVERYIMAGE_TARGET) \ + $(RECOVERY_FROM_BOOT_PATCH) \ + $(ALL_PREBUILT) \ + $(ALL_COPIED_HEADERS) \ + $(ALL_GENERATED_SOURCES) \ + $(ALL_DEFAULT_INSTALLED_MODULES) \ + $(PDK_FUSION_SYSIMG_FILES) + @echo "Installing recovery patch to system partition" + $(hide) mkdir -p $(ota_temp_root) + $(hide) mkdir -p $(ota_temp_root)/BOOT + $(hide) mkdir -p $(ota_temp_root)/RECOVERY + $(hide) mkdir -p $(ota_temp_root)/BOOTABLE_IMAGES + $(hide) mkdir -p $(ota_temp_root)/SYSTEM + $(hide) mkdir -p $(ota_temp_root)/SYSTEM/bin + $(hide) mkdir -p $(ota_temp_root)/SYSTEM/etc + $(hide) mkdir -p $(ota_temp_root)/META + $(hide) $(call package_files-copy-root, \ + $(TARGET_RECOVERY_ROOT_OUT),$(ota_temp_root)/RECOVERY/RAMDISK) + $(hide) $(call package_files-copy-root, \ + $(TARGET_ROOT_OUT),$(ota_temp_root)/BOOT/RAMDISK) + $(hide) $(call package_files-copy-root, \ + $(TARGET_OUT)/etc,$(ota_temp_root)/SYSTEM/etc) + @echo "recovery_api_version=$(PRIVATE_RECOVERY_API_VERSION)" > $(ota_temp_root)/META/misc_info.txt + @echo "fstab_version=$(PRIVATE_RECOVERY_FSTAB_VERSION)" >> $(ota_temp_root)/META/misc_info.txt +ifdef BOARD_FLASH_BLOCK_SIZE + @echo "blocksize=$(BOARD_FLASH_BLOCK_SIZE)" >> $(ota_temp_root)/META/misc_info.txt +endif +ifdef BOARD_BOOTIMAGE_PARTITION_SIZE + @echo "boot_size=$(BOARD_BOOTIMAGE_PARTITION_SIZE)" >> $(ota_temp_root)/META/misc_info.txt +endif +ifdef BOARD_RECOVERYIMAGE_PARTITION_SIZE + @echo "recovery_size=$(BOARD_RECOVERYIMAGE_PARTITION_SIZE)" >> $(ota_temp_root)/META/misc_info.txt +endif +ifdef TARGET_RECOVERY_FSTYPE_MOUNT_OPTIONS + @# TARGET_RECOVERY_FSTYPE_MOUNT_OPTIONS can be empty to indicate that nothing but defaults should be used. + @echo "recovery_mount_options=$(TARGET_RECOVERY_FSTYPE_MOUNT_OPTIONS)" >> $(ota_temp_root)/META/misc_info.txt +else + @echo "recovery_mount_options=$(DEFAULT_TARGET_RECOVERY_FSTYPE_MOUNT_OPTIONS)" >> $(ota_temp_root)/META/misc_info.txt +endif + @echo "tool_extensions=$(tool_extensions)" >> $(ota_temp_root)/META/misc_info.txt + @echo "default_system_dev_certificate=$(DEFAULT_SYSTEM_DEV_CERTIFICATE)" >> $(ota_temp_root)/META/misc_info.txt +ifdef PRODUCT_EXTRA_RECOVERY_KEYS + @echo "extra_recovery_keys=$(PRODUCT_EXTRA_RECOVERY_KEYS)" >> $(ota_temp_root)/META/misc_info.txt +endif + @echo 'mkbootimg_args=$(BOARD_MKBOOTIMG_ARGS)' >> $(ota_temp_root)/META/misc_info.txt + @echo "use_set_metadata=1" >> $(ota_temp_root)/META/misc_info.txt + @echo "multistage_support=1" >> $(ota_temp_root)/META/misc_info.txt + @echo "update_rename_support=1" >> $(ota_temp_root)/META/misc_info.txt +ifneq ($(OEM_THUMBPRINT_PROPERTIES),) + # OTA scripts are only interested in fingerprint related properties + @echo "oem_fingerprint_properties=$(OEM_THUMBPRINT_PROPERTIES)" >> $(ota_temp_root)/META/misc_info.txt +endif + $(call generate-userimage-prop-dictionary, $(ota_temp_root)/META/misc_info.txt) + $(hide) cp -r $(PRODUCT_OUT)/boot.img $(ota_temp_root)/BOOTABLE_IMAGES/ + $(hide) cp -r $(PRODUCT_OUT)/recovery.img $(ota_temp_root)/BOOTABLE_IMAGES/ + $(hide) ./build/tools/releasetools/make_recovery_patch $(ota_temp_root) $(ota_temp_root) + $(hide) cp --remove-destination $(ota_temp_root)/SYSTEM/bin/install-recovery.sh $(TARGET_OUT)/bin/install-recovery.sh + $(hide) cp --remove-destination $(ota_temp_root)/SYSTEM/recovery-from-boot.p $(TARGET_OUT)/recovery-from-boot.p + $(RECOVERY_RESOURCE_ZIP): $(INSTALLED_RECOVERYIMAGE_TARGET) $(hide) mkdir -p $(dir $@) $(hide) find $(TARGET_RECOVERY_ROOT_OUT)/res -type f | sort | zip -0qrj $@ -@ @@ -1003,7 +1067,6 @@ recoveryimage-nodeps: else RECOVERY_RESOURCE_ZIP := endif - .PHONY: recoveryimage recoveryimage: $(INSTALLED_RECOVERYIMAGE_TARGET) $(RECOVERY_RESOURCE_ZIP) @@ -1034,7 +1097,8 @@ INTERNAL_SYSTEMIMAGE_FILES := $(filter $(TARGET_OUT)/%, \ $(ALL_GENERATED_SOURCES) \ $(ALL_DEFAULT_INSTALLED_MODULES) \ $(PDK_FUSION_SYSIMG_FILES) \ - $(RECOVERY_RESOURCE_ZIP)) + $(RECOVERY_RESOURCE_ZIP) \ + $(RECOVERY_PATCH_INSTALL)) FULL_SYSTEMIMAGE_DEPS := $(INTERNAL_SYSTEMIMAGE_FILES) $(INTERNAL_USERIMAGES_DEPS) @@ -1540,6 +1604,13 @@ $(BUILT_TARGET_FILES_PACKAGE): \ $(TARGET_RECOVERY_ROOT_OUT),$(zip_root)/RECOVERY/RAMDISK) @# OTA install helpers $(hide) $(call package_files-copy-root, $(OUT)/install, $(zip_root)/INSTALL) +# Just copy the already built boot/recovery images into the target-files dir +# in order to avoid mismatched images between the out dir and what the ota +# build system tries to rebuild. + $(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/ + ifdef INSTALLED_KERNEL_TARGET $(hide) $(ACP) $(INSTALLED_KERNEL_TARGET) $(zip_root)/RECOVERY/kernel endif |