diff options
author | Doug Zongker <dougz@android.com> | 2010-09-22 22:53:57 +0200 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-09-22 22:53:57 +0200 |
commit | 1a32732db2309bf74f180f2b1cc40c03d621cf13 (patch) | |
tree | f7f679a92c1944c6667bdfc2fe8cea45c2acf885 | |
parent | am af78591c: am 2c3c5c15: Merge "mount sdcard only on demand; fix sideload installs" into gingerbread (diff) | |
parent | am 9b125b04: handle old-style CACHE: packages (diff) | |
download | android_bootable_recovery-1a32732db2309bf74f180f2b1cc40c03d621cf13.tar android_bootable_recovery-1a32732db2309bf74f180f2b1cc40c03d621cf13.tar.gz android_bootable_recovery-1a32732db2309bf74f180f2b1cc40c03d621cf13.tar.bz2 android_bootable_recovery-1a32732db2309bf74f180f2b1cc40c03d621cf13.tar.lz android_bootable_recovery-1a32732db2309bf74f180f2b1cc40c03d621cf13.tar.xz android_bootable_recovery-1a32732db2309bf74f180f2b1cc40c03d621cf13.tar.zst android_bootable_recovery-1a32732db2309bf74f180f2b1cc40c03d621cf13.zip |
-rw-r--r-- | recovery.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/recovery.c b/recovery.c index 36da5f36a..6f9f8e750 100644 --- a/recovery.c +++ b/recovery.c @@ -88,7 +88,7 @@ static const char *SIDELOAD_TEMP_DIR = "/tmp/sideload"; * * OTA INSTALL * 1. main system downloads OTA package to /cache/some-filename.zip - * 2. main system writes "--update_package=CACHE:some-filename.zip" + * 2. main system writes "--update_package=/cache/some-filename.zip" * 3. main system reboots into recovery * 4. get_args() writes BCB with "boot-recovery" and "--update_package=..." * -- after this, rebooting will attempt to reinstall the update -- @@ -711,7 +711,23 @@ main(int argc, char **argv) { for (arg = 0; arg < argc; arg++) { printf(" \"%s\"", argv[arg]); } - printf("\n\n"); + printf("\n"); + + if (update_package) { + // For backwards compatibility on the cache partition only, if + // we're given an old 'root' path "CACHE:foo", change it to + // "/cache/foo". + if (strncmp(update_package, "CACHE:", 6) == 0) { + int len = strlen(update_package) + 10; + char* modified_path = malloc(len); + strlcpy(modified_path, "/cache/", len); + strlcat(modified_path, update_package+6, len); + printf("(replacing path \"%s\" with \"%s\")\n", + update_package, modified_path); + update_package = modified_path; + } + } + printf("\n"); property_list(print_property, NULL); printf("\n"); |