add comments around /data/media

Change-Id: I35ad822ed602e2b1018f1e1a0d67499867b60a40
This commit is contained in:
Koushik Dutta 2011-12-18 13:49:52 -08:00
parent d4c04cb00b
commit 9487d2965f
2 changed files with 4 additions and 2 deletions

View File

@ -437,7 +437,7 @@ int nandroid_restore_partition_extended(const char* backup_path, const char* mou
}
// If the fs_type of this volume is "auto" or mount_point is /data
// and vol for /sdcard is NULL and is_data_media, let's revert
// and is_data_media (redundantly, and vol for /sdcard is NULL), let's revert
// to using a rm -rf, rather than trying to do a
// ext3/ext4/whatever format.
// This is because some phones (like DroidX) will freak out if you

View File

@ -334,8 +334,10 @@ int format_volume(const char* volume) {
LOGE("unknown volume \"%s\"\n", volume);
return -1;
}
// check to see if /data is being formatted, and if it is /data/media
// Note: the /sdcard check is redundant probably, just being safe.
if (strstr(volume, "/data") == volume && volume_for_path("/sdcard") == NULL && is_data_media()) {
return format_unknown_device(NULL, volume, NULL);
return format_unknown_device(NULL, volume, NULL);
}
if (strcmp(v->fs_type, "ramdisk") == 0) {
// you can't format the ramdisk.