summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/startup.c5
-rw-r--r--include/common.h1
2 files changed, 5 insertions, 1 deletions
diff --git a/common/startup.c b/common/startup.c
index 7e0f7d6b64..71a28a7be8 100644
--- a/common/startup.c
+++ b/common/startup.c
@@ -235,7 +235,7 @@ void set_autoboot_state(enum autoboot_state autoboot)
*/
enum autoboot_state do_autoboot_countdown(void)
{
- enum autoboot_state autoboot_state;
+ static enum autoboot_state autoboot_state = AUTOBOOT_UNKNOWN;
unsigned flags = CONSOLE_COUNTDOWN_EXTERN;
int ret;
struct stat s;
@@ -243,6 +243,9 @@ enum autoboot_state do_autoboot_countdown(void)
char *abortkeys = NULL;
unsigned char outkey;
+ if (autoboot_state != AUTOBOOT_UNKNOWN)
+ return autoboot_state;
+
if (global_autoboot_state != AUTOBOOT_COUNTDOWN)
return global_autoboot_state;
diff --git a/include/common.h b/include/common.h
index ce16ff83af..ceb0b358bd 100644
--- a/include/common.h
+++ b/include/common.h
@@ -88,6 +88,7 @@ enum autoboot_state {
AUTOBOOT_ABORT,
AUTOBOOT_MENU,
AUTOBOOT_BOOT,
+ AUTOBOOT_UNKNOWN,
};
void set_autoboot_state(enum autoboot_state autoboot);