summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2019-04-03 05:10:23 +0200
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-04-03 05:10:23 +0200
commitb230799046d66042658dae37e2e64fbcce86418b (patch)
tree5c7f9c7b9d9bd35c5af0bc01bed516f60023b08b
parentSnap for 5422062 from 1055819fa84aed004406e23417237c33a08c419c to qt-release (diff)
parentMerge "Append -verity when looking for verity device-mapper names." am: bc2eab4315 am: 9a53189ae5 (diff)
downloadandroid_bootable_recovery-b230799046d66042658dae37e2e64fbcce86418b.tar
android_bootable_recovery-b230799046d66042658dae37e2e64fbcce86418b.tar.gz
android_bootable_recovery-b230799046d66042658dae37e2e64fbcce86418b.tar.bz2
android_bootable_recovery-b230799046d66042658dae37e2e64fbcce86418b.tar.lz
android_bootable_recovery-b230799046d66042658dae37e2e64fbcce86418b.tar.xz
android_bootable_recovery-b230799046d66042658dae37e2e64fbcce86418b.tar.zst
android_bootable_recovery-b230799046d66042658dae37e2e64fbcce86418b.zip
-rw-r--r--update_verifier/update_verifier.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/update_verifier/update_verifier.cpp b/update_verifier/update_verifier.cpp
index 0cf536ce6..d04c455d8 100644
--- a/update_verifier/update_verifier.cpp
+++ b/update_verifier/update_verifier.cpp
@@ -115,6 +115,15 @@ std::map<std::string, std::string> UpdateVerifier::FindDmPartitions() {
// AVB is using 'vroot' for the root block device but we're expecting 'system'.
if (dm_block_name == "vroot") {
dm_block_name = "system";
+ } else if (android::base::EndsWith(dm_block_name, "-verity")) {
+ auto npos = dm_block_name.rfind("-verity");
+ dm_block_name = dm_block_name.substr(0, npos);
+ } else if (!android::base::GetProperty("ro.boot.avb_version", "").empty()) {
+ // Verified Boot 1.0 doesn't add a -verity suffix. On AVB 2 devices,
+ // if DAP is enabled, then a -verity suffix must be used to
+ // differentiate between dm-linear and dm-verity devices. If we get
+ // here, we're AVB 2 and looking at a non-verity partition.
+ continue;
}
dm_block_devices.emplace(dm_block_name, DEV_PATH + std::string(namelist[n]->d_name));