change incremental OTA file install order

(Cherry-pick from donut.)

Delete the old recovery-from-boot patch before patching system files,
then install the new one at the end of the process.  Also fix an issue
with applypatch returning the wrong status.

Change-Id: I614fce39f307eded696ba792912b863f9fb0580b
This commit is contained in:
Doug Zongker 2010-02-12 10:21:00 -08:00
parent e3265fb743
commit 42265390d9
2 changed files with 7 additions and 2 deletions

View File

@ -839,7 +839,7 @@ int applypatch(int argc, char** argv) {
if (result != 0) { if (result != 0) {
if (retry == 0) { if (retry == 0) {
printf("applying patch failed\n"); printf("applying patch failed\n");
return result; return result != 0;
} else { } else {
printf("applying patch failed; retrying\n"); printf("applying patch failed; retrying\n");
} }

View File

@ -751,7 +751,8 @@ 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") script.DeleteFiles(["/system/recovery-from-boot.p",
"/system/etc/install-recovery.sh"])
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."
@ -787,6 +788,10 @@ def WriteIncrementalOTAPackage(target_zip, source_zip, output_zip):
script.Print("Unpacking new files...") script.Print("Unpacking new files...")
script.UnpackPackageDir("system", "/system") script.UnpackPackageDir("system", "/system")
if updating_recovery:
script.Print("Unpacking new recovery...")
script.UnpackPackageDir("recovery", "/system")
script.Print("Symlinks and permissions...") script.Print("Symlinks and permissions...")
# Create all the symlinks that don't already exist, or point to # Create all the symlinks that don't already exist, or point to