menu: Avoid reinitialising fallback terminal on first runs

This commit is contained in:
mintsuki 2022-09-18 11:52:31 +02:00
parent 26f6ac3bb2
commit 59bbd1f657
2 changed files with 6 additions and 4 deletions

View File

@ -548,7 +548,7 @@ extern symbol s2_data_begin;
extern symbol s2_data_end; extern symbol s2_data_end;
#endif #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; size_t data_size = (uintptr_t)data_end - (uintptr_t)data_begin;
#if defined (BIOS) #if defined (BIOS)
size_t s2_data_size = (uintptr_t)s2_data_end - (uintptr_t)s2_data_begin; 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 #endif
} }
term_fallback(); if (!first_run) {
term_fallback();
}
if (bad_config == false) { if (bad_config == false) {
volume_iterate_parts(boot_volume, volume_iterate_parts(boot_volume,
@ -641,7 +643,7 @@ noreturn void _menu(bool timeout_enabled) {
timeout = strtoui(timeout_config, NULL, 10); timeout = strtoui(timeout_config, NULL, 10);
} }
if (!timeout_enabled) { if (!first_run) {
skip_timeout = true; skip_timeout = true;
} }

View File

@ -4,7 +4,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdnoreturn.h> #include <stdnoreturn.h>
noreturn void menu(bool timeout_enabled); noreturn void menu(bool first_run);
noreturn void boot(char *config); noreturn void boot(char *config);