diff options
author | Mitchell Wills <mwills@google.com> | 2016-09-26 10:26:21 -0700 |
---|---|---|
committer | Mitchell Wills <mwills@google.com> | 2016-09-26 11:27:16 -0700 |
commit | 31dce302db2d0fa1a93bee3b3c2272891524a4e9 (patch) | |
tree | 1793be63f1eaaf6e8c0753e1681525383f26f630 /fastboot/fastboot.cpp | |
parent | aa00f5852f3c495184a14d1cd8bf39cc5c9be8db (diff) |
Add fastboot --skip-reboot flag
Add a flag to fastboot that will cause it to not reboot the device after
performing commands like update and flashall.
Fixed: 31743001
Test: run fastboot update with and without --skip-reboot flag
Change-Id: I7f4056249a52779c7fc752c9d1009a58a44762df
Diffstat (limited to 'fastboot/fastboot.cpp')
-rw-r--r-- | fastboot/fastboot.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp index 987ba8356..d6b631f12 100644 --- a/fastboot/fastboot.cpp +++ b/fastboot/fastboot.cpp @@ -402,6 +402,9 @@ static void usage() { " --skip-secondary Will not flash secondary slots when\n" " performing a flashall or update. This\n" " will preserve data on other slots.\n" + " --skip-reboot Will not reboot the device when\n" + " performing commands that normally\n" + " trigger a reboot.\n" #if !defined(_WIN32) " --wipe-and-use-fbe On devices which support it,\n" " erase userdata and cache, and\n" @@ -1392,6 +1395,7 @@ int main(int argc, char **argv) bool wants_wipe = false; bool wants_reboot = false; bool wants_reboot_bootloader = false; + bool skip_reboot = false; bool wants_set_active = false; bool skip_secondary = false; bool erase_first = true; @@ -1419,6 +1423,7 @@ int main(int argc, char **argv) {"set_active", optional_argument, 0, 'a'}, {"set-active", optional_argument, 0, 'a'}, {"skip-secondary", no_argument, 0, 0}, + {"skip-reboot", no_argument, 0, 0}, #if !defined(_WIN32) {"wipe-and-use-fbe", no_argument, 0, 0}, #endif @@ -1505,6 +1510,8 @@ int main(int argc, char **argv) slot_override = std::string(optarg); } else if (strcmp("skip-secondary", longopts[longindex].name) == 0 ) { skip_secondary = true; + } else if (strcmp("skip-reboot", longopts[longindex].name) == 0 ) { + skip_reboot = true; #if !defined(_WIN32) } else if (strcmp("wipe-and-use-fbe", longopts[longindex].name) == 0) { wants_wipe = true; @@ -1729,7 +1736,7 @@ int main(int argc, char **argv) do_update(transport, "update.zip", slot_override, erase_first, skip_secondary || slot_all); skip(1); } - wants_reboot = 1; + wants_reboot = true; } else if(!strcmp(*argv, "set_active")) { require(2); std::string slot = verify_slot(transport, std::string(argv[1]), false); @@ -1784,7 +1791,7 @@ int main(int argc, char **argv) if (wants_set_active) { fb_set_active(next_active.c_str()); } - if (wants_reboot) { + if (wants_reboot && !skip_reboot) { fb_queue_reboot(); fb_queue_wait_for_disconnect(); } else if (wants_reboot_bootloader) { |