Add proto field to store xor operation in update manifest
When generating OTA, we pre-compute which blocks inside a BSDIFF
can be represented by XOR operation, and store these blocks in
the merge sequence. When installing OTA, delta_performer
looks at the merge sequence, and convert blocks to specified
COW op type. If a block does not show up in the merge sequence,
it is assumed to be COW_REPLACE type.
Test: th
Bug: 177104308
Change-Id: If04ca9cae036f2d3a365dcf92ba2447f7b08005a
diff --git a/update_metadata.proto b/update_metadata.proto
index 93e4e2e..533f6f0 100644
--- a/update_metadata.proto
+++ b/update_metadata.proto
@@ -233,12 +233,22 @@
// read after write, similar to the inplace update schema.
message CowMergeOperation {
enum Type {
- COW_COPY = 0; // identical blocks
+ COW_COPY = 0; // identical blocks
+ COW_XOR = 1; // used when src/dst blocks are highly similar
+ COW_REPLACE = 2; // Raw replace operation
}
optional Type type = 1;
optional Extent src_extent = 2;
optional Extent dst_extent = 3;
+ // For COW_XOR, source location might be unaligned, so this field is in range
+ // [0, block_size), representing how much should the src_extent shift toward
+ // larger block number. If this field is non-zero, then src_extent will
+ // include 1 extra block in the end, as the merge op actually references the
+ // first |src_offset| bytes of that extra block. For example, if |dst_extent|
+ // is [10, 15], |src_offset| is 500, then src_extent might look like [25, 31].
+ // Note that |src_extent| contains 1 extra block than the |dst_extent|.
+ optional uint32 src_offset = 4;
}
// Describes the update to apply to a single partition.