author | Xindong Xu <xindong.xu@amlogic.com> | 2018-10-26 13:13:23 (GMT) |
---|---|---|
committer | lu.wang <lu.wang@amlogic.com> | 2018-10-27 03:25:05 (GMT) |
commit | 6506fa849a4e6c65275b66e102c538953cbc4247 (patch) | |
tree | f866e6aa0ba16d60d9f24797ffee50e35a8bd1ec | |
parent | ef7e4a7da7050061fd3e714e6cfa14ea0500129b (diff) | |
download | common-6506fa849a4e6c65275b66e102c538953cbc4247.zip common-6506fa849a4e6c65275b66e102c538953cbc4247.tar.gz common-6506fa849a4e6c65275b66e102c538953cbc4247.tar.bz2 |
ota: ota: update bootloader first when partition tab change [3/4]
bug: 118460700
Problem:
when partiton tab changed, avb check error when reboot to recovery again
Solution:
update bootloader first when partition tab change
Verify:
atom
Change-Id: I142ceea297b0c2722a8229d4c2153560d60ca974
-rwxr-xr-x | releasetools.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/releasetools.py b/releasetools.py index 3e52136..17582fe 100755 --- a/releasetools.py +++ b/releasetools.py @@ -177,6 +177,14 @@ def BuildCustomerIncrementalImage(info, *par, **dictarg): def FullOTA_Assertions(info): print "amlogic extensions:FullOTA_Assertions" + try: + bootloader_img = info.input_zip.read("RADIO/bootloader.img") + except KeyError: + OPTIONS.ota_partition_change = False + print "no bootloader.img in target_files; skipping install" + else: + OPTIONS.ota_partition_change = True + common.ZipWriteStr(info.output_zip, "bootloader.img", bootloader_img) if OPTIONS.ota_zip_check: info.script.AppendExtra('if ota_zip_check() == "1" then') info.script.AppendExtra('set_bootloader_env("upgrade_step", "3");') @@ -184,6 +192,9 @@ def FullOTA_Assertions(info): info.script.AppendExtra('write_dtb_image(package_extract_file("dt.img"));') info.script.AppendExtra('backup_data_cache(recovery, /cache/recovery/);') info.script.WriteRawImage("/recovery", "recovery.img") + if OPTIONS.ota_partition_change: + info.script.AppendExtra('ui_print("update bootloader.img...");') + info.script.AppendExtra('write_bootloader_image(package_extract_file("bootloader.img"));') info.script.AppendExtra('reboot_recovery();') info.script.AppendExtra('else') @@ -231,12 +242,7 @@ package_extract_file("recovery.img", "/dev/block/recovery"); ui_print("update vbmeta.img..."); package_extract_file("vbmeta.img", "/dev/block/vbmeta");""") - try: - bootloader_img = info.input_zip.read("RADIO/bootloader.img") - except KeyError: - print "no bootloader.img in target_files; skipping install" - else: - common.ZipWriteStr(info.output_zip, "bootloader.img", bootloader_img) + if OPTIONS.ota_partition_change: info.script.AppendExtra('ui_print("update bootloader.img...");') info.script.AppendExtra('write_bootloader_image(package_extract_file("bootloader.img"));') |