From a8708c6044f20432e161ef9db2271a097be561ef Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Sat, 1 Jan 2011 18:00:27 -0800 Subject: [PATCH] readd ext2/ext3 format support. Change-Id: Ic21197df8ff53fdc8ffd3dc1947bd2ecb475eda8 --- extendedcommands.c | 8 ++++++-- roots.c | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/extendedcommands.c b/extendedcommands.c index a6db1d5..f22e35e 100644 --- a/extendedcommands.c +++ b/extendedcommands.c @@ -437,17 +437,21 @@ format_ext2_device (const char *device) { int format_unknown_device(const char *device, const char* path, const char *fs_type) { + printf("Formatting unknown device.\n"); + // device may simply be a name, like "system" if (device[0] != '/') return erase_partition(device, fs_type); - if (strcmp("ext3", device) == 0) { + if (strcmp("ext3", fs_type) == 0) { + printf("Formatting ext3 device.\n"); if (0 != ensure_path_unmounted(path)) return -11; return format_ext3_device(device); } - if (strcmp("ext2", device) == 0) { + if (strcmp("ext2", fs_type) == 0) { + printf("Formatting ext2 device.\n"); if (0 != ensure_path_unmounted(path)) return -12; return format_ext2_device(device); diff --git a/roots.c b/roots.c index 61c7498..d8d8a0c 100644 --- a/roots.c +++ b/roots.c @@ -263,5 +263,5 @@ int format_volume(const char* volume) { LOGE("format_volume: fs_type \"%s\" unsupported\n", v->fs_type); return -1; #endif - return format_unknown_device(volume); + return format_unknown_device(v->device, volume, v->fs_type); }