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>
Tue, 9 Sep 2014 14:49:35 +0000 (07:49 -0700)
commitcf4fda7dc067e2563cccd96addc5e8f43cc11f6d
treeebc9036b8a5a69a199663fe369902835f2cf558e
parent82ba98de48da9c4bcd600146482753166468abff
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: I7259c1fcd41a0aa7767dab63f086951afa2aa657
tools/releasetools/blockimgdiff.py
tools/releasetools/common.py
tools/releasetools/rangelib.py