aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKoushik Dutta <koushd@gmail.com>2013-08-05 20:27:04 +0000
committerGerrit Code Review <gerrit@cyanogenmod.org>2013-08-05 20:27:04 +0000
commit6fd7ca9e522be222beb64223224a3ca1f6e86440 (patch)
tree9e11372f2f17f06ff610d27e433742292939893e
parentcaf0c8a6bf5eaa27cf36243965f7813ca2f0af13 (diff)
parenta4be87f38f48758c63a988d34390aab1ffbc9f7d (diff)
downloadbootable_recovery-6fd7ca9e522be222beb64223224a3ca1f6e86440.zip
bootable_recovery-6fd7ca9e522be222beb64223224a3ca1f6e86440.tar.gz
bootable_recovery-6fd7ca9e522be222beb64223224a3ca1f6e86440.tar.bz2
Merge "Add sdparted option to partition in ext4 fstype" into cm-10.1
-rw-r--r--extendedcommands.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/extendedcommands.c b/extendedcommands.c
index 8bf9227..7ceed7c 100644
--- a/extendedcommands.c
+++ b/extendedcommands.c
@@ -1262,8 +1262,14 @@ static void partition_sdcard(const char* volume) {
"256M",
NULL };
+ static char* partition_types[] = { "ext3",
+ "ext4",
+ NULL
+ };
+
static char* ext_headers[] = { "Ext Size", "", NULL };
static char* swap_headers[] = { "Swap Size", "", NULL };
+ static char* fstype_headers[] = {"Partition Type", "", NULL };
int ext_size = get_menu_selection(ext_headers, ext_sizes, 0, 0);
if (ext_size == GO_BACK)
@@ -1273,6 +1279,10 @@ static void partition_sdcard(const char* volume) {
if (swap_size == GO_BACK)
return;
+ int partition_type = get_menu_selection(fstype_headers, partition_types, 0, 0);
+ if (partition_type == GO_BACK)
+ return;
+
char sddevice[256];
Volume *vol = volume_for_path(volume);
strcpy(sddevice, vol->device);
@@ -1280,7 +1290,7 @@ static void partition_sdcard(const char* volume) {
sddevice[strlen("/dev/block/mmcblkX")] = NULL;
char cmd[PATH_MAX];
setenv("SDPATH", sddevice, 1);
- sprintf(cmd, "sdparted -es %s -ss %s -efs ext3 -s", ext_sizes[ext_size], swap_sizes[swap_size]);
+ sprintf(cmd, "sdparted -es %s -ss %s -efs %s -s", ext_sizes[ext_size], swap_sizes[swap_size], partition_types[partition_type]);
ui_print("Partitioning SD Card... please wait...\n");
if (0 == __system(cmd))
ui_print("Done!\n");