From 1aa6eaf8218f3e4b61c9f7015287deb127cf8eab Mon Sep 17 00:00:00 2001 From: Bowgo Tsai Date: Thu, 30 Mar 2017 20:33:10 +0800 Subject: [PATCH] fs_mgr_avb: allow top-level vbmeta struct to be in 'boot' partition get_hashtree_descriptor() currently restricts HASHTREE descriptor to be either in /vbmeta or in the same partition for dm-verity setup. Also allows it to be from /boot partition because the top-level vbmeta might be appended at /boot in legacy devices without /vbmeta. Bug: 35880930 Test: test AVB on bullhead with top-level vbmeta being at /boot Change-Id: I1ebd16a3c9f17bced6055146e8843b5918a737eb (cherry picked from commit 37a0b318ef2b4dcd0e7ae5b56dc028faa69859c7) --- fs_mgr/fs_mgr_avb.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs_mgr/fs_mgr_avb.cpp b/fs_mgr/fs_mgr_avb.cpp index a7620386f..7512eb934 100644 --- a/fs_mgr/fs_mgr_avb.cpp +++ b/fs_mgr/fs_mgr_avb.cpp @@ -390,10 +390,12 @@ static bool get_hashtree_descriptor(const std::string& partition_name, continue; } - // Ensures that hashtree descriptor is either in /vbmeta or in + // Ensures that hashtree descriptor is in /vbmeta or /boot or in // the same partition for verity setup. std::string vbmeta_partition_name(verify_data.vbmeta_images[i].partition_name); - if (vbmeta_partition_name != "vbmeta" && vbmeta_partition_name != partition_name) { + if (vbmeta_partition_name != "vbmeta" && + vbmeta_partition_name != "boot" && // for legacy device to append top-level vbmeta + vbmeta_partition_name != partition_name) { LWARNING << "Skip vbmeta image at " << verify_data.vbmeta_images[i].partition_name << " for partition: " << partition_name.c_str(); continue;