diff options
author | Koushik Dutta <koushd@gmail.com> | 2012-06-17 20:22:22 -0700 |
---|---|---|
committer | Koushik Dutta <koushd@gmail.com> | 2012-06-17 20:23:11 -0700 |
commit | 407183abda027c35b35d4ac7ac43745e70ed1ffa (patch) | |
tree | 41973bfe4aed2edf5a787fced019de2463acb6dc /nandroid.c | |
parent | e491f80accc0ddb2c925df18d2b796968e48bb71 (diff) | |
download | bootable_recovery-407183abda027c35b35d4ac7ac43745e70ed1ffa.zip bootable_recovery-407183abda027c35b35d4ac7ac43745e70ed1ffa.tar.gz bootable_recovery-407183abda027c35b35d4ac7ac43745e70ed1ffa.tar.bz2 |
support datamedia on any one volume
Change-Id: I198e789ee01e8a5b10eee33ed59a2d828cfb096a
Diffstat (limited to 'nandroid.c')
-rw-r--r-- | nandroid.c | 21 |
1 files changed, 8 insertions, 13 deletions
@@ -264,12 +264,10 @@ int nandroid_backup(const char* backup_path) } Volume* volume = volume_for_path(backup_path); - if (NULL == volume) { - if (strstr(backup_path, "/sdcard") == backup_path && is_data_media()) - volume = volume_for_path("/data"); - else - return print_and_error("Unable to find volume for backup path.\n"); - } + if (NULL == volume) + return print_and_error("Unable to find volume for backup path.\n"); + if (is_data_media_volume_path(volume->mount_point)) + volume = volume_for_path("/data"); int ret; struct statfs s; if (NULL != volume) { @@ -471,22 +469,19 @@ 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 is_data_media (redundantly, and vol for /sdcard is NULL), let's revert + // and is_data_media, 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 // reformat the /system or /data partitions, and not boot due to // a locked bootloader. // Other devices, like the Galaxy Nexus, XOOM, and Galaxy Tab 10.1 - // have a /sdcard symlinked to /data/media. /data is set to "auto" - // so that when the format occurs, /data/media is not erased. - // The "auto" fs type preserves the file system, and does not - // trigger that lock. + // have a /sdcard symlinked to /data/media. // Or of volume does not exist (.android_secure), just rm -rf. if (vol == NULL || 0 == strcmp(vol->fs_type, "auto")) backup_filesystem = NULL; - else if (0 == strcmp(vol->mount_point, "/data") && volume_for_path("/sdcard") == NULL && is_data_media()) - backup_filesystem = NULL; + if (0 == strcmp(vol->mount_point, "/data") && is_data_media()) + backup_filesystem = NULL; } ensure_directory(mount_point); |