aboutsummaryrefslogtreecommitdiffstats
path: root/roots.c
diff options
context:
space:
mode:
authorKoushik Dutta <koushd@gmail.com>2011-02-09 16:15:54 -0800
committerKoushik Dutta <koushd@gmail.com>2011-02-09 16:15:54 -0800
commit49ee9a8b093b5acf4c80fca26612070cac20beac (patch)
tree72d9c062b42ce63807a96cbe98b56ffa544bba29 /roots.c
parent64d79c6531eea2df8d4c7702a51fce262da635dd (diff)
downloadandroid_bootable_recovery-49ee9a8b093b5acf4c80fca26612070cac20beac.tar.gz
android_bootable_recovery-49ee9a8b093b5acf4c80fca26612070cac20beac.tar.bz2
android_bootable_recovery-49ee9a8b093b5acf4c80fca26612070cac20beac.zip
Defer to fstype2 if found. Use auto fs if two fstypes are specified
Change-Id: Id6ee1fed1eebbaa6d3a9e6117910f00a56378da4
Diffstat (limited to 'roots.c')
-rw-r--r--roots.c25
1 files changed, 5 insertions, 20 deletions
diff --git a/roots.c b/roots.c
index 5df84d3c..7c4e2412 100644
--- a/roots.c
+++ b/roots.c
@@ -159,31 +159,16 @@ int ensure_path_mounted(const char* path) {
} else if (strcmp(v->fs_type, "ext4") == 0 ||
strcmp(v->fs_type, "ext3") == 0 ||
strcmp(v->fs_type, "vfat") == 0) {
- if ((result = try_mount(v->device, v->mount_point, v->fs_type)) == 0)
- return 0;
- if ((result = try_mount(v->device2, v->mount_point, v->fs_type)) == 0)
- return 0;
+ // try fs type 2 first
if ((result = try_mount(v->device, v->mount_point, v->fs_type2)) == 0)
return 0;
if ((result = try_mount(v->device2, v->mount_point, v->fs_type2)) == 0)
return 0;
+ if ((result = try_mount(v->device, v->mount_point, v->fs_type)) == 0)
+ return 0;
+ if ((result = try_mount(v->device2, v->mount_point, v->fs_type)) == 0)
+ return 0;
return result;
- /*
- result = mount(v->device, v->mount_point, v->fs_type,
- MS_NOATIME | MS_NODEV | MS_NODIRATIME, "");
- if (result == 0) return 0;
-
- if (v->device2) {
- LOGW("failed to mount %s (%s); trying %s\n",
- v->device, strerror(errno), v->device2);
- result = mount(v->device2, v->mount_point, v->fs_type,
- MS_NOATIME | MS_NODEV | MS_NODIRATIME, "");
- if (result == 0) return 0;
- }
-
- LOGE("failed to mount %s (%s)\n", v->mount_point, strerror(errno));
- return -1;
- */
} else {
// let's try mounting with the mount binary and hope for the best.
char mount_cmd[PATH_MAX];