diff options
author | Doug Zongker <dougz@android.com> | 2011-12-02 10:46:59 -0800 |
---|---|---|
committer | Doug Zongker <dougz@android.com> | 2011-12-02 13:55:57 -0800 |
commit | bd2dadc21a5db967972a7b8f81aad716609edacb (patch) | |
tree | 6eff22fe06153e56b74070e0d245707c3ca9be65 /tools/releasetools | |
parent | b83d8f15ccc276b190a6c02002f6af94aa2e9cb4 (diff) | |
download | build-bd2dadc21a5db967972a7b8f81aad716609edacb.zip build-bd2dadc21a5db967972a7b8f81aad716609edacb.tar.gz build-bd2dadc21a5db967972a7b8f81aad716609edacb.tar.bz2 |
check entire recovery partition on startup
Checksum the entire recovery partition at boot time to see if we need
to rewrite it, rather than just the first 2kb.
Bug: 5668350
Change-Id: I777754f92e8da630ae3c09bb0d4c41884ff62f39
Diffstat (limited to 'tools/releasetools')
-rwxr-xr-x | tools/releasetools/ota_from_target_files | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/tools/releasetools/ota_from_target_files b/tools/releasetools/ota_from_target_files index 0a27a19..1514ea7 100755 --- a/tools/releasetools/ota_from_target_files +++ b/tools/releasetools/ota_from_target_files @@ -336,13 +336,8 @@ def MakeRecoveryPatch(output_zip, recovery_img, boot_img): boot_type, boot_device = common.GetTypeAndDevice("/boot", OPTIONS.info_dict) recovery_type, recovery_device = common.GetTypeAndDevice("/recovery", OPTIONS.info_dict) - # Images with different content will have a different first page, so - # we check to see if this recovery has already been installed by - # testing just the first 2k. - HEADER_SIZE = 2048 - header_sha1 = common.sha1(recovery_img.data[:HEADER_SIZE]).hexdigest() sh = """#!/system/bin/sh -if ! applypatch -c %(recovery_type)s:%(recovery_device)s:%(header_size)d:%(header_sha1)s; then +if ! applypatch -c %(recovery_type)s:%(recovery_device)s:%(recovery_size)d:%(recovery_sha1)s; then log -t recovery "Installing new recovery image" applypatch %(boot_type)s:%(boot_device)s:%(boot_size)d:%(boot_sha1)s %(recovery_type)s:%(recovery_device)s %(recovery_sha1)s %(recovery_size)d %(boot_sha1)s:/system/recovery-from-boot.p else @@ -350,8 +345,6 @@ else fi """ % { 'boot_size': boot_img.size, 'boot_sha1': boot_img.sha1, - 'header_size': HEADER_SIZE, - 'header_sha1': header_sha1, 'recovery_size': recovery_img.size, 'recovery_sha1': recovery_img.sha1, 'boot_type': boot_type, |