From a4be87f38f48758c63a988d34390aab1ffbc9f7d Mon Sep 17 00:00:00 2001 From: philz-cwm6 Date: Wed, 12 Jun 2013 15:54:08 +0200 Subject: Add sdparted option to partition in ext4 fstype Taken from PhilZ Touch recovery Signed-off-by: Michael Bestas Change-Id: I079617fc32f8ad0aea754a60898cd4f9cc482524 --- extendedcommands.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/extendedcommands.c b/extendedcommands.c index 5b6e52f..2aa5174 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"); -- cgit v1.1