diff options
author | Tom Cherry <tomcherry@google.com> | 2019-01-31 21:22:29 +0100 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-01-31 21:22:29 +0100 |
commit | 0be4406e3cf4d2eba5bfdcb63d46bfd8847c7ef9 (patch) | |
tree | a9753d53872af3db84cc115a77657511e866af28 | |
parent | Merge "Fix potential size overflow in blockimg.cpp" am: 9a54dd3bf9 am: cc025b2b4a (diff) | |
parent | Merge "Add android::fs_mgr namespace for new Fstab code" am: 990807a95f (diff) | |
download | android_bootable_recovery-0be4406e3cf4d2eba5bfdcb63d46bfd8847c7ef9.tar android_bootable_recovery-0be4406e3cf4d2eba5bfdcb63d46bfd8847c7ef9.tar.gz android_bootable_recovery-0be4406e3cf4d2eba5bfdcb63d46bfd8847c7ef9.tar.bz2 android_bootable_recovery-0be4406e3cf4d2eba5bfdcb63d46bfd8847c7ef9.tar.lz android_bootable_recovery-0be4406e3cf4d2eba5bfdcb63d46bfd8847c7ef9.tar.xz android_bootable_recovery-0be4406e3cf4d2eba5bfdcb63d46bfd8847c7ef9.tar.zst android_bootable_recovery-0be4406e3cf4d2eba5bfdcb63d46bfd8847c7ef9.zip |
Diffstat (limited to '')
-rw-r--r-- | Android.bp | 4 | ||||
-rw-r--r-- | bootloader_message/bootloader_message.cpp | 3 | ||||
-rw-r--r-- | roots.cpp | 9 | ||||
-rw-r--r-- | roots.h | 4 | ||||
-rw-r--r-- | uncrypt/uncrypt.cpp | 3 |
5 files changed, 18 insertions, 5 deletions
diff --git a/Android.bp b/Android.bp index 41075d23a..afa033716 100644 --- a/Android.bp +++ b/Android.bp @@ -45,6 +45,7 @@ cc_library { static_libs: [ "libminui", "libotautil", + "libfstab", ], shared_libs: [ @@ -157,6 +158,7 @@ cc_defaults { "libhealthhalutils", "libvintf_recovery", "libvintf", + "libfstab", ], } @@ -260,6 +262,7 @@ cc_binary { static_libs: [ "libotautil", + "libfstab", ], init_rc: [ @@ -287,6 +290,7 @@ cc_binary { static_libs: [ "libotautil", + "libfstab", ], init_rc: [ diff --git a/bootloader_message/bootloader_message.cpp b/bootloader_message/bootloader_message.cpp index b933cbf8e..8c1d63bdd 100644 --- a/bootloader_message/bootloader_message.cpp +++ b/bootloader_message/bootloader_message.cpp @@ -29,6 +29,9 @@ #include <android-base/unique_fd.h> #include <fstab/fstab.h> +using android::fs_mgr::Fstab; +using android::fs_mgr::ReadDefaultFstab; + static std::string get_misc_blk_device(std::string* err) { Fstab fstab; if (!ReadDefaultFstab(&fstab)) { @@ -45,6 +45,10 @@ #include "otautil/mounts.h" #include "otautil/sysutil.h" +using android::fs_mgr::Fstab; +using android::fs_mgr::FstabEntry; +using android::fs_mgr::ReadDefaultFstab; + static Fstab fstab; extern struct selabel_handle* sehandle; @@ -69,10 +73,7 @@ void load_volume_table() { } Volume* volume_for_mount_point(const std::string& mount_point) { - auto it = std::find_if(fstab.begin(), fstab.end(), [&mount_point](const auto& entry) { - return entry.mount_point == mount_point; - }); - return it == fstab.end() ? nullptr : &*it; + return android::fs_mgr::GetEntryForMountPoint(&fstab, mount_point); } // Mount the volume specified by path at the given mount_point. @@ -19,7 +19,9 @@ #include <string> -typedef struct FstabEntry Volume; +#include <fstab/fstab.h> + +using Volume = android::fs_mgr::FstabEntry; // Load and parse volume data from /etc/recovery.fstab. void load_volume_table(); diff --git a/uncrypt/uncrypt.cpp b/uncrypt/uncrypt.cpp index 75595ac2c..f1f4f69f0 100644 --- a/uncrypt/uncrypt.cpp +++ b/uncrypt/uncrypt.cpp @@ -119,6 +119,9 @@ #include "otautil/error_code.h" +using android::fs_mgr::Fstab; +using android::fs_mgr::ReadDefaultFstab; + static constexpr int WINDOW_SIZE = 5; static constexpr int FIBMAP_RETRY_LIMIT = 3; |