OSDN Git Service

releasetools: Fix the computation in ReviseStashSize().
authorTao Bao <tbao@google.com>
Fri, 16 Dec 2016 19:13:55 +0000 (11:13 -0800)
committerTao Bao <tbao@google.com>
Fri, 16 Dec 2016 19:26:05 +0000 (11:26 -0800)
commite27acfdc412047c55a25c0929a2dde3d545bd61e
treee2234022d8cbfe404cacb23639d1f3d1c210d027
parenta282ceeb73ac58779451957a9df9581043a24f02
releasetools: Fix the computation in ReviseStashSize().

We compute the max stashed_blocks in ReviseStashSize(), prior to calling
WriteTransfers(), to avoid running out of space due to stashing.

There is a bug when computing the to-be-freed stashed blocks, where we
wrongly free the space _before_ executing the transfer command. This leads
to a script failure where the max stash size violates the max allowed
size in WriteTransfers().

Note that this bug doesn't affect already generated packages. It's only
an underestimate in ReviseStashSize(). The check in WriteTransfers() has
been correct to ensure the max stash size.

Bug: 33687949
Test: Successfully generated incremental OTA which failed previously.
Change-Id: I4f4f043c6f521fce81ca5286e6156f22d99bf7f7
tools/releasetools/blockimgdiff.py