Implement PartitionUpdateGenerator for partial updates
Implement the logic in PartitionUpdateGenerator. Here's the summary,
1. finds the a/b partitions (both static & dynamic) on the device
For partitions not included in the payload:
2. calculates the partition hash for filesystem verification
3. generates one SOURCE_COPY operation for each static partition
The order of the partitions are sorted. So the update will resume from
the correct operation in case it's interruptted.
Bug: 157778739
Test: run a partial OTA with boot & system_ext
Change-Id: I5683b85e3c6dab813a33d5144aceb996fd8163d4
diff --git a/Android.bp b/Android.bp
index 59d698d..a5223c7 100644
--- a/Android.bp
+++ b/Android.bp
@@ -123,15 +123,16 @@
"libbz",
"libbspatch",
"libbrotli",
+ "libc++fs",
"libfec_rs",
"libpuffpatch",
"libverity_tree",
],
shared_libs: [
- "libziparchive",
"libbase",
"libcrypto",
"libfec",
+ "libziparchive",
],
}
@@ -731,6 +732,7 @@
"payload_consumer/file_descriptor_utils_unittest.cc",
"payload_consumer/file_writer_unittest.cc",
"payload_consumer/filesystem_verifier_action_unittest.cc",
+ "payload_consumer/partition_update_generator_android_unittest.cc",
"payload_consumer/postinstall_runner_action_unittest.cc",
"payload_consumer/verity_writer_android_unittest.cc",
"payload_consumer/xz_extent_writer_unittest.cc",