summaryrefslogtreecommitdiffstats
path: root/fastboot
diff options
context:
space:
mode:
authorKhalid Zubair <kzubair@cyngn.com>2016-02-08 16:03:36 -0800
committerGerrit Code Review <gerrit@cyanogenmod.org>2016-02-09 09:51:49 -0800
commitd55fc8946d5d008a5174e6592063b27a65dc2856 (patch)
tree91228d46c332bbd64839e2edce540ea70a04b7cc /fastboot
parent0d7937ab76d5880425b7c756dc4cbb441198a0a1 (diff)
downloadsystem_core-d55fc8946d5d008a5174e6592063b27a65dc2856.zip
system_core-d55fc8946d5d008a5174e6592063b27a65dc2856.tar.gz
system_core-d55fc8946d5d008a5174e6592063b27a65dc2856.tar.bz2
fastboot: add -R, --reboot switch
Add a fastboot switch to reboot after finishing an operation. This allows a user to do `fastboot flash system -R' and reboot the device after the system partition flashes. The existing reboot *command* cannot be conveniently chained with a flash command the same way -w can be combined with flash[all]. Change-Id: I4e9f1e7b6336369bc35150f92ff9a56b3db2ef42
Diffstat (limited to 'fastboot')
-rw-r--r--fastboot/fastboot.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp
index ec3b84a..c7d8c90 100644
--- a/fastboot/fastboot.cpp
+++ b/fastboot/fastboot.cpp
@@ -329,6 +329,7 @@ void usage(void)
" default: 2048\n"
" -S <size>[K|M|G] automatically sparse files greater\n"
" than size. 0 to disable\n"
+ " -R reboot device (e.g. after flash)\n"
);
}
@@ -1027,13 +1028,14 @@ int main(int argc, char **argv)
{"help", no_argument, 0, 'h'},
{"unbuffered", no_argument, 0, 0},
{"version", no_argument, 0, 0},
+ {"reboot", no_argument, 0, 'R'},
{0, 0, 0, 0}
};
serial = getenv("ANDROID_SERIAL");
while (1) {
- c = getopt_long(argc, argv, "wub:k:n:r:t:s:S:lp:c:i:m:h", longopts, &longindex);
+ c = getopt_long(argc, argv, "wub:k:n:r:t:s:S:lp:c:i:m:hR", longopts, &longindex);
if (c < 0) {
break;
}
@@ -1074,6 +1076,9 @@ int main(int argc, char **argv)
case 'r':
ramdisk_offset = strtoul(optarg, 0, 16);
break;
+ case 'R':
+ wants_reboot = 1;
+ break;
case 't':
tags_offset = strtoul(optarg, 0, 16);
break;