diff options
author | philz-cwm6 <phytowardt@gmail.com> | 2013-08-16 23:09:00 +0200 |
---|---|---|
committer | philz-cwm6 <phytowardt@gmail.com> | 2013-08-16 23:09:00 +0200 |
commit | aee5f78ddec238cec016849acaf1d3007b8b1507 (patch) | |
tree | 2af2b948bb1214fa9c07f29460b61421272aae52 /roots.c | |
parent | ead73d809f23242873cd92e839a5c3fa28667abb (diff) | |
download | android_bootable_recovery-aee5f78ddec238cec016849acaf1d3007b8b1507.tar.gz android_bootable_recovery-aee5f78ddec238cec016849acaf1d3007b8b1507.tar.bz2 android_bootable_recovery-aee5f78ddec238cec016849acaf1d3007b8b1507.zip |
If sd-ext is defined in recovery.fstab, but user did not partition sdcard, silent failure while formatting device (every nandroid restore or wipe data)
Change-Id: I3ee2f891899be8e4fe0d722e64357dc5e7bc7428
Diffstat (limited to 'roots.c')
-rw-r--r-- | roots.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -255,11 +255,19 @@ 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); + if (strcmp(volume, "/sd-ext") != 0) + LOGE("unknown volume \"%s\"\n", volume); return -1; } + // silent failure to format non existing sd-ext when defined in recovery.fstab + if (strcmp(volume, "/sd-ext") == 0) { + struct stat s; + if (0 != stat(v->blk_device, &s)) { + LOGI("Skipping format of sd-ext\n"); + return -1; + } + } + if (is_data_media_volume_path(volume)) { return format_unknown_device(NULL, volume, NULL); } |