Permalink
Browse files

modify script of patching boot.img

Change-Id: I92ea8128cbfc53a7cb1bdcb9876376565017b82a
  • Loading branch information...
1 parent 79857fa commit 380cee16499ba3bffb051f0af1baafd25303de0f @yu88my yu88my committed Jun 14, 2012
Showing with 21 additions and 0 deletions.
  1. +21 −0 releasetools.py
View
21 releasetools.py
@@ -17,8 +17,29 @@ def AddAssertions(info):
edify.script[i] = edify.script[i].replace(");", ' || getprop("ro.product.device") == "u8860" || getprop("ro.build.product") == "u8860");')
return
+def PatchBootImage(info):
+ print "Patch bootimg"
+ edify = info.script
+ for i in xrange(len(edify.script)):
+ if 'assert(apply_patch_check("EMMC:/dev/block/mmcblk0p1' in edify.script[i]:
+ #print "edify.scrip[", i, "]=", edify.script[i]
+ s = edify.script[i].split(':')
+ e2 = s[3]
+ e1 = s[5].split('"')[0]
+ edify.script[i] = 'mount("vfat", "EMMC", "/dev/block/mmcblk0p1", "/cust");\n' + 'assert(apply_patch_check("/cust/image/boot.img", "' + e1 +'", "' + e2 + '"));'
+ info.script.Unmount("/cust")
+ elif 'apply_patch("EMMC:/dev/block/mmcblk0p1' in edify.script[i]:
+ #print "edify.scrip[", i, "]=", edify.script[i]
+ s = edify.script[i].split(',')
+ s[0] = 'apply_patch("/cust/image/boot.img"'
+ edify.script[i] = '';
+ for j in xrange(len(s) - 1):
+ edify.script[i] = edify.script[i] + s[j] + ','
+ edify.script[i] = edify.script[i] + s[len(s)-1]
+
def FullOTA_InstallEnd(info):
AddAssertions(info)
def IncrementalOTA_InstallEnd(info):
AddAssertions(info)
+ PatchBootImage(info)

0 comments on commit 380cee1

Please sign in to comment.