summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Zongker <dougz@android.com>2010-09-15 13:12:11 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-09-15 13:12:11 -0700
commit10063a369194845bdf930f027f26ee79f72a76ee (patch)
treec304c8d0c648ae16a501604ae8149f8aeecd57f7
parentcea4855f2f26bfe785099248557499c94f499adc (diff)
parent45bc6a8e501da82e49ab91ef62e8e6693c8f5141 (diff)
downloaddevice_samsung_crespo-10063a369194845bdf930f027f26ee79f72a76ee.zip
device_samsung_crespo-10063a369194845bdf930f027f26ee79f72a76ee.tar.gz
device_samsung_crespo-10063a369194845bdf930f027f26ee79f72a76ee.tar.bz2
Merge "fix two crespo OTA package bugs" into gingerbread
-rw-r--r--releasetools.py33
1 files changed, 18 insertions, 15 deletions
diff --git a/releasetools.py b/releasetools.py
index aa3786a..39352ef 100644
--- a/releasetools.py
+++ b/releasetools.py
@@ -56,7 +56,7 @@ def IncrementalOTA_InstallEnd(info):
if source_bootloader_img == target_bootloader_img:
print "bootloader unchanged; skipping"
else:
- common.ZipWriteStr(info.output_zip, "bootloader.img", bootloader_img)
+ common.ZipWriteStr(info.output_zip, "bootloader.img", target_bootloader_img)
info.script.Print("Writing bootloader...")
info.script.WriteRawImage("bootloader", "bootloader.img")
@@ -69,21 +69,24 @@ def IncrementalOTA_InstallEnd(info):
try:
sf = common.File("radio.img", info.source_zip.read("RADIO/radio.img"))
- diff = common.Difference(tf, sf)
- common.ComputeDifferences([diff])
- _, _, d = diff.GetPatch()
- if d is None or len(d) > tf.size * common.OPTIONS.patch_threshold:
- # computing difference failed, or difference is nearly as
- # big as the target: simply send the target.
- tf.AddToZip(info.output_zip)
- info.script.Print("Writing radio...")
- info.script.WriteRawImage("radio", tf.name)
+ if tf.sha1 == sf.sha1:
+ print "radio image unchanged; skipping"
else:
- common.ZipWriteStr(info.output_zip, "radio.img.p", d)
- info.script.Print("Patching radio...")
- info.script.ApplyPatch(
- "MTD:radio:%d:%s:%d:%s" % (sf.size, sf.sha1, tf.size, tf.sha1),
- "-", tf.size, tf.sha1, sf.sha1, "radio.img.p")
+ diff = common.Difference(tf, sf)
+ common.ComputeDifferences([diff])
+ _, _, d = diff.GetPatch()
+ if d is None or len(d) > tf.size * common.OPTIONS.patch_threshold:
+ # computing difference failed, or difference is nearly as
+ # big as the target: simply send the target.
+ tf.AddToZip(info.output_zip)
+ info.script.Print("Writing radio...")
+ info.script.WriteRawImage("radio", tf.name)
+ else:
+ common.ZipWriteStr(info.output_zip, "radio.img.p", d)
+ info.script.Print("Patching radio...")
+ info.script.ApplyPatch(
+ "MTD:radio:%d:%s:%d:%s" % (sf.size, sf.sha1, tf.size, tf.sha1),
+ "-", tf.size, tf.sha1, sf.sha1, "radio.img.p")
except KeyError:
# failed to read SOURCE radio image: include the whole target