fix android secure formatting

Change-Id: I617b8c453aad6d306cf8ddbc1a067c59ead56573
This commit is contained in:
Koushik Dutta 2011-01-02 14:11:24 -08:00
parent 67c381a6fa
commit 9f52e5f23b
3 changed files with 25 additions and 20 deletions

View File

@ -26,7 +26,7 @@ LOCAL_MODULE := recovery
LOCAL_FORCE_STATIC_EXECUTABLE := true
RECOVERY_VERSION := ClockworkMod Recovery v3.0.0.4
RECOVERY_VERSION := ClockworkMod Recovery v3.0.0.5
LOCAL_CFLAGS += -DRECOVERY_VERSION="$(RECOVERY_VERSION)"
RECOVERY_API_VERSION := 2
LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)

View File

@ -460,26 +460,8 @@ int format_unknown_device(const char *device, const char* path, const char *fs_t
// device may simply be a name, like "system"
if (device[0] != '/')
return erase_partition(device, fs_type);
if (strcmp("ext3", fs_type) == 0) {
LOGI("Formatting ext3 device.\n");
if (0 != ensure_path_unmounted(path)) {
LOGE("Error while unmounting %s.\n", path);
return -12;
}
return format_ext3_device(device);
}
if (strcmp("ext2", fs_type) == 0) {
LOGI("Formatting ext2 device.\n");
if (0 != ensure_path_unmounted(path)) {
LOGE("Error while unmounting %s.\n", path);
return -12;
}
return format_ext2_device(device);
}
// if this is SDEXT:, don't worry about it.
// if this is SDEXT:, don't worry about it if it does not exist.
if (0 == strcmp(path, "/sd-ext"))
{
struct stat st;
@ -491,6 +473,26 @@ int format_unknown_device(const char *device, const char* path, const char *fs_t
}
}
if (NULL != fs_type) {
if (strcmp("ext3", fs_type) == 0) {
LOGI("Formatting ext3 device.\n");
if (0 != ensure_path_unmounted(path)) {
LOGE("Error while unmounting %s.\n", path);
return -12;
}
return format_ext3_device(device);
}
if (strcmp("ext2", fs_type) == 0) {
LOGI("Formatting ext2 device.\n");
if (0 != ensure_path_unmounted(path)) {
LOGE("Error while unmounting %s.\n", path);
return -12;
}
return format_ext2_device(device);
}
}
if (0 != ensure_path_mounted(path))
{
ui_print("Error mounting %s!\n", path);

View File

@ -213,8 +213,11 @@ int format_volume(const char* volume) {
return -1;
}
if (strcmp(v->mount_point, volume) != 0) {
#if 0
LOGE("can't give path \"%s\" to format_volume\n", volume);
return -1;
#endif
return format_unknown_device(v->device, volume, NULL);
}
if (ensure_path_unmounted(volume) != 0) {