diff options
author | Doug Zongker <dougz@google.com> | 2014-09-09 12:38:47 -0700 |
---|---|---|
committer | Doug Zongker <dougz@google.com> | 2014-09-09 12:40:21 -0700 |
commit | 7b0ddf529eb993481e70db1fb5298ba5205d7801 (patch) | |
tree | 6195d111d07ae84d1feb57540fdc0e9b441cd488 /tools/releasetools/blockimgdiff.py | |
parent | 9a751322e1fad2625a59a8304e83b99b6d012cbb (diff) | |
download | build-7b0ddf529eb993481e70db1fb5298ba5205d7801.zip build-7b0ddf529eb993481e70db1fb5298ba5205d7801.tar.gz build-7b0ddf529eb993481e70db1fb5298ba5205d7801.tar.bz2 |
fix transfer list for full OTAs
The erase command we insert at the top for full OTAs was getting
inserted in the wrong place for version 2.
Change-Id: I816e1023c3c6d581e14af374c330b8b55337f38f
Diffstat (limited to 'tools/releasetools/blockimgdiff.py')
-rw-r--r-- | tools/releasetools/blockimgdiff.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/tools/releasetools/blockimgdiff.py b/tools/releasetools/blockimgdiff.py index cf7d7d9..8b179d5 100644 --- a/tools/releasetools/blockimgdiff.py +++ b/tools/releasetools/blockimgdiff.py @@ -247,7 +247,6 @@ class BlockImageDiff(object): def WriteTransfers(self, prefix): out = [] - out.append("%d\n" % (self.version,)) # format version number total = 0 performs_read = False @@ -372,12 +371,6 @@ class BlockImageDiff(object): else: raise ValueError, "unknown transfer style '%s'\n" % (xf.style,) - out.insert(1, str(total) + "\n") - if self.version >= 2: - # version 2 only: after the total block count, we give the number - # of stash slots needed, and the maximum size needed (in blocks) - out.insert(2, str(next_stash_id) + "\n") - out.insert(3, str(max_stashed_blocks) + "\n") # sanity check: abort if we're going to need more than 512 MB if # stash space @@ -394,7 +387,15 @@ class BlockImageDiff(object): else: # if nothing is read (ie, this is a full OTA), then we can start # by erasing the entire partition. - out.insert(2, "erase %s\n" % (all_tgt.to_string_raw(),)) + out.insert(0, "erase %s\n" % (all_tgt.to_string_raw(),)) + + out.insert(0, "%d\n" % (self.version,)) # format version number + out.insert(1, str(total) + "\n") + if self.version >= 2: + # version 2 only: after the total block count, we give the number + # of stash slots needed, and the maximum size needed (in blocks) + out.insert(2, str(next_stash_id) + "\n") + out.insert(3, str(max_stashed_blocks) + "\n") with open(prefix + ".transfer.list", "wb") as f: for i in out: |