summaryrefslogtreecommitdiffstats
path: root/roots.cpp
diff options
context:
space:
mode:
authorYifan Hong <elsk@google.com>2018-11-26 23:59:09 +0100
committerYifan Hong <elsk@google.com>2018-11-28 00:57:47 +0100
commit49327806062652db999f3f0a7f360edb3047791a (patch)
tree6ab66ac6da9121f2b1d505b428dbc5896684723b /roots.cpp
parentMerge changes I7b7cee68,I07d22c0d (diff)
downloadandroid_bootable_recovery-49327806062652db999f3f0a7f360edb3047791a.tar
android_bootable_recovery-49327806062652db999f3f0a7f360edb3047791a.tar.gz
android_bootable_recovery-49327806062652db999f3f0a7f360edb3047791a.tar.bz2
android_bootable_recovery-49327806062652db999f3f0a7f360edb3047791a.tar.lz
android_bootable_recovery-49327806062652db999f3f0a7f360edb3047791a.tar.xz
android_bootable_recovery-49327806062652db999f3f0a7f360edb3047791a.tar.zst
android_bootable_recovery-49327806062652db999f3f0a7f360edb3047791a.zip
Diffstat (limited to 'roots.cpp')
-rw-r--r--roots.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/roots.cpp b/roots.cpp
index dc347848a..e68cb20bc 100644
--- a/roots.cpp
+++ b/roots.cpp
@@ -44,6 +44,7 @@
static struct fstab* fstab = nullptr;
static bool did_map_logical_partitions = false;
+static constexpr const char* SYSTEM_ROOT = "/system";
extern struct selabel_handle* sehandle;
@@ -412,3 +413,11 @@ int setup_install_mounts() {
bool logical_partitions_mapped() {
return did_map_logical_partitions;
}
+
+std::string get_system_root() {
+ if (volume_for_mount_point(SYSTEM_ROOT) == nullptr) {
+ return "/";
+ } else {
+ return SYSTEM_ROOT;
+ }
+}