diff options
Diffstat (limited to 'roots.cpp')
-rw-r--r-- | roots.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -18,6 +18,7 @@ #include <ctype.h> #include <fcntl.h> +#include <inttypes.h> #include <stdint.h> #include <stdlib.h> #include <string.h> @@ -44,6 +45,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; @@ -66,7 +68,7 @@ void load_volume_table() { printf("=========================\n"); for (int i = 0; i < fstab->num_entries; ++i) { const Volume* v = &fstab->recs[i]; - printf(" %d %s %s %s %lld\n", i, v->mount_point, v->fs_type, v->blk_device, v->length); + printf(" %d %s %s %s %" PRId64 "\n", i, v->mount_point, v->fs_type, v->blk_device, v->length); } printf("\n"); } @@ -407,3 +409,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; + } +} |