move recovery image to the top of the OTA package
Make the recovery image be the first thing installed in system/ in the OTA package, so it will get installed even if the system partition fills during OTA installation.
This commit is contained in:
@@ -303,7 +303,7 @@ def MakeRecoveryPatch(output_zip, recovery_img, boot_img):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
patch = Difference(recovery_img, boot_img, "imgdiff")
|
patch = Difference(recovery_img, boot_img, "imgdiff")
|
||||||
common.ZipWriteStr(output_zip, "system/recovery-from-boot.p", patch)
|
common.ZipWriteStr(output_zip, "recovery/recovery-from-boot.p", patch)
|
||||||
Item.Get("system/recovery-from-boot.p", dir=False)
|
Item.Get("system/recovery-from-boot.p", dir=False)
|
||||||
|
|
||||||
# Images with different content will have a different first page, so
|
# Images with different content will have a different first page, so
|
||||||
@@ -324,7 +324,7 @@ fi
|
|||||||
'header_sha1': header_sha1,
|
'header_sha1': header_sha1,
|
||||||
'recovery_size': recovery_img.size,
|
'recovery_size': recovery_img.size,
|
||||||
'recovery_sha1': recovery_img.sha1 }
|
'recovery_sha1': recovery_img.sha1 }
|
||||||
common.ZipWriteStr(output_zip, "system/etc/install-recovery.sh", sh)
|
common.ZipWriteStr(output_zip, "recovery/etc/install-recovery.sh", sh)
|
||||||
return Item.Get("system/etc/install-recovery.sh", dir=False)
|
return Item.Get("system/etc/install-recovery.sh", dir=False)
|
||||||
|
|
||||||
|
|
||||||
@@ -360,6 +360,7 @@ def WriteFullOTAPackage(input_zip, output_zip):
|
|||||||
|
|
||||||
script.FormatPartition("system")
|
script.FormatPartition("system")
|
||||||
script.Mount("MTD", "system", "/system")
|
script.Mount("MTD", "system", "/system")
|
||||||
|
script.UnpackPackageDir("recovery", "/system")
|
||||||
script.UnpackPackageDir("system", "/system")
|
script.UnpackPackageDir("system", "/system")
|
||||||
|
|
||||||
symlinks = CopySystemFiles(input_zip, output_zip)
|
symlinks = CopySystemFiles(input_zip, output_zip)
|
||||||
@@ -650,6 +651,7 @@ def WriteIncrementalOTAPackage(target_zip, source_zip, output_zip):
|
|||||||
# as fodder for constructing the recovery image.
|
# as fodder for constructing the recovery image.
|
||||||
recovery_sh_item = MakeRecoveryPatch(output_zip,
|
recovery_sh_item = MakeRecoveryPatch(output_zip,
|
||||||
target_recovery, target_boot)
|
target_recovery, target_boot)
|
||||||
|
script.UnpackPackageDir("recovery", "/system")
|
||||||
print "recovery image changed; including as patch from boot."
|
print "recovery image changed; including as patch from boot."
|
||||||
else:
|
else:
|
||||||
print "recovery image unchanged; skipping."
|
print "recovery image unchanged; skipping."
|
||||||
|
Reference in New Issue
Block a user