Support systems that use a full copy of recovery image.

If BOARD_USES_FULL_RECOVERY_IMAGE == true, a full copy of recovery
image will be carried as /system/etc/recovery.img instead of a patch
at /system/recovery_from_boot.p.

Bug: 22641135
Change-Id: Ie271d3e2d55d7b003f667ac5b44203d69b23c63b
(cherry picked from commit 8beab69bd5)
This commit is contained in:
Tao Bao
2015-07-22 12:33:18 -07:00
parent 7ecb919dba
commit f2cffbddb9
4 changed files with 57 additions and 19 deletions

View File

@@ -218,7 +218,8 @@ class ItemSet(object):
if i.is_dir:
i.children.sort(key=lambda i: i.name)
# set metadata for the files generated by this script.
# Set metadata for the files generated by this script. For full recovery
# image at system/etc/recovery.img, it will be taken care by fs_config.
i = self.ITEMS.get("system/recovery-from-boot.p", None)
if i:
i.uid, i.gid, i.mode, i.selabel, i.capabilities = 0, 0, 0o644, None, None
@@ -422,11 +423,9 @@ def AppendAssertions(script, info_dict, oem_dict=None):
def HasRecoveryPatch(target_files_zip):
try:
target_files_zip.getinfo("SYSTEM/recovery-from-boot.p")
return True
except KeyError:
return False
namelist = [name for name in target_files_zip.namelist()]
return ("SYSTEM/recovery-from-boot.p" in namelist or
"SYSTEM/etc/recovery.img" in namelist)
def HasVendorPartition(target_files_zip):
try:
@@ -1360,6 +1359,7 @@ else
common.MakeRecoveryPatch(OPTIONS.target_tmp, output_sink,
target_recovery, target_boot)
script.DeleteFiles(["/system/recovery-from-boot.p",
"/system/etc/recovery.img",
"/system/etc/install-recovery.sh"])
print "recovery image changed; including as patch from boot."
else: