Date: Mon, 23 Jun 2014 22:24:23 +0200
Signed-off-by: Paul Menzel paulepanter@users.sourceforge.net --- src/boot.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/src/boot.c b/src/boot.c index 5837ad0..ed8f5e2 100644 --- a/src/boot.c +++ b/src/boot.c @@ -486,6 +486,10 @@ interactive_bootmenu(void) , strtcpy(desc, pos->description, ARRAY_SIZE(desc))); }
+ if (maxmenu < 2) + printf("Autoselect only entry.\n") + return; + // Get key press for (;;) { scan_code = get_keystroke(1000);
Here's how I did it - this will skip the 'Press XXX for boot menu.' as well, so that there is no delay in booting, and no confusion on the user's part as to why the boot menu key isn't working :)
requires the file /etc/boot-auto to exist in the CBFS.
diff --git a/src/boot.c b/src/boot.c index 133e206..bb5fd1f 100644 --- a/src/boot.c +++ b/src/boot.c @@ -455,6 +455,12 @@ interactive_bootmenu(void) if (! CONFIG_BOOTMENU || !romfile_loadint("etc/show-boot-menu", 1)) return;
+ //skip menu if only one boot device + if ( NULL == BootList.first->next && romfile_loadint("etc/boot-auto", 0) ) { + printf("\n"); + return; + } + while (get_keystroke(0) >= 0) ;
Dear Matt,
Am Dienstag, den 24.06.2014, 11:48 -0500 schrieb Matt DeVillier:
Here's how I did it - this will skip the 'Press XXX for boot menu.' as well, so that there is no delay in booting, and no confusion on the user's part as to why the boot menu key isn't working :)
yes, much better than my patch! Thanks!
Could you please send the patch formatted with `git format-patch -s` so your Signed-off-by line is added too?
requires the file /etc/boot-auto to exist in the CBFS.
diff --git a/src/boot.c b/src/boot.c index 133e206..bb5fd1f 100644 --- a/src/boot.c +++ b/src/boot.c @@ -455,6 +455,12 @@ interactive_bootmenu(void) if (! CONFIG_BOOTMENU || !romfile_loadint("etc/show-boot-menu", 1)) return;
- //skip menu if only one boot device
- if ( NULL == BootList.first->next && romfile_loadint("etc/boot-auto", 0) ) {
The logic seems to be reversed. The file content should be `1`, shouldn’t it?
… && romfile_loadint("etc/boot-auto", 1)
printf("\n");
return;
- }
- while (get_keystroke(0) >= 0) ;
Also I wonder how I could achieve this without having to put that into CBFS? I’d make that the default with
!romfile_loadint("etc/boot-auto", 0)
or also add a Kconfig option `AUTO_BOOT` as is done for the boot menu.
Thanks,
Paul
Hey Paul,
On 6/24/2014 3:48 PM, Paul Menzel wrote:
Dear Matt,
Am Dienstag, den 24.06.2014, 11:48 -0500 schrieb Matt DeVillier:
Here's how I did it - this will skip the 'Press XXX for boot menu.' as well, so that there is no delay in booting, and no confusion on the user's part as to why the boot menu key isn't working :)
yes, much better than my patch! Thanks!
Could you please send the patch formatted with `git format-patch -s` so your Signed-off-by line is added too?
can do
requires the file /etc/boot-auto to exist in the CBFS.
diff --git a/src/boot.c b/src/boot.c index 133e206..bb5fd1f 100644 --- a/src/boot.c +++ b/src/boot.c @@ -455,6 +455,12 @@ interactive_bootmenu(void) if (! CONFIG_BOOTMENU || !romfile_loadint("etc/show-boot-menu", 1)) return;
- //skip menu if only one boot device
- if ( NULL == BootList.first->next && romfile_loadint("etc/boot-auto", 0) ) {
The logic seems to be reversed. The file content should be `1`, shouldn’t it?
… && romfile_loadint("etc/boot-auto", 1)
no, the 0 is the default value if the file cannot be loaded. So logically, fail if file doesn't exist.
printf("\n");
return;
- }
- while (get_keystroke(0) >= 0) ;
Also I wonder how I could achieve this without having to put that into CBFS? I’d make that the default with
!romfile_loadint("etc/boot-auto", 0)
or also add a Kconfig option `AUTO_BOOT` as is done for the boot menu.
I think a Kconfig option would probably be better, but I'm not set on any one solution. The CBFS file was Kevin's suggestion/addition, I'm running it as the default here without any override.
Thanks,
Paul
cheers, Matt
SeaBIOS mailing list SeaBIOS@seabios.org http://www.seabios.org/mailman/listinfo/seabios
On Tue, Jun 24, 2014 at 11:48:21AM -0500, Matt DeVillier wrote:
Here's how I did it - this will skip the 'Press XXX for boot menu.' as well, so that there is no delay in booting, and no confusion on the user's part as to why the boot menu key isn't working :)
requires the file /etc/boot-auto to exist in the CBFS.
diff --git a/src/boot.c b/src/boot.c index 133e206..bb5fd1f 100644 --- a/src/boot.c +++ b/src/boot.c @@ -455,6 +455,12 @@ interactive_bootmenu(void) if (! CONFIG_BOOTMENU || !romfile_loadint("etc/show-boot-menu", 1)) return;
- //skip menu if only one boot device
- if ( NULL == BootList.first->next && romfile_loadint("etc/boot-auto", 0) ) {
The above would access invalid memory if there were no bootable devices - it should be something like:
if ((!BootList.first || !BootList.first->next) && romfile_loadint("etc/boot-auto", 0)) return;
printf("\n");
Why the printf?
-Kevin
On 6/24/2014 8:20 PM, Kevin O'Connor wrote:
On Tue, Jun 24, 2014 at 11:48:21AM -0500, Matt DeVillier wrote:
Here's how I did it - this will skip the 'Press XXX for boot menu.' as well, so that there is no delay in booting, and no confusion on the user's part as to why the boot menu key isn't working :)
requires the file /etc/boot-auto to exist in the CBFS.
diff --git a/src/boot.c b/src/boot.c index 133e206..bb5fd1f 100644 --- a/src/boot.c +++ b/src/boot.c @@ -455,6 +455,12 @@ interactive_bootmenu(void) if (! CONFIG_BOOTMENU || !romfile_loadint("etc/show-boot-menu", 1)) return;
- //skip menu if only one boot device
- if ( NULL == BootList.first->next && romfile_loadint("etc/boot-auto", 0) ) {
The above would access invalid memory if there were no bootable devices - it should be something like:
if ((!BootList.first || !BootList.first->next) && romfile_loadint("etc/boot-auto", 0)) return;
fair enough
printf("\n");
Why the printf?
-Kevin
Aesthetics: provides a blank line in between the SeaBIOS version string and the "Booting from Hard Disk" (eg) message, the same way there is a blank line before the "booting" text following the boot menu prompt or boot menu selection.