From e87f9e695e041a2ad547de98e317a35332dc1c9e Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Tue, 12 Jul 2011 18:07:45 -0700 Subject: [PATCH 1/2] support explicitly provided device paths Change-Id: I1ddb862f62932d2e1525d8b317613bf67a64093e --- bmlutils/bmlutils.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bmlutils/bmlutils.c b/bmlutils/bmlutils.c index db80501..dad3975 100644 --- a/bmlutils/bmlutils.c +++ b/bmlutils/bmlutils.c @@ -80,6 +80,10 @@ int cmd_bml_restore_raw_partition(const char *partition, const char *filename) if (strcmp(partition, "recovery") == 0 || strcmp(partition, "recoveryonly") == 0) ret = restore_internal(BOARD_BML_RECOVERY, filename); + + // support explicitly provided device paths + if (partition[0] == '/') + ret = restore_internal(partition, filename); return ret; } @@ -90,6 +94,10 @@ int cmd_bml_backup_raw_partition(const char *partition, const char *out_file) bml = BOARD_BML_BOOT; else if (strcmp("recovery", partition) == 0) bml = BOARD_BML_RECOVERY; + else if (partition[0] == '/') { + // support explicitly provided device paths + bml = partition; + } else { printf("Invalid partition.\n"); return -1; From 94a4babac74cdd9cad34dbaa0f38997ed540cec7 Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Wed, 13 Jul 2011 10:34:23 -0700 Subject: [PATCH 2/2] Google Music stores their music cache /sdcard/Android... Can't back this up unless we start selectively excluding apps, which is gross. Most apps only store interstitial files here, so it is not a huge deal. Apps need to be able to work properly without an SD card. (Oops ROM Manager). Revert "backup and restore of /sdcard/Android (see getExternalFilesDir)" This reverts commit 50732e3c67454e174f008ba5443b21070f360a56. Conflicts: Android.mk Change-Id: I3978c5521b4f29c4d709c3bb6a8fa7e53678a79e --- Android.mk | 2 +- edifyscripting.c | 4 ---- nandroid.c | 13 ------------- recovery.c | 3 +-- 4 files changed, 2 insertions(+), 20 deletions(-) diff --git a/Android.mk b/Android.mk index 5bf55da..db797cc 100644 --- a/Android.mk +++ b/Android.mk @@ -26,7 +26,7 @@ LOCAL_MODULE := recovery LOCAL_FORCE_STATIC_EXECUTABLE := true -RECOVERY_VERSION := ClockworkMod Recovery v4.0.0.9 +RECOVERY_VERSION := ClockworkMod Recovery v4.0.1.0 LOCAL_CFLAGS += -DRECOVERY_VERSION="$(RECOVERY_VERSION)" RECOVERY_API_VERSION := 2 LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION) diff --git a/edifyscripting.c b/edifyscripting.c index 1634a9e..89554d7 100644 --- a/edifyscripting.c +++ b/edifyscripting.c @@ -145,10 +145,6 @@ Value* FormatFn(const char* name, State* state, int argc, Expr* argv[]) { free(path); return StringValue(strdup("")); } - if (0 != format_volume("/sdcard/Android")) { - free(path); - return StringValue(strdup("")); - } } done: diff --git a/nandroid.c b/nandroid.c index 8bb82f1..af97e86 100644 --- a/nandroid.c +++ b/nandroid.c @@ -277,16 +277,6 @@ int nandroid_backup(const char* backup_path) return ret; } - if (0 != stat("/sdcard/Android", &s)) - { - ui_print("No /sdcard/Android found. Skipping backup of application files on external storage.\n"); - } - else - { - if (0 != (ret = nandroid_backup_partition_extended(backup_path, "/sdcard/Android", 0))) - return ret; - } - if (0 != (ret = nandroid_backup_partition_extended(backup_path, "/cache", 0))) return ret; @@ -524,9 +514,6 @@ int nandroid_restore(const char* backup_path, int restore_boot, int restore_syst if (restore_data && 0 != (ret = nandroid_restore_partition_extended(backup_path, "/sdcard/.android_secure", 0))) return ret; - if (restore_data && 0 != (ret = nandroid_restore_partition_extended(backup_path, "/sdcard/Android", 0))) - return ret; - if (restore_cache && 0 != (ret = nandroid_restore_partition_extended(backup_path, "/cache", 0))) return ret; diff --git a/recovery.c b/recovery.c index e69a461..89fb214 100644 --- a/recovery.c +++ b/recovery.c @@ -686,7 +686,6 @@ wipe_data(int confirm) { } erase_volume("/sd-ext"); erase_volume("/sdcard/.android_secure"); - erase_volume("/sdcard/Android"); ui_print("Data wipe complete.\n"); } @@ -827,7 +826,7 @@ main(int argc, char **argv) { case 'p': previous_runs = atoi(optarg); break; case 's': send_intent = optarg; break; case 'u': update_package = optarg; break; - case 'w': + case 'w': #ifndef BOARD_RECOVERY_ALWAYS_WIPES wipe_data = wipe_cache = 1; #endif