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: I9caf03a40efbdba79f3428f73e50d4319d9ba371
This commit is contained in:
@@ -247,7 +247,6 @@ class BlockImageDiff(object):
|
|||||||
def WriteTransfers(self, prefix):
|
def WriteTransfers(self, prefix):
|
||||||
out = []
|
out = []
|
||||||
|
|
||||||
out.append("%d\n" % (self.version,)) # format version number
|
|
||||||
total = 0
|
total = 0
|
||||||
performs_read = False
|
performs_read = False
|
||||||
|
|
||||||
@@ -372,12 +371,6 @@ class BlockImageDiff(object):
|
|||||||
else:
|
else:
|
||||||
raise ValueError, "unknown transfer style '%s'\n" % (xf.style,)
|
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
|
# sanity check: abort if we're going to need more than 512 MB if
|
||||||
# stash space
|
# stash space
|
||||||
@@ -394,7 +387,15 @@ class BlockImageDiff(object):
|
|||||||
else:
|
else:
|
||||||
# if nothing is read (ie, this is a full OTA), then we can start
|
# if nothing is read (ie, this is a full OTA), then we can start
|
||||||
# by erasing the entire partition.
|
# 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:
|
with open(prefix + ".transfer.list", "wb") as f:
|
||||||
for i in out:
|
for i in out:
|
||||||
|
Reference in New Issue
Block a user