summaryrefslogtreecommitdiffstats
path: root/commands/timeout.c
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2017-03-10 07:05:22 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2017-03-10 08:43:27 +0100
commite3dda8553eea825e11df4aef80407c66eb2c0df8 (patch)
tree964e3909df76fbf76802e09124740362fcd7d58d /commands/timeout.c
parent3d92ea473884cddad18ab6f0554492f4468bc25f (diff)
downloadbarebox-e3dda8553eea825e11df4aef80407c66eb2c0df8.tar.gz
console_countdown: add possibility to abort countdown by external commands
This patch makes it possible to abort a console countdown by an external command, for example when fastboot is used. This requires additional modifications in the external commands, a call to "console_countdown_abort()" has to be inserted. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands/timeout.c')
-rw-r--r--commands/timeout.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/commands/timeout.c b/commands/timeout.c
index ef1a037..d197ced 100644
--- a/commands/timeout.c
+++ b/commands/timeout.c
@@ -32,7 +32,7 @@ static int do_timeout(int argc, char *argv[])
char str[2] = { };
const char *varname = NULL;
- while((opt = getopt(argc, argv, "crsav:")) > 0) {
+ while ((opt = getopt(argc, argv, "crsav:e")) > 0) {
switch(opt) {
case 'r':
flags |= CONSOLE_COUNTDOWN_RETURN;
@@ -46,6 +46,9 @@ static int do_timeout(int argc, char *argv[])
case 's':
flags |= CONSOLE_COUNTDOWN_SILENT;
break;
+ case 'e':
+ flags |= CONSOLE_COUNTDOWN_EXTERN;
+ break;
case 'v':
varname = optarg;
break;
@@ -73,6 +76,7 @@ BAREBOX_CMD_HELP_TEXT("Options:")
BAREBOX_CMD_HELP_OPT("-a", "interrupt on any key")
BAREBOX_CMD_HELP_OPT("-c", "interrupt on Ctrl-C")
BAREBOX_CMD_HELP_OPT("-r", "interrupt on RETURN")
+BAREBOX_CMD_HELP_OPT("-e", "interrupt on external commands (i.e. fastboot")
BAREBOX_CMD_HELP_OPT("-s", "silent mode")
BAREBOX_CMD_HELP_OPT("-v <VARIABLE>", "export pressed key to environment")
BAREBOX_CMD_HELP_END
@@ -80,7 +84,7 @@ BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(timeout)
.cmd = do_timeout,
BAREBOX_CMD_DESC("wait for a specified timeout")
- BAREBOX_CMD_OPTS("[-acrsv] SECONDS")
+ BAREBOX_CMD_OPTS("[-acrsev] SECONDS")
BAREBOX_CMD_GROUP(CMD_GRP_CONSOLE)
BAREBOX_CMD_HELP(cmd_timeout_help)
BAREBOX_CMD_END