recovery: allow the user to cancel the recovery process

https://jira.digi.com/browse/DEL-6982

Signed-off-by: Francisco Gil Martinez <francisco.gilmartinez@digi.com>
This commit is contained in:
Francisco Gil Martinez 2020-03-19 09:27:10 +01:00
parent 2e30987a7e
commit f99ae24162
1 changed files with 6 additions and 5 deletions

View File

@ -175,6 +175,12 @@ int reboot_recovery(unsigned int reboot_timeout)
sync(); sync();
printf("\nThe recovery commands have been properly configured and "
"the system will reboot into recovery mode in %d seconds "
"(^C to cancel).\n\n", reboot_timeout);
fflush(stdout);
sleep(reboot_timeout);
/* Configure system to boot into recovery mode */ /* Configure system to boot into recovery mode */
ret = uboot_setenv("boot_recovery", "yes"); ret = uboot_setenv("boot_recovery", "yes");
if (ret) { if (ret) {
@ -182,11 +188,6 @@ int reboot_recovery(unsigned int reboot_timeout)
goto err; goto err;
} }
printf("\nThe recovery commands have been properly configured and "
"the system will reboot into recovery mode in %d seconds "
"(^C to cancel).\n\n", reboot_timeout);
fflush(stdout);
sleep(reboot_timeout);
reboot(RB_AUTOBOOT); reboot(RB_AUTOBOOT);
err: err: