summaryrefslogtreecommitdiffstats
path: root/roots.cpp
diff options
context:
space:
mode:
authorDees_Troy <dees_troy@teamw.in>2012-09-20 21:32:13 +0200
committerDees_Troy <dees_troy@teamw.in>2012-09-20 21:32:50 +0200
commitc51f1f994ada7b46224f672481c0dacf3894c70b (patch)
treede20eb047205f9fec817cdd18ec47a82ae16add5 /roots.cpp
parentFix fstab and unmount problems (diff)
downloadandroid_bootable_recovery-c51f1f994ada7b46224f672481c0dacf3894c70b.tar
android_bootable_recovery-c51f1f994ada7b46224f672481c0dacf3894c70b.tar.gz
android_bootable_recovery-c51f1f994ada7b46224f672481c0dacf3894c70b.tar.bz2
android_bootable_recovery-c51f1f994ada7b46224f672481c0dacf3894c70b.tar.lz
android_bootable_recovery-c51f1f994ada7b46224f672481c0dacf3894c70b.tar.xz
android_bootable_recovery-c51f1f994ada7b46224f672481c0dacf3894c70b.tar.zst
android_bootable_recovery-c51f1f994ada7b46224f672481c0dacf3894c70b.zip
Diffstat (limited to 'roots.cpp')
-rw-r--r--roots.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/roots.cpp b/roots.cpp
index 69c98fc1d..9cbaa499a 100644
--- a/roots.cpp
+++ b/roots.cpp
@@ -29,6 +29,7 @@ extern "C" {
#include "roots.h"
#include "common.h"
#include "make_ext4fs.h"
+#include "partitions.hpp"
static int num_volumes = 0;
static Volume* device_volumes = NULL;
@@ -142,6 +143,10 @@ Volume* volume_for_path(const char* path) {
}
int ensure_path_mounted(const char* path) {
+ if (PartitionManager.Mount_By_Path(path, true))
+ return 0;
+ else
+ return -1;
Volume* v = volume_for_path(path);
if (v == NULL) {
LOGE("unknown volume for path [%s]\n", path);
@@ -202,6 +207,10 @@ int ensure_path_mounted(const char* path) {
}
int ensure_path_unmounted(const char* path) {
+ if (PartitionManager.UnMount_By_Path(path, true))
+ return 0;
+ else
+ return -1;
Volume* v = volume_for_path(path);
if (v == NULL) {
LOGE("unknown volume for path [%s]\n", path);
@@ -230,6 +239,10 @@ int ensure_path_unmounted(const char* path) {
}
int format_volume(const char* volume) {
+ if (PartitionManager.Wipe_By_Path(volume))
+ return 0;
+ else
+ return -1;
Volume* v = volume_for_path(volume);
if (v == NULL) {
LOGE("unknown volume \"%s\"\n", volume);