diff options
author | Michael Brown <mcb30@ipxe.org> | 2025-02-19 13:12:29 +0000 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2025-02-19 13:12:29 +0000 |
commit | e7595fe88d8c32354cd61055cbc9f2e7b3f91ff8 (patch) | |
tree | 20e060dafdbeb99cd97eb4c7aaf0a5a11e78eb8a /src/hci/commands/dynui_cmd.c | |
parent | ccd62005490de907105c92444631a5914500cb32 (diff) | |
download | ipxe-e7595fe88d8c32354cd61055cbc9f2e7b3f91ff8.tar.gz |
[menu] Allow a post-activity timeout to be definedHEADmastercoverity_scan
Allow the "--retimeout" option to be used to specify a timeout value
that will be (re)applied after each keypress activity. This allows
script authors to ensure that a single (potentially accidental)
keypress will not pause the boot process indefinitely.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/hci/commands/dynui_cmd.c')
-rw-r--r-- | src/hci/commands/dynui_cmd.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/hci/commands/dynui_cmd.c b/src/hci/commands/dynui_cmd.c index d4446dc7c..6cad63868 100644 --- a/src/hci/commands/dynui_cmd.c +++ b/src/hci/commands/dynui_cmd.c @@ -207,8 +207,10 @@ static int item_exec ( int argc, char **argv ) { struct choose_options { /** Dynamic user interface name */ char *dynui; - /** Timeout */ + /** Initial timeout */ unsigned long timeout; + /** Post-activity timeout */ + unsigned long retimeout; /** Default selection */ char *select; /** Keep dynamic user interface */ @@ -223,6 +225,8 @@ static struct option_descriptor choose_opts[] = { struct choose_options, select, parse_string ), OPTION_DESC ( "timeout", 't', required_argument, struct choose_options, timeout, parse_timeout ), + OPTION_DESC ( "retimeout", 'r', required_argument, + struct choose_options, retimeout, parse_timeout ), OPTION_DESC ( "keep", 'k', no_argument, struct choose_options, keep, parse_flag ), }; @@ -259,8 +263,8 @@ static int choose_exec ( int argc, char **argv ) { goto err_parse_dynui; /* Show as menu */ - if ( ( rc = show_menu ( dynui, opts.timeout, opts.select, - &item ) ) != 0 ) + if ( ( rc = show_menu ( dynui, opts.timeout, opts.retimeout, + opts.select, &item ) ) != 0 ) goto err_show_menu; /* Apply default type if necessary */ |