From f90d9a102f8669560b19340536596018c63ce1b2 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Fri, 10 May 2019 10:40:59 -0700 Subject: roots: Remove get_system_root and logical_partitions_mapped. Test: TreeHugger Test: Boot into recovery on blueline. Choose "Mount system partition". Change-Id: Iac475d18ce2415de09dc0bf009ad4cf0383ffede --- fsck_unshare_blocks.cpp | 3 ++- otautil/include/otautil/roots.h | 4 ---- otautil/roots.cpp | 8 -------- recovery.cpp | 4 ++-- recovery_main.cpp | 3 ++- 5 files changed, 6 insertions(+), 16 deletions(-) diff --git a/fsck_unshare_blocks.cpp b/fsck_unshare_blocks.cpp index 0f8ffface..9dc0fd8ec 100644 --- a/fsck_unshare_blocks.cpp +++ b/fsck_unshare_blocks.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include "otautil/roots.h" @@ -119,7 +120,7 @@ bool do_fsck_unshare_blocks() { std::vector partitions = { "/odm", "/oem", "/product", "/vendor" }; // Temporarily mount system so we can copy e2fsck_static. - std::string system_root = get_system_root(); + auto system_root = android::fs_mgr::GetSystemRoot(); bool mounted = ensure_path_mounted_at(system_root, "/mnt/system") != -1; partitions.push_back(system_root); diff --git a/otautil/include/otautil/roots.h b/otautil/include/otautil/roots.h index 482f3d050..2ab3f4549 100644 --- a/otautil/include/otautil/roots.h +++ b/otautil/include/otautil/roots.h @@ -53,7 +53,3 @@ int format_volume(const std::string& volume, const std::string& directory); // Ensure that all and only the volumes that packages expect to find // mounted (/tmp and /cache) are mounted. Returns 0 on success. int setup_install_mounts(); - -bool logical_partitions_mapped(); - -std::string get_system_root(); diff --git a/otautil/roots.cpp b/otautil/roots.cpp index 815d644e5..a778e05ff 100644 --- a/otautil/roots.cpp +++ b/otautil/roots.cpp @@ -275,11 +275,3 @@ int setup_install_mounts() { } return 0; } - -bool logical_partitions_mapped() { - return android::fs_mgr::LogicalPartitionsMapped(); -} - -std::string get_system_root() { - return android::fs_mgr::GetSystemRoot(); -} diff --git a/recovery.cpp b/recovery.cpp index dbac3e01a..20e5a1be3 100644 --- a/recovery.cpp +++ b/recovery.cpp @@ -41,6 +41,7 @@ #include #include #include /* for property_list */ +#include #include #include @@ -437,8 +438,7 @@ static Device::BuiltinAction PromptAndWait(Device* device, InstallResult status) break; } case Device::MOUNT_SYSTEM: - // the system partition is mounted at /mnt/system - if (ensure_path_mounted_at(get_system_root(), "/mnt/system") != -1) { + if (ensure_path_mounted_at(android::fs_mgr::GetSystemRoot(), "/mnt/system") != -1) { ui->Print("Mounted /system.\n"); } break; diff --git a/recovery_main.cpp b/recovery_main.cpp index b999505fb..aba9c5d75 100644 --- a/recovery_main.cpp +++ b/recovery_main.cpp @@ -42,6 +42,7 @@ #include #include #include +#include #include /* private pmsg functions */ #include #include @@ -505,7 +506,7 @@ int main(int argc, char** argv) { } case Device::ENTER_FASTBOOT: - if (logical_partitions_mapped()) { + if (android::fs_mgr::LogicalPartitionsMapped()) { ui->Print("Partitions may be mounted - rebooting to enter fastboot."); Reboot("fastboot"); } else { -- cgit v1.2.3