roots: Remove get_system_root and logical_partitions_mapped.
Test: TreeHugger Test: Boot into recovery on blueline. Choose "Mount system partition". Change-Id: Iac475d18ce2415de09dc0bf009ad4cf0383ffede
This commit is contained in:
parent
343a7dcdd2
commit
f90d9a102f
5 changed files with 6 additions and 16 deletions
|
@ -34,6 +34,7 @@
|
||||||
#include <android-base/logging.h>
|
#include <android-base/logging.h>
|
||||||
#include <android-base/properties.h>
|
#include <android-base/properties.h>
|
||||||
#include <android-base/unique_fd.h>
|
#include <android-base/unique_fd.h>
|
||||||
|
#include <fs_mgr/roots.h>
|
||||||
|
|
||||||
#include "otautil/roots.h"
|
#include "otautil/roots.h"
|
||||||
|
|
||||||
|
@ -119,7 +120,7 @@ bool do_fsck_unshare_blocks() {
|
||||||
std::vector<std::string> partitions = { "/odm", "/oem", "/product", "/vendor" };
|
std::vector<std::string> partitions = { "/odm", "/oem", "/product", "/vendor" };
|
||||||
|
|
||||||
// Temporarily mount system so we can copy e2fsck_static.
|
// 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;
|
bool mounted = ensure_path_mounted_at(system_root, "/mnt/system") != -1;
|
||||||
partitions.push_back(system_root);
|
partitions.push_back(system_root);
|
||||||
|
|
||||||
|
|
|
@ -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
|
// Ensure that all and only the volumes that packages expect to find
|
||||||
// mounted (/tmp and /cache) are mounted. Returns 0 on success.
|
// mounted (/tmp and /cache) are mounted. Returns 0 on success.
|
||||||
int setup_install_mounts();
|
int setup_install_mounts();
|
||||||
|
|
||||||
bool logical_partitions_mapped();
|
|
||||||
|
|
||||||
std::string get_system_root();
|
|
||||||
|
|
|
@ -275,11 +275,3 @@ int setup_install_mounts() {
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool logical_partitions_mapped() {
|
|
||||||
return android::fs_mgr::LogicalPartitionsMapped();
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string get_system_root() {
|
|
||||||
return android::fs_mgr::GetSystemRoot();
|
|
||||||
}
|
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
#include <android-base/stringprintf.h>
|
#include <android-base/stringprintf.h>
|
||||||
#include <android-base/strings.h>
|
#include <android-base/strings.h>
|
||||||
#include <cutils/properties.h> /* for property_list */
|
#include <cutils/properties.h> /* for property_list */
|
||||||
|
#include <fs_mgr/roots.h>
|
||||||
#include <healthhalutils/HealthHalUtils.h>
|
#include <healthhalutils/HealthHalUtils.h>
|
||||||
#include <ziparchive/zip_archive.h>
|
#include <ziparchive/zip_archive.h>
|
||||||
|
|
||||||
|
@ -437,8 +438,7 @@ static Device::BuiltinAction PromptAndWait(Device* device, InstallResult status)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Device::MOUNT_SYSTEM:
|
case Device::MOUNT_SYSTEM:
|
||||||
// the system partition is mounted at /mnt/system
|
if (ensure_path_mounted_at(android::fs_mgr::GetSystemRoot(), "/mnt/system") != -1) {
|
||||||
if (ensure_path_mounted_at(get_system_root(), "/mnt/system") != -1) {
|
|
||||||
ui->Print("Mounted /system.\n");
|
ui->Print("Mounted /system.\n");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -42,6 +42,7 @@
|
||||||
#include <android-base/unique_fd.h>
|
#include <android-base/unique_fd.h>
|
||||||
#include <bootloader_message/bootloader_message.h>
|
#include <bootloader_message/bootloader_message.h>
|
||||||
#include <cutils/sockets.h>
|
#include <cutils/sockets.h>
|
||||||
|
#include <fs_mgr/roots.h>
|
||||||
#include <private/android_logger.h> /* private pmsg functions */
|
#include <private/android_logger.h> /* private pmsg functions */
|
||||||
#include <selinux/android.h>
|
#include <selinux/android.h>
|
||||||
#include <selinux/label.h>
|
#include <selinux/label.h>
|
||||||
|
@ -505,7 +506,7 @@ int main(int argc, char** argv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case Device::ENTER_FASTBOOT:
|
case Device::ENTER_FASTBOOT:
|
||||||
if (logical_partitions_mapped()) {
|
if (android::fs_mgr::LogicalPartitionsMapped()) {
|
||||||
ui->Print("Partitions may be mounted - rebooting to enter fastboot.");
|
ui->Print("Partitions may be mounted - rebooting to enter fastboot.");
|
||||||
Reboot("fastboot");
|
Reboot("fastboot");
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue