diff options
author | Doug Zongker <dougz@android.com> | 2010-09-26 15:02:32 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-09-26 15:02:32 -0700 |
commit | 022e03f0514468296f81c90b1c3ae3381698157d (patch) | |
tree | 0cd2c678b2c5b1c82d2b8e3bb1ce48c02b047307 | |
parent | 157486f23286542cb0020d8416977800fe736609 (diff) | |
parent | d5005ef8f1bee23d7e069837c384b506000cff6a (diff) | |
download | device_samsung_crespo-022e03f0514468296f81c90b1c3ae3381698157d.zip device_samsung_crespo-022e03f0514468296f81c90b1c3ae3381698157d.tar.gz device_samsung_crespo-022e03f0514468296f81c90b1c3ae3381698157d.tar.bz2 |
Merge "fix OTA of radio and bootloader on crespo" into gingerbread
-rw-r--r-- | recovery.fstab | 1 | ||||
-rw-r--r-- | releasetools.py | 31 |
2 files changed, 20 insertions, 12 deletions
diff --git a/recovery.fstab b/recovery.fstab index 5d8b4bb..9a8b540 100644 --- a/recovery.fstab +++ b/recovery.fstab @@ -7,4 +7,5 @@ /misc mtd misc /boot mtd boot /recovery mtd recovery +/bootloader mtd bootloader /radio mtd radio diff --git a/releasetools.py b/releasetools.py index 39352ef..36a6235 100644 --- a/releasetools.py +++ b/releasetools.py @@ -19,31 +19,36 @@ import common def FullOTA_InstallEnd(info): try: bootloader_img = info.input_zip.read("RADIO/bootloader.img") - common.ZipWriteStr(info.output_zip, "bootloader.img", bootloader_img) - info.script.Print("Writing bootloader...") - info.script.WriteRawImage("bootloader", "bootloader.img") except KeyError: print "no bootloader.img in target_files; skipping install" + else: + common.ZipWriteStr(info.output_zip, "bootloader.img", bootloader_img) + info.script.Print("Writing bootloader...") + info.script.WriteRawImage("/bootloader", "bootloader.img") try: radio_img = info.input_zip.read("RADIO/radio.img") - common.ZipWriteStr(info.output_zip, "radio.img", radio_img) - info.script.Print("Writing radio...") - info.script.WriteRawImage("radio", "radio.img") except KeyError: print "no radio.img in target_files; skipping install" + else: + common.ZipWriteStr(info.output_zip, "radio.img", radio_img) + info.script.Print("Writing radio...") + info.script.WriteRawImage("/radio", "radio.img") def IncrementalOTA_VerifyEnd(info): try: target_radio_img = info.target_zip.read("RADIO/radio.img") source_radio_img = info.source_zip.read("RADIO/radio.img") + except KeyError: + pass + else: if source_radio_img != target_radio_img: info.script.CacheFreeSpaceCheck(len(source_radio_img)) - info.script.PatchCheck("MTD:radio:%d:%s:%d:%s" % ( + radio_type, radio_device = common.GetTypeAndDevice("/radio", info.info_dict) + info.script.PatchCheck("%s:%s:%d:%s:%d:%s" % ( + radio_type, radio_device, len(source_radio_img), sha.sha(source_radio_img).hexdigest(), len(target_radio_img), sha.sha(target_radio_img).hexdigest())) - except KeyError: - pass def IncrementalOTA_InstallEnd(info): try: @@ -58,7 +63,7 @@ def IncrementalOTA_InstallEnd(info): else: common.ZipWriteStr(info.output_zip, "bootloader.img", target_bootloader_img) info.script.Print("Writing bootloader...") - info.script.WriteRawImage("bootloader", "bootloader.img") + info.script.WriteRawImage("/bootloader", "bootloader.img") except KeyError: print "no bootloader.img in target target_files; skipping install" @@ -84,8 +89,10 @@ def IncrementalOTA_InstallEnd(info): else: common.ZipWriteStr(info.output_zip, "radio.img.p", d) info.script.Print("Patching radio...") + radio_type, radio_device = common.GetTypeAndDevice("/radio", info.info_dict) info.script.ApplyPatch( - "MTD:radio:%d:%s:%d:%s" % (sf.size, sf.sha1, tf.size, tf.sha1), + "%s:%s:%d:%s:%d:%s" % (radio_type, radio_device, + sf.size, sf.sha1, tf.size, tf.sha1), "-", tf.size, tf.sha1, sf.sha1, "radio.img.p") except KeyError: @@ -93,7 +100,7 @@ def IncrementalOTA_InstallEnd(info): # radio image. tf.AddToZip(info.output_zip) info.script.Print("Writing radio...") - info.script.WriteRawImage("radio", tf.name) + info.script.WriteRawImage("/radio", tf.name) except KeyError: # failed to read TARGET radio image: don't include any radio in update. |