From e0bfb759cbed0758c38fc21422aa59d79f9f3343 Mon Sep 17 00:00:00 2001 From: Alexey Polyudov Date: Tue, 3 Jan 2017 19:39:13 -0800 Subject: [PATCH] fastboot: add EDL mode support reboot device into emergency download mode (if HW supports it) Change-Id: If068fdd041c5bdc7bf65515a78aabf18082cba2a Signed-off-by: Alexey Polyudov --- fastboot/fastboot.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp index 3f8bc8f3a..f970e683b 100644 --- a/fastboot/fastboot.cpp +++ b/fastboot/fastboot.cpp @@ -358,7 +358,7 @@ static void usage() { " devices [-l] List all connected devices [with\n" " device paths].\n" " continue Continue with autoboot.\n" - " reboot [bootloader] Reboot device [into bootloader].\n" + " reboot [bootloader|emergency] Reboot device [into bootloader or emergency mode].\n" " reboot-bootloader Reboot device into bootloader.\n" " help Show this help message.\n" "\n" @@ -1397,6 +1397,7 @@ int main(int argc, char **argv) bool wants_wipe = false; bool wants_reboot = false; bool wants_reboot_bootloader = false; + bool wants_reboot_emergency = false; bool skip_reboot = false; bool wants_set_active = false; bool skip_secondary = false; @@ -1648,6 +1649,11 @@ int main(int argc, char **argv) wants_reboot_bootloader = true; skip(1); } + if (!strcmp(*argv, "emergency")) { + wants_reboot = false; + wants_reboot_emergency = true; + skip(1); + } } require(0); } else if(!strcmp(*argv, "reboot-bootloader")) { @@ -1807,6 +1813,9 @@ int main(int argc, char **argv) } else if (wants_reboot_bootloader) { fb_queue_command("reboot-bootloader", "rebooting into bootloader"); fb_queue_wait_for_disconnect(); + } else if (wants_reboot_emergency) { + fb_queue_command("reboot-emergency", "rebooting into emergency download (EDL) mode"); + fb_queue_wait_for_disconnect(); } return fb_execute_queue(transport) ? EXIT_FAILURE : EXIT_SUCCESS;