summaryrefslogtreecommitdiffstats
path: root/roots.c
diff options
context:
space:
mode:
authorDoug Zongker <dougz@android.com>2010-09-22 01:49:26 +0200
committerDoug Zongker <dougz@android.com>2010-09-22 01:58:10 +0200
commitc18eeb874b003b53d47b1513d883a63fa352d28b (patch)
treea06cd43d880d8177153297955d996736f6eeaba3 /roots.c
parentremove the notion of "root path"; support mixed flash types (do not merge) (diff)
downloadandroid_bootable_recovery-c18eeb874b003b53d47b1513d883a63fa352d28b.tar
android_bootable_recovery-c18eeb874b003b53d47b1513d883a63fa352d28b.tar.gz
android_bootable_recovery-c18eeb874b003b53d47b1513d883a63fa352d28b.tar.bz2
android_bootable_recovery-c18eeb874b003b53d47b1513d883a63fa352d28b.tar.lz
android_bootable_recovery-c18eeb874b003b53d47b1513d883a63fa352d28b.tar.xz
android_bootable_recovery-c18eeb874b003b53d47b1513d883a63fa352d28b.tar.zst
android_bootable_recovery-c18eeb874b003b53d47b1513d883a63fa352d28b.zip
Diffstat (limited to 'roots.c')
-rw-r--r--roots.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/roots.c b/roots.c
index fb495fede..90b82d7ed 100644
--- a/roots.c
+++ b/roots.c
@@ -35,6 +35,13 @@ void load_volume_table() {
int alloc = 2;
device_volumes = malloc(alloc * sizeof(Volume));
+ // Insert an entry for /tmp, which is the ramdisk and is always mounted.
+ device_volumes[0].mount_point = "/tmp";
+ device_volumes[0].fs_type = "ramdisk";
+ device_volumes[0].device = NULL;
+ device_volumes[0].device2 = NULL;
+ num_volumes = 1;
+
FILE* fstab = fopen("/etc/recovery.fstab", "r");
if (fstab == NULL) {
LOGE("failed to open /etc/recovery.fstab (%s)\n", strerror(errno));
@@ -104,6 +111,10 @@ int ensure_path_mounted(const char* path) {
LOGE("unknown volume for path [%s]\n", path);
return -1;
}
+ if (strcmp(v->fs_type, "ramdisk") == 0) {
+ // the ramdisk is always mounted.
+ return 0;
+ }
int result;
result = scan_mounted_volumes();
@@ -160,6 +171,10 @@ int ensure_path_unmounted(const char* path) {
LOGE("unknown volume for path [%s]\n", path);
return -1;
}
+ if (strcmp(v->fs_type, "ramdisk") == 0) {
+ // the ramdisk is always mounted; you can't unmount it.
+ return -1;
+ }
int result;
result = scan_mounted_volumes();
@@ -184,6 +199,11 @@ int format_volume(const char* volume) {
LOGE("unknown volume \"%s\"\n", volume);
return -1;
}
+ if (strcmp(v->fs_type, "ramdisk") == 0) {
+ // you can't format the ramdisk.
+ LOGE("can't format_volume \"%s\"", volume);
+ return -1;
+ }
if (strcmp(v->mount_point, volume) != 0) {
LOGE("can't give path \"%s\" to format_volume\n", volume);
return -1;