diff options
author | Koushik Dutta <koushd@gmail.com> | 2013-08-15 17:55:04 -0700 |
---|---|---|
committer | Koushik Dutta <koushd@gmail.com> | 2013-08-15 17:55:04 -0700 |
commit | 5a650a98077abf5073116a83a6f5d473dca2e7bb (patch) | |
tree | 66fedb09bcbec3ccdb5c70ecd1cb5620d472f235 /roots.c | |
parent | e19f1d8db8d6007318884272b4b04fcc97bab76f (diff) | |
download | android_bootable_recovery-5a650a98077abf5073116a83a6f5d473dca2e7bb.tar.gz android_bootable_recovery-5a650a98077abf5073116a83a6f5d473dca2e7bb.tar.bz2 android_bootable_recovery-5a650a98077abf5073116a83a6f5d473dca2e7bb.zip |
Fix issue where android device manager, etc, dont actually wipe data.
--wipe_data issues via /cache/recovery/command will now completely format data.
All other manual wipe commands will preserve data on /data/media.
There is another mounts/storage option that will do a true data format.
Change-Id: Ie8ecd2b0e14c3bb1d8a404ea868cdf703455d2ab
Diffstat (limited to 'roots.c')
-rw-r--r-- | roots.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -211,9 +211,11 @@ int ensure_path_mounted_at_mount_point(const char* path, const char* mount_point return -1; } +static int ignore_data_media = 0; + int ensure_path_unmounted(const char* path) { // if we are using /data/media, do not ever unmount volumes /data or /sdcard - if (strstr(path, "/data") == path && is_data_media()) { + if (strstr(path, "/data") == path && is_data_media() && !ignore_data_media) { return 0; } @@ -248,7 +250,6 @@ int ensure_path_unmounted(const char* path) { } extern struct selabel_handle *sehandle; -static int handle_data_media = 0; int format_volume(const char* volume) { Volume* v = volume_for_path(volume); @@ -264,7 +265,7 @@ int format_volume(const char* volume) { } // 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 && is_data_media() && !handle_data_media) { + if (strstr(volume, "/data") == volume && is_data_media() && !ignore_data_media) { return format_unknown_device(NULL, volume, NULL); } if (strcmp(v->fs_type, "ramdisk") == 0) { @@ -324,6 +325,6 @@ int format_volume(const char* volume) { return format_unknown_device(v->blk_device, volume, v->fs_type); } -void handle_data_media_format(int handle) { - handle_data_media = handle; +void ignore_data_media_workaround(int ignore) { + ignore_data_media = ignore; } |