summaryrefslogtreecommitdiff
path: root/dynamic_partition_control_android.h
diff options
context:
space:
mode:
authorTianjie <xunchang@google.com>2020-06-30 12:26:25 -0700
committerTianjie Xu <xunchang@google.com>2020-07-09 20:15:08 +0000
commit24f960986b1337f14eb8e86382cb62aed5d1153c (patch)
treeea47bdb983a0b692fc02fe2b5e84029d7d6002f7 /dynamic_partition_control_android.h
parentd2da7b1990e0fee1c99bf64aa562cef572aaa061 (diff)
Verify the extents for untouched dynamic partitions during partial update
For partial updates, the metadata for untouched dynamic partitions are just copied over to the target slot. So, verifying the extents of these partitions in the target metadata should be sufficient for correctness. This saves the work to read & hash the bytes on these partitions for each resumed update. Bug: 151088567 Test: unit tests pass, apply a partial update Change-Id: I9d40ed2643e145a1546ea17b146fcdcfb91f213f
Diffstat (limited to 'dynamic_partition_control_android.h')
-rw-r--r--dynamic_partition_control_android.h27
1 files changed, 13 insertions, 14 deletions
diff --git a/dynamic_partition_control_android.h b/dynamic_partition_control_android.h
index 69026a40..08656fdc 100644
--- a/dynamic_partition_control_android.h
+++ b/dynamic_partition_control_android.h
@@ -57,6 +57,11 @@ class DynamicPartitionControlAndroid : public DynamicPartitionControlInterface {
bool ListDynamicPartitionsForSlot(
uint32_t current_slot, std::vector<std::string>* partitions) override;
+ bool VerifyExtentsForUntouchedPartitions(
+ uint32_t source_slot,
+ uint32_t target_slot,
+ const std::vector<std::string>& partitions) override;
+
bool GetDeviceDir(std::string* path) override;
// Return the device for partition |partition_name| at slot |slot|.
@@ -85,16 +90,14 @@ class DynamicPartitionControlAndroid : public DynamicPartitionControlInterface {
virtual bool UnmapPartitionOnDeviceMapper(
const std::string& target_partition_name);
- // Retrieve metadata from |super_device| at slot |source_slot|.
- //
- // If |target_slot| != kInvalidSlot, before returning the metadata, this
- // function modifies the metadata so that during updates, the metadata can be
- // written to |target_slot|. In particular, on retrofit devices, the returned
- // metadata automatically includes block devices at |target_slot|.
- //
- // If |target_slot| == kInvalidSlot, this function returns metadata at
- // |source_slot| without modifying it. This is the same as
- // LoadMetadataBuilder(const std::string&, uint32_t).
+ // Retrieves metadata from |super_device| at slot |slot|.
+ virtual std::unique_ptr<android::fs_mgr::MetadataBuilder> LoadMetadataBuilder(
+ const std::string& super_device, uint32_t slot);
+
+ // Retrieves metadata from |super_device| at slot |source_slot|. And modifies
+ // the metadata so that during updates, the metadata can be written to
+ // |target_slot|. In particular, on retrofit devices, the returned metadata
+ // automatically includes block devices at |target_slot|.
virtual std::unique_ptr<android::fs_mgr::MetadataBuilder> LoadMetadataBuilder(
const std::string& super_device,
uint32_t source_slot,
@@ -133,10 +136,6 @@ class DynamicPartitionControlAndroid : public DynamicPartitionControlInterface {
virtual bool GetDmDevicePathByName(const std::string& name,
std::string* path);
- // Retrieve metadata from |super_device| at slot |source_slot|.
- virtual std::unique_ptr<android::fs_mgr::MetadataBuilder> LoadMetadataBuilder(
- const std::string& super_device, uint32_t source_slot);
-
// Return the name of the super partition (which stores super partition
// metadata) for a given slot.
virtual std::string GetSuperPartitionName(uint32_t slot);