Merge "Honor TARGET_NO_RECOVERY flag."
This commit is contained in:
@@ -1485,6 +1485,7 @@ $(BUILT_TARGET_FILES_PACKAGE): \
|
|||||||
@echo "Package target files: $@"
|
@echo "Package target files: $@"
|
||||||
$(hide) rm -rf $@ $(zip_root)
|
$(hide) rm -rf $@ $(zip_root)
|
||||||
$(hide) mkdir -p $(dir $@) $(zip_root)
|
$(hide) mkdir -p $(dir $@) $(zip_root)
|
||||||
|
ifneq ($(INSTALLED_RECOVERYIMAGE_TARGET),)
|
||||||
@# Components of the recovery image
|
@# Components of the recovery image
|
||||||
$(hide) mkdir -p $(zip_root)/RECOVERY
|
$(hide) mkdir -p $(zip_root)/RECOVERY
|
||||||
$(hide) $(call package_files-copy-root, \
|
$(hide) $(call package_files-copy-root, \
|
||||||
@@ -1504,6 +1505,7 @@ ifdef BOARD_KERNEL_BASE
|
|||||||
endif
|
endif
|
||||||
ifdef BOARD_KERNEL_PAGESIZE
|
ifdef BOARD_KERNEL_PAGESIZE
|
||||||
$(hide) echo "$(BOARD_KERNEL_PAGESIZE)" > $(zip_root)/RECOVERY/pagesize
|
$(hide) echo "$(BOARD_KERNEL_PAGESIZE)" > $(zip_root)/RECOVERY/pagesize
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
@# Components of the boot image
|
@# Components of the boot image
|
||||||
$(hide) mkdir -p $(zip_root)/BOOT
|
$(hide) mkdir -p $(zip_root)/BOOT
|
||||||
@@ -1567,6 +1569,9 @@ endif
|
|||||||
ifdef BOARD_BOOTIMAGE_PARTITION_SIZE
|
ifdef BOARD_BOOTIMAGE_PARTITION_SIZE
|
||||||
$(hide) echo "boot_size=$(BOARD_BOOTIMAGE_PARTITION_SIZE)" >> $(zip_root)/META/misc_info.txt
|
$(hide) echo "boot_size=$(BOARD_BOOTIMAGE_PARTITION_SIZE)" >> $(zip_root)/META/misc_info.txt
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(INSTALLED_RECOVERYIMAGE_TARGET),)
|
||||||
|
$(hide) echo "no_recovery=true" >> $(zip_root)/META/misc_info.txt
|
||||||
|
endif
|
||||||
ifdef BOARD_RECOVERYIMAGE_PARTITION_SIZE
|
ifdef BOARD_RECOVERYIMAGE_PARTITION_SIZE
|
||||||
$(hide) echo "recovery_size=$(BOARD_RECOVERYIMAGE_PARTITION_SIZE)" >> $(zip_root)/META/misc_info.txt
|
$(hide) echo "recovery_size=$(BOARD_RECOVERYIMAGE_PARTITION_SIZE)" >> $(zip_root)/META/misc_info.txt
|
||||||
endif
|
endif
|
||||||
@@ -1631,7 +1636,9 @@ ifeq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true)
|
|||||||
else
|
else
|
||||||
$(hide) zipinfo -1 $@ | awk 'BEGIN { FS="BOOT/RAMDISK/" } /^BOOT\/RAMDISK\// {print $$2}' | $(HOST_OUT_EXECUTABLES)/fs_config -C -D $(TARGET_OUT) -S $(SELINUX_FC) > $(zip_root)/META/boot_filesystem_config.txt
|
$(hide) zipinfo -1 $@ | awk 'BEGIN { FS="BOOT/RAMDISK/" } /^BOOT\/RAMDISK\// {print $$2}' | $(HOST_OUT_EXECUTABLES)/fs_config -C -D $(TARGET_OUT) -S $(SELINUX_FC) > $(zip_root)/META/boot_filesystem_config.txt
|
||||||
endif
|
endif
|
||||||
|
ifneq ($(INSTALLED_RECOVERYIMAGE_TARGET),)
|
||||||
$(hide) zipinfo -1 $@ | awk 'BEGIN { FS="RECOVERY/RAMDISK/" } /^RECOVERY\/RAMDISK\// {print $$2}' | $(HOST_OUT_EXECUTABLES)/fs_config -C -D $(TARGET_OUT) -S $(SELINUX_FC) > $(zip_root)/META/recovery_filesystem_config.txt
|
$(hide) zipinfo -1 $@ | awk 'BEGIN { FS="RECOVERY/RAMDISK/" } /^RECOVERY\/RAMDISK\// {print $$2}' | $(HOST_OUT_EXECUTABLES)/fs_config -C -D $(TARGET_OUT) -S $(SELINUX_FC) > $(zip_root)/META/recovery_filesystem_config.txt
|
||||||
|
endif
|
||||||
$(hide) (cd $(zip_root) && zip -q ../$(notdir $@) META/*filesystem_config.txt)
|
$(hide) (cd $(zip_root) && zip -q ../$(notdir $@) META/*filesystem_config.txt)
|
||||||
$(hide) PATH=$(foreach p,$(INTERNAL_USERIMAGES_BINARY_PATHS),$(p):)$$PATH MKBOOTIMG=$(MKBOOTIMG) \
|
$(hide) PATH=$(foreach p,$(INTERNAL_USERIMAGES_BINARY_PATHS),$(p):)$$PATH MKBOOTIMG=$(MKBOOTIMG) \
|
||||||
./build/tools/releasetools/add_img_to_target_files -v -p $(HOST_OUT) $@
|
./build/tools/releasetools/add_img_to_target_files -v -p $(HOST_OUT) $@
|
||||||
|
@@ -271,6 +271,8 @@ def AddImagesToTargetFiles(filename):
|
|||||||
output_zip = zipfile.ZipFile(filename, "a",
|
output_zip = zipfile.ZipFile(filename, "a",
|
||||||
compression=zipfile.ZIP_DEFLATED)
|
compression=zipfile.ZIP_DEFLATED)
|
||||||
|
|
||||||
|
has_recovery = (OPTIONS.info_dict.get("no_recovery") != "true")
|
||||||
|
|
||||||
def banner(s):
|
def banner(s):
|
||||||
print "\n\n++++ " + s + " ++++\n\n"
|
print "\n\n++++ " + s + " ++++\n\n"
|
||||||
|
|
||||||
@@ -288,14 +290,16 @@ def AddImagesToTargetFiles(filename):
|
|||||||
if boot_image:
|
if boot_image:
|
||||||
boot_image.AddToZip(output_zip)
|
boot_image.AddToZip(output_zip)
|
||||||
|
|
||||||
banner("recovery")
|
|
||||||
recovery_image = None
|
recovery_image = None
|
||||||
|
if has_recovery:
|
||||||
|
banner("recovery")
|
||||||
prebuilt_path = os.path.join(OPTIONS.input_tmp, "IMAGES", "recovery.img")
|
prebuilt_path = os.path.join(OPTIONS.input_tmp, "IMAGES", "recovery.img")
|
||||||
if os.path.exists(prebuilt_path):
|
if os.path.exists(prebuilt_path):
|
||||||
print "recovery.img already exists in IMAGES/, no need to rebuild..."
|
print "recovery.img already exists in IMAGES/, no need to rebuild..."
|
||||||
if OPTIONS.rebuild_recovery:
|
if OPTIONS.rebuild_recovery:
|
||||||
recovery_image = common.GetBootableImage(
|
recovery_image = common.GetBootableImage(
|
||||||
"IMAGES/recovery.img", "recovery.img", OPTIONS.input_tmp, "RECOVERY")
|
"IMAGES/recovery.img", "recovery.img", OPTIONS.input_tmp,
|
||||||
|
"RECOVERY")
|
||||||
else:
|
else:
|
||||||
recovery_image = common.GetBootableImage(
|
recovery_image = common.GetBootableImage(
|
||||||
"IMAGES/recovery.img", "recovery.img", OPTIONS.input_tmp, "RECOVERY")
|
"IMAGES/recovery.img", "recovery.img", OPTIONS.input_tmp, "RECOVERY")
|
||||||
|
@@ -102,6 +102,7 @@ def main(argv):
|
|||||||
if boot_image:
|
if boot_image:
|
||||||
boot_image.AddToZip(output_zip)
|
boot_image.AddToZip(output_zip)
|
||||||
|
|
||||||
|
if OPTIONS.info_dict.get("no_recovery") != "true":
|
||||||
recovery_image = common.GetBootableImage(
|
recovery_image = common.GetBootableImage(
|
||||||
"recovery.img", "recovery.img", OPTIONS.input_tmp, "RECOVERY")
|
"recovery.img", "recovery.img", OPTIONS.input_tmp, "RECOVERY")
|
||||||
if recovery_image:
|
if recovery_image:
|
||||||
|
@@ -1612,6 +1612,10 @@ def main(argv):
|
|||||||
if OPTIONS.device_specific is not None:
|
if OPTIONS.device_specific is not None:
|
||||||
OPTIONS.device_specific = os.path.abspath(OPTIONS.device_specific)
|
OPTIONS.device_specific = os.path.abspath(OPTIONS.device_specific)
|
||||||
|
|
||||||
|
if OPTIONS.info_dict.get("no_recovery") == "true":
|
||||||
|
raise common.ExternalError(
|
||||||
|
"--- target build has specified no recovery ---")
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
|
|
||||||
if OPTIONS.no_signing:
|
if OPTIONS.no_signing:
|
||||||
|
Reference in New Issue
Block a user