Hi,

is it possible to fully remove the boot menu? I know that it's possible to basically skip it by setting timeout=0 in boot.cfg but i'd rather not have a menu at all. Sadly from reading the man page it seems like there is no possibility to simply execute the boot command (from man boot.cfg(5): The format of the file is a series of lines containing keyword/value pairs separated by an equals sign). Am i missing something here or are static boot configurations just not supported? Obviously having the menu with a timeout of zero is just an aesthetic glitch with no real negative effect but the grumpy little OCD gnome in the back of my head keeps yelling that if the menu isn't used it needs to go and i'd like to shut him up 😉

  • rvp replied to this.

    nettester This do?

    printf 'banner=\nclear=1\ntimeout=0\n' > /boot.cfg

    (Obviously, save your /boot.cfg first.)

      rvp Well, as far as booting without any menu entries is concerned it does. It still displays a blank line and a message ("Press return to boot now, any other key for boot menu") though. Besides mentioning that it's going to boot in 0 seconds. It's still quite a step forward. I figure if i want to lose more text i'll probably have to patch the boot loader and given that i am already fighting unionfs a bit to fully ignore the underlying mount's read only status i guess i'll keep adding more patches for later.

      • rvp replied to this.

        nettester It still displays a blank line and a message ("Press return to boot now, any other key for boot menu") though. Besides mentioning that it's going to boot in 0 seconds.

        Try (for EFI boot--warning! not even compile-tested):

        diff -urN a/src/sys/arch/i386/stand/efiboot/boot.c b/src/sys/arch/i386/stand/efiboot/boot.c
        --- a/src/sys/arch/i386/stand/efiboot/boot.c	2023-05-18 04:05:43.936444080 +0000
        +++ b/src/sys/arch/i386/stand/efiboot/boot.c	2023-07-31 22:34:25.594092000 +0000
        @@ -335,13 +335,17 @@
         		doboottypemenu();
         	}
         
        -	printf("Press return to boot now, any other key for boot menu\n");
        +	if (bootcfg_info.timeout != 0)
        +		printf("Press return to boot now, any other key for boot menu\n");
         	for (currname = 0; currname < NUMNAMES; currname++) {
         		printf("booting %s - starting in ",
         		       sprint_bootsel(names[currname][0]));
         
        -		c = awaitkey((bootcfg_info.timeout < 0) ? 0
        -		    : bootcfg_info.timeout, 1);
        +		if (bootcfg_info.timeout != 0)
        +			c = awaitkey((bootcfg_info.timeout < 0) ? 0
        +				    : bootcfg_info.timeout, 1);
        +		else
        +			c = '\0';
         		if ((c != '\r') && (c != '\n') && (c != '\0')) {
         		    if ((boot_params.bp_flags & X86_BP_FLAGS_PASSWORD) == 0) {
         			/* do NOT ask for password */

          rvp Cool, thanks! I'll have to port this to legacy BIOS but that shouldn't be to hard and given what i am working on is really a generic image builder for embedded systems having EFI support is still pretty useful, even if my current target does not support it.

          • rvp replied to this.
            5 days later

            nettester I'll have to port this to legacy BIOS [...]

            That's here: sys/arch/i386/stand/boot/boot2.c:boot2()