diff options
author | Louis Popi <theh2o64@gmail.com> | 2016-07-16 16:19:13 +0200 |
---|---|---|
committer | Steve Kondik <shade@chemlab.org> | 2016-07-20 11:27:59 -0700 |
commit | 8485af000a94e46a759560b795fdb834d9c2d46e (patch) | |
tree | aca6d682287ac0b2ed5db6d00174347bed0b1995 | |
parent | 5113c19a0a502db098780101dd10d811c56a885e (diff) |
releasetool: Add support for partition specific *.img
Change-Id: Icaabb51d3d72ede9a77f96bbc0fe493aa979e483
-rwxr-xr-x | releasetools.py | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/releasetools.py b/releasetools.py index f50b751..4dc95d8 100755 --- a/releasetools.py +++ b/releasetools.py @@ -23,7 +23,7 @@ import re bootImages = {} binImages = {} fwImages = {} - +imgImages = {} # Parse filesmap file containing firmware residing places def LoadFilesMap(zip, name="RADIO/filesmap"): @@ -84,6 +84,7 @@ def SplitFwTypes(files): boot = {} bin = {} fw = {} + img = {} for f in files: extIdx = -1 @@ -97,9 +98,11 @@ def SplitFwTypes(files): boot[f] = files[f] elif dotSeparated[extIdx] == 'bin': bin[f] = files[f] + elif dotSeparated[extIdx] == 'img': + img[f] = files[f] else: fw[f] = files[f] - return boot, bin, fw + return boot, bin, fw, img # Prepare radio-update files and verify them @@ -164,7 +167,8 @@ def OTA_VerifyEnd(info, api_version, target_zip, source_zip=None): global bootImages global binImages global fwImages - bootImages, binImages, fwImages = SplitFwTypes(update_list) + global imgImages + bootImages, binImages, fwImages, imgImages = SplitFwTypes(update_list) # If there are incremental patches verify them if largest_source_size != 0: @@ -188,7 +192,6 @@ def OTA_VerifyEnd(info, api_version, target_zip, source_zip=None): continue info.script.PatchCheck("EMMC:%s:%d:%s:%d:%s" % (dest, sf.size, sf.sha1, tf.size, tf.sha1)) - last_mounted = "" for f in fwImages: dest, destBak, tf, sf = fwImages[f] @@ -210,6 +213,14 @@ def OTA_VerifyEnd(info, api_version, target_zip, source_zip=None): else: dest = dest + "/" + f info.script.PatchCheck(dest, tf.sha1, sf.sha1) + for f in imgImages: + dest, tf, sf = imgImages[f] + # Not incremental + if sf is None: + continue + info.script.PatchCheck("EMMC:%s:%d:%s:%d:%s" % + (dest, sf.size, sf.sha1, tf.size, tf.sha1)) + last_mounted = "" info.script.CacheFreeSpaceCheck(largest_source_size) return True @@ -318,6 +329,13 @@ def InstallFwImages(script, files): script.AppendExtra('unmount("/firmware");') return +# This function handles *.img images +def InstallImgImages(script, files): + for f in files: + dest, _, tf, sf = files[f] + InstallRawImage(script, f, dest, tf, sf) + return + def OTA_InstallEnd(info): print "Applying radio-update script modifications..." @@ -330,6 +348,8 @@ def OTA_InstallEnd(info): InstallBinImages(info.script, binImages) if fwImages != {}: InstallFwImages(info.script, fwImages) + if imgImages != {}: + InstallImgImages(info.script, imgImages) return |