diff options
author | Doug Zongker <dougz@android.com> | 2012-04-12 21:55:53 +0200 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-04-12 21:55:53 +0200 |
commit | f69d40afa190a2b6938979fe10760c74a8cc55b3 (patch) | |
tree | 2baab2cc48f015a294f53a71ea60daa8c87c50e9 /recovery.cpp | |
parent | Merge "Add NOTICE file" (diff) | |
parent | minor recovery changes (diff) | |
download | android_bootable_recovery-f69d40afa190a2b6938979fe10760c74a8cc55b3.tar android_bootable_recovery-f69d40afa190a2b6938979fe10760c74a8cc55b3.tar.gz android_bootable_recovery-f69d40afa190a2b6938979fe10760c74a8cc55b3.tar.bz2 android_bootable_recovery-f69d40afa190a2b6938979fe10760c74a8cc55b3.tar.lz android_bootable_recovery-f69d40afa190a2b6938979fe10760c74a8cc55b3.tar.xz android_bootable_recovery-f69d40afa190a2b6938979fe10760c74a8cc55b3.tar.zst android_bootable_recovery-f69d40afa190a2b6938979fe10760c74a8cc55b3.zip |
Diffstat (limited to 'recovery.cpp')
-rw-r--r-- | recovery.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/recovery.cpp b/recovery.cpp index 1d749ca93..ce4358a53 100644 --- a/recovery.cpp +++ b/recovery.cpp @@ -53,6 +53,7 @@ static const struct option OPTIONS[] = { { "wipe_data", no_argument, NULL, 'w' }, { "wipe_cache", no_argument, NULL, 'c' }, { "show_text", no_argument, NULL, 't' }, + { "just_exit", no_argument, NULL, 'x' }, { NULL, 0, NULL, 0 }, }; @@ -81,6 +82,7 @@ RecoveryUI* ui = NULL; * --wipe_data - erase user data (and cache), then reboot * --wipe_cache - wipe cache (but not user data), then reboot * --set_encrypted_filesystem=on|off - enables / diasables encrypted fs + * --just_exit - do nothing; exit and reboot * * After completing, we remove /cache/recovery/command and reboot. * Arguments may also be supplied in the bootloader control block (BCB). @@ -281,7 +283,7 @@ finish_recovery(const char *send_intent) { chmod(LAST_LOG_FILE, 0640); chmod(LAST_INSTALL_FILE, 0644); - // Reset to mormal system boot so recovery won't cycle indefinitely. + // Reset to normal system boot so recovery won't cycle indefinitely. struct bootloader_message boot; memset(&boot, 0, sizeof(boot)); set_bootloader_message(&boot); @@ -789,6 +791,7 @@ main(int argc, char **argv) { const char *send_intent = NULL; const char *update_package = NULL; int wipe_data = 0, wipe_cache = 0; + bool just_exit = false; int arg; while ((arg = getopt_long(argc, argv, "", OPTIONS, NULL)) != -1) { @@ -799,6 +802,7 @@ main(int argc, char **argv) { case 'w': wipe_data = wipe_cache = 1; break; case 'c': wipe_cache = 1; break; case 't': ui->ShowText(true); break; + case 'x': just_exit = true; break; case '?': LOGE("Invalid command argument\n"); continue; @@ -863,7 +867,7 @@ main(int argc, char **argv) { } else if (wipe_cache) { if (wipe_cache && erase_volume("/cache")) status = INSTALL_ERROR; if (status != INSTALL_SUCCESS) ui->Print("Cache wipe failed.\n"); - } else { + } else if (!just_exit) { status = INSTALL_ERROR; // No command specified } |