From: Kevin O'Connor Date: Mon, 25 May 2020 01:57:19 +0000 (-0400) Subject: boot: Fixup check for only one item in boot list X-Git-Tag: rel-1.14.0~9 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=d9aea4a7cd59e00f5ed96b6442806dde0959e1ca;p=seabios.git boot: Fixup check for only one item in boot list Signed-off-by: Kevin O'Connor --- diff --git a/src/boot.c b/src/boot.c index 1f7fce1..a715e37 100644 --- a/src/boot.c +++ b/src/boot.c @@ -684,17 +684,18 @@ static const char menuchars[] = { void interactive_bootmenu(void) { - // XXX - show available drives? - u64 show_boot_menu = romfile_loadint("etc/show-boot-menu", 1); - - if (! CONFIG_BOOTMENU || show_boot_menu == 0) + if (! CONFIG_BOOTMENU) + return; + int show_boot_menu = romfile_loadint("etc/show-boot-menu", 1); + if (!show_boot_menu) return; // skip menu if only one boot device and no TPM - if ((show_boot_menu == 2) && (NULL == BootList.first->next) && !tpm_can_show_menu()) { - dprintf(1, "Only one boot device present. Skip boot menu.\n"); - printf("\n"); - return; + if (show_boot_menu == 2 && !tpm_can_show_menu() + && !hlist_empty(&BootList) && !BootList.first->next) { + dprintf(1, "Only one boot device present. Skip boot menu.\n"); + printf("\n"); + return; } while (get_keystroke(0) >= 0)