aboutsummaryrefslogtreecommitdiffstats
path: root/roots.c
diff options
context:
space:
mode:
authorKoushik Dutta <koushd@gmail.com>2010-07-14 18:37:33 -0700
committerKoushik Dutta <koushd@gmail.com>2010-07-14 18:37:33 -0700
commit1bf4f695d4784f304d6cac5a1addec31c2f3fdb9 (patch)
treed988071decf425d34e1b953107c63c814fbe5461 /roots.c
parent37186b19bce9994907a276f057468dfc28a98b00 (diff)
downloadandroid_bootable_recovery-1bf4f695d4784f304d6cac5a1addec31c2f3fdb9.tar.gz
android_bootable_recovery-1bf4f695d4784f304d6cac5a1addec31c2f3fdb9.tar.bz2
android_bootable_recovery-1bf4f695d4784f304d6cac5a1addec31c2f3fdb9.zip
allow toggling of software back menu item. add recovery checkpoint file. mount auto now uses busybox mount.
Diffstat (limited to 'roots.c')
-rw-r--r--roots.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/roots.c b/roots.c
index d54de2d0..da10ee7c 100644
--- a/roots.c
+++ b/roots.c
@@ -21,6 +21,8 @@
#include <sys/types.h>
#include <unistd.h>
+#include <limits.h>
+
#include "mtdutils/mtdutils.h"
#include "mtdutils/mounts.h"
#include "minzip/Zip.h"
@@ -205,6 +207,18 @@ is_root_path_mounted(const char *root_path)
return internal_root_mounted(info) >= 0;
}
+static int mount_internal(const char* device, const char* mount_point, const char* filesystem)
+{
+ if (strcmp(filesystem, "auto") != 0) {
+ return mount(device, mount_point, filesystem, MS_NOATIME | MS_NODEV | MS_NODIRATIME, "");
+ }
+ else {
+ char mount_cmd[PATH_MAX];
+ sprintf(mount_cmd, "mount -onoatime,nodiratime,nodev %s %s", device, mount_point);
+ return __system(mount_cmd);
+ }
+}
+
int
ensure_root_path_mounted(const char *root_path)
{
@@ -245,8 +259,7 @@ ensure_root_path_mounted(const char *root_path)
}
mkdir(info->mount_point, 0755); // in case it doesn't already exist
- if (mount(info->device, info->mount_point, info->filesystem,
- MS_NOATIME | MS_NODEV | MS_NODIRATIME, "")) {
+ if (mount_internal(info->device, info->mount_point, info->filesystem)) {
if (info->device2 == NULL) {
LOGE("Can't mount %s\n(%s)\n", info->device, strerror(errno));
return -1;