diff options
author | Koushik Dutta <koushd@gmail.com> | 2012-01-26 14:56:56 -0800 |
---|---|---|
committer | Koushik Dutta <koushd@gmail.com> | 2012-01-26 14:56:56 -0800 |
commit | 5a44ceb692c3d5e68007f46b68847d3d885831fa (patch) | |
tree | 863b8961d323bd863c29eaa7351e8978d34781e5 /extendedcommands.c | |
parent | 4c8e2482a6feb63f3449e57205df84b9749fa88c (diff) | |
download | bootable_recovery-5a44ceb692c3d5e68007f46b68847d3d885831fa.zip bootable_recovery-5a44ceb692c3d5e68007f46b68847d3d885831fa.tar.gz bootable_recovery-5a44ceb692c3d5e68007f46b68847d3d885831fa.tar.bz2 |
remove hacky board define around usb storage mounting on /data/media devices.
Change-Id: I2d382762271a2cfc6d83454160ed127b7457c88c
Diffstat (limited to 'extendedcommands.c')
-rw-r--r-- | extendedcommands.c | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/extendedcommands.c b/extendedcommands.c index 729778c..af67c3e 100644 --- a/extendedcommands.c +++ b/extendedcommands.c @@ -635,7 +635,7 @@ void show_partition_menu() string options[255]; if(!device_volumes) - return; + return; mountable_volumes = 0; formatable_volumes = 0; @@ -644,25 +644,24 @@ void show_partition_menu() format_menue = malloc(num_volumes * sizeof(FormatMenuEntry)); for (i = 0; i < num_volumes; ++i) { - Volume* v = &device_volumes[i]; - if(strcmp("ramdisk", v->fs_type) != 0 && strcmp("mtd", v->fs_type) != 0 && strcmp("emmc", v->fs_type) != 0 && strcmp("bml", v->fs_type) != 0) - { - sprintf(&mount_menue[mountable_volumes].mount, "mount %s", v->mount_point); - sprintf(&mount_menue[mountable_volumes].unmount, "unmount %s", v->mount_point); - mount_menue[mountable_volumes].v = &device_volumes[i]; - ++mountable_volumes; - if (is_safe_to_format(v->mount_point)) { - sprintf(&format_menue[formatable_volumes].txt, "format %s", v->mount_point); - format_menue[formatable_volumes].v = &device_volumes[i]; - ++formatable_volumes; - } - } - else if (strcmp("ramdisk", v->fs_type) != 0 && strcmp("mtd", v->fs_type) == 0 && is_safe_to_format(v->mount_point)) - { - sprintf(&format_menue[formatable_volumes].txt, "format %s", v->mount_point); - format_menue[formatable_volumes].v = &device_volumes[i]; - ++formatable_volumes; - } + Volume* v = &device_volumes[i]; + if(strcmp("ramdisk", v->fs_type) != 0 && strcmp("mtd", v->fs_type) != 0 && strcmp("emmc", v->fs_type) != 0 && strcmp("bml", v->fs_type) != 0) { + sprintf(&mount_menue[mountable_volumes].mount, "mount %s", v->mount_point); + sprintf(&mount_menue[mountable_volumes].unmount, "unmount %s", v->mount_point); + mount_menue[mountable_volumes].v = &device_volumes[i]; + ++mountable_volumes; + if (is_safe_to_format(v->mount_point)) { + sprintf(&format_menue[formatable_volumes].txt, "format %s", v->mount_point); + format_menue[formatable_volumes].v = &device_volumes[i]; + ++formatable_volumes; + } + } + else if (strcmp("ramdisk", v->fs_type) != 0 && strcmp("mtd", v->fs_type) == 0 && is_safe_to_format(v->mount_point)) + { + sprintf(&format_menue[formatable_volumes].txt, "format %s", v->mount_point); + format_menue[formatable_volumes].v = &device_volumes[i]; + ++formatable_volumes; + } } @@ -672,37 +671,39 @@ void show_partition_menu() for (;;) { - - for (i = 0; i < mountable_volumes; i++) - { - MountMenuEntry* e = &mount_menue[i]; - Volume* v = e->v; - if(is_path_mounted(v->mount_point)) - options[i] = e->unmount; - else - options[i] = e->mount; - } - - for (i = 0; i < formatable_volumes; i++) - { - FormatMenuEntry* e = &format_menue[i]; - - options[mountable_volumes+i] = e->txt; - } - - options[mountable_volumes+formatable_volumes] = "mount USB storage"; - options[mountable_volumes+formatable_volumes + 1] = NULL; + for (i = 0; i < mountable_volumes; i++) + { + MountMenuEntry* e = &mount_menue[i]; + Volume* v = e->v; + if(is_path_mounted(v->mount_point)) + options[i] = e->unmount; + else + options[i] = e->mount; + } + + for (i = 0; i < formatable_volumes; i++) + { + FormatMenuEntry* e = &format_menue[i]; + + options[mountable_volumes+i] = e->txt; + } + + if (is_data_media()) { + options[mountable_volumes + formatable_volumes] = "mount USB storage"; + options[mountable_volumes + formatable_volumes + 1] = NULL; + } + else { + options[mountable_volumes + formatable_volumes] = NULL; + } int chosen_item = get_menu_selection(headers, &options, 0, 0); if (chosen_item == GO_BACK) break; - if (chosen_item == (mountable_volumes+formatable_volumes)) - { + if (chosen_item == (mountable_volumes+formatable_volumes)) { show_mount_usb_storage_menu(); } - else if (chosen_item < mountable_volumes) - { - MountMenuEntry* e = &mount_menue[chosen_item]; + else if (chosen_item < mountable_volumes) { + MountMenuEntry* e = &mount_menue[chosen_item]; Volume* v = e->v; if (is_path_mounted(v->mount_point)) @@ -736,7 +737,6 @@ void show_partition_menu() free(mount_menue); free(format_menue); - } void show_nandroid_advanced_restore_menu(const char* path) |