From b016896c98f680237314838b1165fc51d752ecf2 Mon Sep 17 00:00:00 2001 From: Bowgo Tsai Date: Mon, 27 Mar 2017 21:29:10 +0800 Subject: [PATCH] fs_mgr_avb: allow top-level vbmeta struct to be in 'boot' partition avb_ops->read_from_partition() should return AVB_IO_RESULT_ERROR_NO_SUCH_PARTITION if the requested partition does not exist. Then libavb will try to load top-level vbmeta from /boot partition. Two related changes in external/avb: https://android-review.googlesource.com/#/c/344907/ https://android-review.googlesource.com/#/c/348731/ Bug: 35880930 Test: test AVB on bullhead with top-level vbmeta being at /boot Change-Id: I80355ba5ae4d29a6f102714cd2f7c2550b238f27 --- fs_mgr/fs_mgr_avb_ops.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs_mgr/fs_mgr_avb_ops.cpp b/fs_mgr/fs_mgr_avb_ops.cpp index dd8c7e775..2c14c9bdf 100644 --- a/fs_mgr/fs_mgr_avb_ops.cpp +++ b/fs_mgr/fs_mgr_avb_ops.cpp @@ -78,7 +78,7 @@ static AvbIOResult read_from_partition(AvbOps* ops ATTRIBUTE_UNUSED, const char* // access. fs_mgr_test_access() will test a few iterations if the // path doesn't exist yet. if (fs_mgr_test_access(path.c_str()) < 0) { - return AVB_IO_RESULT_ERROR_IO; + return AVB_IO_RESULT_ERROR_NO_SUCH_PARTITION; } android::base::unique_fd fd(TEMP_FAILURE_RETRY(open(path.c_str(), O_RDONLY | O_CLOEXEC)));