Fix various bugs.
Change-Id: I46e3001e6857480a77253be24b1753b2e4d88e69
This commit is contained in:
parent
b643e4f3d0
commit
bf4444f1fb
@ -227,7 +227,7 @@ int nandroid_restore_partition_extended(const char* backup_path, const char* mou
|
||||
return ret;
|
||||
}
|
||||
*/
|
||||
if (0 != (ret = format_device(mount_point))) {
|
||||
if (0 != (ret = format_volume(mount_point))) {
|
||||
ui_print("Error while formatting %s!\n", mount_point);
|
||||
return ret;
|
||||
}
|
||||
|
@ -681,8 +681,9 @@ wipe_data(int confirm) {
|
||||
device_wipe_data();
|
||||
erase_volume("/data");
|
||||
erase_volume("/cache");
|
||||
#ifdef BOARD_HAS_DATADATA
|
||||
erase_volume("/datadata");
|
||||
erase_volume("/datadata");
|
||||
#endif
|
||||
erase_volume("/sd-ext");
|
||||
erase_volume("/sdcard/.android_secure");
|
||||
ui_print("Data wipe complete.\n");
|
||||
|
6
roots.c
6
roots.c
@ -196,6 +196,9 @@ int ensure_path_unmounted(const char* path) {
|
||||
int format_volume(const char* volume) {
|
||||
Volume* v = volume_for_path(volume);
|
||||
if (v == NULL) {
|
||||
// silent failure for sd-ext
|
||||
if (strcmp(volume, "/sd-ext") == 0)
|
||||
return -1;
|
||||
LOGE("unknown volume \"%s\"\n", volume);
|
||||
return -1;
|
||||
}
|
||||
@ -205,8 +208,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(volume);
|
||||
}
|
||||
|
||||
if (ensure_path_unmounted(volume) != 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user