diff options
author | David Anderson <dvander@google.com> | 2019-04-02 20:16:36 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2019-04-02 20:16:36 +0000 |
commit | bc2eab43150c72d15f18f50fa68c4a42d588a0e2 (patch) | |
tree | 430ebd1aae467de7e5eee4263e30c400ced548e6 | |
parent | bb8f0fff17488fb3935646d53860a0bf24749960 (diff) | |
parent | c52663c4ea118386b54fcaa5ef148e8a0c7d5b30 (diff) | |
download | recovery-bc2eab43150c72d15f18f50fa68c4a42d588a0e2.tar.gz |
Merge "Append -verity when looking for verity device-mapper names."
-rw-r--r-- | update_verifier/update_verifier.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/update_verifier/update_verifier.cpp b/update_verifier/update_verifier.cpp index 0cf536ce..d04c455d 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)); |