From b32d56ea8c12515ca6e21845fe1416716bd91a3e Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Wed, 9 Sep 2015 11:55:01 -0700 Subject: [PATCH] releasetools: Fix the expected total blocks. With the change in [1], it zeroes out extra blocks that might be read by dm-verity. We should update the expected number of blocks that get touched. [1] commit e9b619108dbe0c358ba6c14e27c92a623a7c1059. Bug: 23786644 Change-Id: I7a7c3531e5af6bf381d3a14832e77abfa9a8efce --- tools/releasetools/blockimgdiff.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/releasetools/blockimgdiff.py b/tools/releasetools/blockimgdiff.py index bec577323..42007eb0d 100644 --- a/tools/releasetools/blockimgdiff.py +++ b/tools/releasetools/blockimgdiff.py @@ -511,6 +511,7 @@ class BlockImageDiff(object): # Zero out extended blocks as a workaround for bug 20881595. if self.tgt.extended: out.append("zero %s\n" % (self.tgt.extended.to_string_raw(),)) + total += self.tgt.extended.size() # We erase all the blocks on the partition that a) don't contain useful # data in the new image and b) will not be touched by dm-verity. @@ -521,7 +522,7 @@ class BlockImageDiff(object): out.append("erase %s\n" % (new_dontcare.to_string_raw(),)) out.insert(0, "%d\n" % (self.version,)) # format version number - out.insert(1, str(total) + "\n") + out.insert(1, "%d\n" % (total,)) 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)