OSDN Git Service

generate version 2 blockimgdiff files
authorDoug Zongker <dougz@google.com>
Mon, 8 Sep 2014 15:29:55 +0000 (08:29 -0700)
committerDoug Zongker <dougz@google.com>
Thu, 25 Sep 2014 23:39:14 +0000 (16:39 -0700)
commit623381880a32a2912f95949a6c406038ac4e7064
treee4ab57a8e4eb0cfb9dec5e7bc8adaa1fb025b66c
parentfa63bb72c980a12178bf7e150988a851619a1bd6
generate version 2 blockimgdiff files

Generate version 2 of the block_image_update transfer list format.
This improves patch size by a different strategy for dealing with
out-of-order transfers.  If transfer A must be done before transfer B
due to B overwriting A's source but we want to do B before A, we
resolve the conflict by:

  - before B is executed, we save ("stash") the overlapping region (ie
    the blocks B will overwrite that A wants to read)

  - when A is executed, it will read those parts of source data from
    the stash rather than from the image.

This reverses the ordering constraint; with these additions now B
*must* go before A.  The implementation of the stash is left up to the
code that executes the transfer list to apply the patch; it could hold
stashed data in RAM or on a scratch disk such as /cache, if available.

The code retains the ability to build a version 1 block image patch;
it's needed for processing older target-files.

Change-Id: Ia9aa0bd45d5dc3ef7c5835e483b1b2ead10135fe
tools/releasetools/blockimgdiff.py
tools/releasetools/common.py
tools/releasetools/rangelib.py