Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit d8c92147 authored by Khalid Zubair's avatar Khalid Zubair Committed by Michael Bestas
Browse files

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
parent dd4ad3fb
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -413,6 +413,7 @@ static void usage() {
#endif
            "  --unbuffered                             Do not buffer input or output.\n"
            "  --version                                Display version.\n"
            "  -R                                       reboot device (e.g. after flash)\n"
            "  -h, --help                               show this message.\n"
        );
}
@@ -1425,13 +1426,14 @@ int main(int argc, char **argv)
#if !defined(_WIN32)
        {"wipe-and-use-fbe", no_argument, 0, 0},
#endif
        {"reboot", no_argument, 0, 'R'},
        {0, 0, 0, 0}
    };

    serial = getenv("ANDROID_SERIAL");

    while (1) {
        int c = getopt_long(argc, argv, "wub:k:n:r:t:s:S:lp:c:i:m:ha::", longopts, &longindex);
        int c = getopt_long(argc, argv, "wub:k:n:r:t:s:S:lp:c:i:m:hRa::", longopts, &longindex);
        if (c < 0) {
            break;
        }
@@ -1477,6 +1479,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;