diff options
author | Tom Cherry <tomcherry@google.com> | 2018-12-04 18:37:39 +0100 |
---|---|---|
committer | Tom Cherry <tomcherry@google.com> | 2018-12-04 20:11:14 +0100 |
commit | 772c93ca5c98f21b766fcf2fbf25c8ebf742e2fb (patch) | |
tree | f6856d3373d2a46217e191eecae405fd2fd0d188 /bootloader_message | |
parent | Merge "C++17 is the default now." (diff) | |
download | android_bootable_recovery-772c93ca5c98f21b766fcf2fbf25c8ebf742e2fb.tar android_bootable_recovery-772c93ca5c98f21b766fcf2fbf25c8ebf742e2fb.tar.gz android_bootable_recovery-772c93ca5c98f21b766fcf2fbf25c8ebf742e2fb.tar.bz2 android_bootable_recovery-772c93ca5c98f21b766fcf2fbf25c8ebf742e2fb.tar.lz android_bootable_recovery-772c93ca5c98f21b766fcf2fbf25c8ebf742e2fb.tar.xz android_bootable_recovery-772c93ca5c98f21b766fcf2fbf25c8ebf742e2fb.tar.zst android_bootable_recovery-772c93ca5c98f21b766fcf2fbf25c8ebf742e2fb.zip |
Diffstat (limited to 'bootloader_message')
-rw-r--r-- | bootloader_message/bootloader_message.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/bootloader_message/bootloader_message.cpp b/bootloader_message/bootloader_message.cpp index aaeffdc5c..b933cbf8e 100644 --- a/bootloader_message/bootloader_message.cpp +++ b/bootloader_message/bootloader_message.cpp @@ -27,21 +27,22 @@ #include <android-base/properties.h> #include <android-base/stringprintf.h> #include <android-base/unique_fd.h> -#include <fs_mgr.h> +#include <fstab/fstab.h> static std::string get_misc_blk_device(std::string* err) { - std::unique_ptr<fstab, decltype(&fs_mgr_free_fstab)> fstab(fs_mgr_read_fstab_default(), - fs_mgr_free_fstab); - if (!fstab) { + Fstab fstab; + if (!ReadDefaultFstab(&fstab)) { *err = "failed to read default fstab"; return ""; } - fstab_rec* record = fs_mgr_get_entry_for_mount_point(fstab.get(), "/misc"); - if (record == nullptr) { - *err = "failed to find /misc partition"; - return ""; + for (const auto& entry : fstab) { + if (entry.mount_point == "/misc") { + return entry.blk_device; + } } - return record->blk_device; + + *err = "failed to find /misc partition"; + return ""; } // In recovery mode, recovery can get started and try to access the misc |