summaryrefslogtreecommitdiffstats
path: root/roots.cpp
diff options
context:
space:
mode:
authorDees Troy <dees_troy@teamw.in>2013-11-02 21:25:14 +0100
committerDees Troy <dees_troy@teamw.in>2013-11-02 21:43:26 +0100
commitbb4c0cbc4bdbff65e3c997bc5bd0ad6d6afa19d6 (patch)
tree9c28e5243024d0755d15e981a21f2fbb35a41ead /roots.cpp
parentUpdate licenses to all match (diff)
parentmerge in klp-release history after reset to klp-dev (diff)
downloadandroid_bootable_recovery-bb4c0cbc4bdbff65e3c997bc5bd0ad6d6afa19d6.tar
android_bootable_recovery-bb4c0cbc4bdbff65e3c997bc5bd0ad6d6afa19d6.tar.gz
android_bootable_recovery-bb4c0cbc4bdbff65e3c997bc5bd0ad6d6afa19d6.tar.bz2
android_bootable_recovery-bb4c0cbc4bdbff65e3c997bc5bd0ad6d6afa19d6.tar.lz
android_bootable_recovery-bb4c0cbc4bdbff65e3c997bc5bd0ad6d6afa19d6.tar.xz
android_bootable_recovery-bb4c0cbc4bdbff65e3c997bc5bd0ad6d6afa19d6.tar.zst
android_bootable_recovery-bb4c0cbc4bdbff65e3c997bc5bd0ad6d6afa19d6.zip
Diffstat (limited to 'roots.cpp')
-rw-r--r--roots.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/roots.cpp b/roots.cpp
index c52cf591d..63a8eaf3b 100644
--- a/roots.cpp
+++ b/roots.cpp
@@ -217,3 +217,22 @@ int format_volume(const char* volume) {
LOGE("format_volume: fs_type \"%s\" unsupported\n", v->fs_type);
return -1;
}
+
+int setup_install_mounts() {
+ if (fstab == NULL) {
+ LOGE("can't set up install mounts: no fstab loaded\n");
+ return -1;
+ }
+ for (int i = 0; i < fstab->num_entries; ++i) {
+ Volume* v = fstab->recs + i;
+
+ if (strcmp(v->mount_point, "/tmp") == 0 ||
+ strcmp(v->mount_point, "/cache") == 0) {
+ if (ensure_path_mounted(v->mount_point) != 0) return -1;
+
+ } else {
+ if (ensure_path_unmounted(v->mount_point) != 0) return -1;
+ }
+ }
+ return 0;
+}