summaryrefslogtreecommitdiffstats
path: root/ui/ncurses
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2014-04-22 10:41:59 +0800
committerJeremy Kerr <jk@ozlabs.org>2014-04-22 10:44:09 +0800
commit85421290c797c59320bf1e9f076f46195115ab92 (patch)
treee911c0bcc99961fbc5decd52d5a0588691613e22 /ui/ncurses
parentb6ee414890fcd582a96f4d89e648cff5dacb1cb9 (diff)
downloadtalos-petitboot-85421290c797c59320bf1e9f076f46195115ab92.tar.gz
talos-petitboot-85421290c797c59320bf1e9f076f46195115ab92.zip
ui/ncurses: only cancel default boot on valid key events
We're seeing occasionaly failures to autoboot due to supirious key events (getch() returing -1) on an IPMI console. This change modifies the process_key logic to only abort the default if we see a valid key event. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'ui/ncurses')
-rw-r--r--ui/ncurses/nc-cui.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/ui/ncurses/nc-cui.c b/ui/ncurses/nc-cui.c
index 5f56409..7200a81 100644
--- a/ui/ncurses/nc-cui.c
+++ b/ui/ncurses/nc-cui.c
@@ -327,10 +327,6 @@ static int cui_process_key(void *arg)
assert(cui->current);
- if (!cui->has_input)
- discover_client_cancel_default(cui->client);
- cui->has_input = true;
-
for (;;) {
int c = getch();
@@ -339,6 +335,13 @@ static int cui_process_key(void *arg)
if (c == ERR)
break;
+ if (!cui->has_input) {
+ pb_log("UI input received (key = %d), aborting "
+ "default boot\n", c);
+ discover_client_cancel_default(cui->client);
+ cui->has_input = true;
+ }
+
if (process_global_keys(cui, c))
continue;
OpenPOWER on IntegriCloud