summaryrefslogtreecommitdiff
path: root/dynamic_partition_test_utils.h
diff options
context:
space:
mode:
authorYifan Hong <elsk@google.com>2020-03-26 12:47:05 -0700
committerYifan Hong <elsk@google.com>2020-04-03 16:14:49 -0700
commit2969290920696611a67aed184baf71cac062b416 (patch)
treea0086c60ebe08355f9018f362a22aebbf34fec9e /dynamic_partition_test_utils.h
parent7b3910a58bd0b8d9f0bd316fad5776ef0a8494ba (diff)
Add DynamicPartitionControl::EraseSystemOtherAvbFooter
Erase AVB footer of system other partition prior to any updates so that if an update overwrites it partially, and the device rolled back (or even before we finish writing the partition), and the device factory resets, mapping system_other as /postinstall won't trigger verity errors and reboots the device. Bug: 152444348 Test: apply update, rollback, then FDR Test: apply update, then set sys.cppreopt=requested; observe that /postinstall cannot be mounted. Change-Id: I62e5bb8f4c31d9a1beff485c47fc4b07a3a5686b
Diffstat (limited to 'dynamic_partition_test_utils.h')
-rw-r--r--dynamic_partition_test_utils.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/dynamic_partition_test_utils.h b/dynamic_partition_test_utils.h
index 346998fc..70a176b5 100644
--- a/dynamic_partition_test_utils.h
+++ b/dynamic_partition_test_utils.h
@@ -175,7 +175,7 @@ inline DeltaArchiveManifest PartitionSizesToManifest(
}
inline std::unique_ptr<MetadataBuilder> NewFakeMetadata(
- const DeltaArchiveManifest& manifest) {
+ const DeltaArchiveManifest& manifest, uint32_t partition_attr = 0) {
auto builder =
MetadataBuilder::New(kDefaultSuperSize, kFakeMetadataSize, kMaxNumSlots);
for (const auto& group : manifest.dynamic_partition_metadata().groups()) {
@@ -183,7 +183,7 @@ inline std::unique_ptr<MetadataBuilder> NewFakeMetadata(
for (const auto& partition_name : group.partition_names()) {
EXPECT_NE(
nullptr,
- builder->AddPartition(partition_name, group.name(), 0 /* attr */));
+ builder->AddPartition(partition_name, group.name(), partition_attr));
}
}
for (const auto& partition : manifest.partitions()) {