For Linux (and more precisely, debian flavors), here's how to add a "reboot-edl" command in "fastboot" command:
I have a blog post about this providing a few more information Here. Any comment is warmly encouraged and welcome.
Code:
mkdir /tmp/fastboot &&
cd /tmp/fastboot &&
apt-get source android-tools-fastboot </dev/null &&
cd android-tools-*
cat <<EOF | patch -p1
--- a/core/fastboot/fastboot.c
+++ b/core/fastboot/fastboot.c
@@ -284,6 +284,7 @@ void usage(void)
" continue continue with autoboot\n"
" reboot reboot device normally\n"
" reboot-bootloader reboot device into bootloader\n"
+ " reboot-edl reboot device into EDL (RedMi Note 3 Pro)\n"
" help show this help message\n"
"\n"
"options:\n"
@@ -803,6 +804,7 @@ int main(int argc, char **argv)
int wants_wipe = 0;
int wants_reboot = 0;
int wants_reboot_bootloader = 0;
+ int wants_reboot_edl = 0;
int erase_first = 1;
void *data;
unsigned sz;
@@ -929,6 +931,9 @@ int main(int argc, char **argv)
} else if(!strcmp(*argv, "reboot-bootloader")) {
wants_reboot_bootloader = 1;
skip(1);
+ } else if(!strcmp(*argv, "reboot-edl")) {
+ wants_reboot_edl = 1;
+ skip(1);
} else if (!strcmp(*argv, "continue")) {
fb_queue_command("continue", "resuming boot");
skip(1);
@@ -1009,6 +1014,8 @@ int main(int argc, char **argv)
fb_queue_reboot();
} else if (wants_reboot_bootloader) {
fb_queue_command("reboot-bootloader", "rebooting into bootloader");
+ } else if (wants_reboot_edl) {
+ fb_queue_command("reboot-edl", "rebooting into EDL mode");
}
if (fb_queue_is_empty())
EOF
apt-get build-dep android-tools-fastboot -y </dev/null
dpkg-buildpackage -rfakeroot -b
cd ..
dpkg -i android-tools-fastboot*.deb