Concerns were raised, that skipping the boot menu, if only one device is present might make debugging issues more difficult. So, extend the current runtime configuration option `etc/show-boot-menu` by enabling this feature by setting it to 2.
Fixes: 29ee1fb8 ("Skip boot menu and timeout with only one boot device") Signed-off-by: Paul Menzel pmenzel@molgen.mpg.de --- docs/Runtime_config.md | 2 +- src/boot.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/docs/Runtime_config.md b/docs/Runtime_config.md index 6747e2a..5795382 100644 --- a/docs/Runtime_config.md +++ b/docs/Runtime_config.md @@ -173,7 +173,7 @@ There are several additional configuration options available in the
| Filename | Description |---------------------|--------------------------------------------------- -| show-boot-menu | Controls the display of the boot menu. Set to 0 to disable the boot menu. +| show-boot-menu | Controls the display of the boot menu. Valid values are 0: Disable the boot menu, 1: Display boot menu unconditionally, 2: Skip boot menu if only one device is present. The default is 1. | boot-menu-message | Customize the text boot menu message. Normally, when in text mode SeaBIOS will report the string "\nPress ESC for boot menu.\n\n". This field allows the string to be changed. (This is a string field, and is added as a file containing the raw string.) | boot-menu-key | Controls which key activates the boot menu. The value stored is the DOS scan code (eg, 0x86 for F12, 0x01 for Esc). If this field is set, be sure to also customize the **boot-menu-message** field above. | boot-menu-wait | Amount of time (in milliseconds) to wait at the boot menu prompt before selecting the default boot. diff --git a/src/boot.c b/src/boot.c index 4f12988..595cd77 100644 --- a/src/boot.c +++ b/src/boot.c @@ -666,12 +666,13 @@ void interactive_bootmenu(void) { // XXX - show available drives? + u64 show_boot_menu = romfile_loadint("etc/show-boot-menu", 1);
- if (! CONFIG_BOOTMENU || !romfile_loadint("etc/show-boot-menu", 1)) + if (! CONFIG_BOOTMENU || show_boot_menu != 0) return;
// skip menu if only one boot device and no TPM - if ((NULL == BootList.first->next) && !tpm_can_show_menu()) { + if ((show_boot_menu == 2) && (NULL == BootList.first->next) && !tpm_can_show_menu()) { printf("\n"); return; }
Signed-off-by: Paul Menzel pmenzel@molgen.mpg.de --- src/boot.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/src/boot.c b/src/boot.c index 595cd77..8b33070 100644 --- a/src/boot.c +++ b/src/boot.c @@ -673,6 +673,7 @@ interactive_bootmenu(void)
// skip menu if only one boot device and no TPM if ((show_boot_menu == 2) && (NULL == BootList.first->next) && !tpm_can_show_menu()) { + dprint("Only one boot device present. Skip boot menu.\n"); printf("\n"); return; }
On Wed, Apr 22, 2020 at 09:19:37PM +0200, Paul Menzel wrote:
Signed-off-by: Paul Menzel pmenzel@molgen.mpg.de
src/boot.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/src/boot.c b/src/boot.c index 595cd77..8b33070 100644 --- a/src/boot.c +++ b/src/boot.c @@ -673,6 +673,7 @@ interactive_bootmenu(void)
// skip menu if only one boot device and no TPM if ((show_boot_menu == 2) && (NULL == BootList.first->next) && !tpm_can_show_menu()) {
dprint("Only one boot device present. Skip boot menu.\n"); printf("\n");
In file included from out/ccode32flat.o.tmp.c:50: ./src/boot.c: In function 'interactive_bootmenu': ./src/boot.c:695:8: warning: implicit declaration of function 'dprint'; did you mean 'dprintf'? [-Wimplicit-function-declaration] 695 | dprint("Only one boot device present. Skip boot menu.\n"); | ^~~~~~ | dprintf
-Kevin
If SeaBIOS only detects one device, it makes no difference if the boot menu is shown and the user only can select that found device, or the system booting into that by default.
The only difference is, the user could power off the system during the time the boot menu is shown. But, without changing the configuration, the current state can’t be altered.
So, default to skipping the menu, if only one device is found, as that is what benefits the most users.
Signed-off-by: Paul Menzel pmenzel@molgen.mpg.de --- docs/Runtime_config.md | 2 +- src/boot.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/Runtime_config.md b/docs/Runtime_config.md index 5795382..99ed8b2 100644 --- a/docs/Runtime_config.md +++ b/docs/Runtime_config.md @@ -173,7 +173,7 @@ There are several additional configuration options available in the
| Filename | Description |---------------------|--------------------------------------------------- -| show-boot-menu | Controls the display of the boot menu. Valid values are 0: Disable the boot menu, 1: Display boot menu unconditionally, 2: Skip boot menu if only one device is present. The default is 1. +| show-boot-menu | Controls the display of the boot menu. Valid values are 0: Disable the boot menu, 1: Display boot menu unconditionally, 2: Skip boot menu if only one device is present. The default is 2. | boot-menu-message | Customize the text boot menu message. Normally, when in text mode SeaBIOS will report the string "\nPress ESC for boot menu.\n\n". This field allows the string to be changed. (This is a string field, and is added as a file containing the raw string.) | boot-menu-key | Controls which key activates the boot menu. The value stored is the DOS scan code (eg, 0x86 for F12, 0x01 for Esc). If this field is set, be sure to also customize the **boot-menu-message** field above. | boot-menu-wait | Amount of time (in milliseconds) to wait at the boot menu prompt before selecting the default boot. diff --git a/src/boot.c b/src/boot.c index 8b33070..a9c7730 100644 --- a/src/boot.c +++ b/src/boot.c @@ -666,7 +666,7 @@ void interactive_bootmenu(void) { // XXX - show available drives? - u64 show_boot_menu = romfile_loadint("etc/show-boot-menu", 1); + u64 show_boot_menu = romfile_loadint("etc/show-boot-menu", 2);
if (! CONFIG_BOOTMENU || show_boot_menu != 0) return;
On Wed, Apr 22, 2020 at 09:19:36PM +0200, Paul Menzel wrote:
Concerns were raised, that skipping the boot menu, if only one device is present might make debugging issues more difficult. So, extend the current runtime configuration option `etc/show-boot-menu` by enabling this feature by setting it to 2.
Fixes: 29ee1fb8 ("Skip boot menu and timeout with only one boot device") Signed-off-by: Paul Menzel pmenzel@molgen.mpg.de
Thanks. Patches 1 and 2 look good to me. FWIW, I don't agree with patch 3. When bringup up a board for the first time I think it is helpful to get the menu unconditionally - it lets the user know SeaBIOS, at least, is working.
Cheers, -Kevin