From f4b19967017676699e40a3d750bc86d81f57aa3d Mon Sep 17 00:00:00 2001 From: mintsuki Date: Sun, 18 Sep 2022 11:52:31 +0200 Subject: [PATCH] menu: Avoid reinitialising fallback terminal on first runs --- common/menu.c | 8 +++++--- common/menu.h | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/common/menu.c b/common/menu.c index ceb517f8..98185d93 100644 --- a/common/menu.c +++ b/common/menu.c @@ -548,7 +548,7 @@ extern symbol s2_data_begin; extern symbol s2_data_end; #endif -noreturn void _menu(bool timeout_enabled) { +noreturn void _menu(bool first_run) { size_t data_size = (uintptr_t)data_end - (uintptr_t)data_begin; #if defined (BIOS) size_t s2_data_size = (uintptr_t)s2_data_end - (uintptr_t)s2_data_begin; @@ -575,7 +575,9 @@ noreturn void _menu(bool timeout_enabled) { #endif } - term_fallback(); + if (!first_run) { + term_fallback(); + } if (bad_config == false) { volume_iterate_parts(boot_volume, @@ -638,7 +640,7 @@ noreturn void _menu(bool timeout_enabled) { timeout = strtoui(timeout_config, NULL, 10); } - if (!timeout_enabled) { + if (!first_run) { skip_timeout = true; } diff --git a/common/menu.h b/common/menu.h index 73f8a5b5..35a3ff73 100644 --- a/common/menu.h +++ b/common/menu.h @@ -4,7 +4,7 @@ #include #include -noreturn void menu(bool timeout_enabled); +noreturn void menu(bool first_run); noreturn void boot(char *config);