There's no point in presenting a menu to the user if there's only one option to choose from. In that case skip this menu to save some waiting time during boot.
Signed-off-by: Sven Schnelle svens@stackframe.org --- src/boot.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/boot.c b/src/boot.c index 1cd4126..df26d33 100644 --- a/src/boot.c +++ b/src/boot.c @@ -360,6 +360,11 @@ interactive_bootmenu(void) if (! CONFIG_BOOTMENU || ! qemu_cfg_show_boot_menu()) return;
+ /* If we have only one bootdevice, + skip interactive menu */ + if (!BootList->next) + return; + while (get_keystroke(0) >= 0) ;
Sven Schnelle wrote:
There's no point in presenting a menu to the user if there's only one option to choose from. In that case skip this menu to save some waiting time during boot.
The case if there's only one option to choose from might be an error (e.g. device not detected, misconfiguration). Just skipping the menu doesn't sound like the correct choice.
Sebastian
Hi Sebastian,
"Sebastian Herbszt" herbszt@gmx.de writes:
Sven Schnelle wrote:
There's no point in presenting a menu to the user if there's only one option to choose from. In that case skip this menu to save some waiting time during boot.
The case if there's only one option to choose from might be an error (e.g. device not detected, misconfiguration). Just skipping the menu doesn't sound like the correct choice.
How does the boot menu help you in that case?
Sven.
On Sat, Apr 30, 2011 at 03:33:59PM +0200, Sven Schnelle wrote:
Hi Sebastian,
"Sebastian Herbszt" herbszt@gmx.de writes:
Sven Schnelle wrote:
There's no point in presenting a menu to the user if there's only one option to choose from. In that case skip this menu to save some waiting time during boot.
The case if there's only one option to choose from might be an error (e.g. device not detected, misconfiguration). Just skipping the menu doesn't sound like the correct choice.
How does the boot menu help you in that case?
It doesn't help you, but it at least lets you confirm the problem. Also, not showing the F12 prompt probably kills off the splash screen.
Jonathan Kollasch
On Sat, Apr 30, 2011 at 10:19:25AM +0200, Sven Schnelle wrote:
There's no point in presenting a menu to the user if there's only one option to choose from. In that case skip this menu to save some waiting time during boot.
[...]
- /* If we have only one bootdevice,
skip interactive menu */
- if (!BootList->next)
return;
BootList can be NULL here, so this isn't correct.
In any case, I don't think making a special case for bootlist==1 is a good idea.
What's the reason you would not like to show the boot menu? Can you obtain the same by disabling CONFIG_BOOTMENU?
-Kevin
Kevin O'Connor kevin@koconnor.net writes:
On Sat, Apr 30, 2011 at 10:19:25AM +0200, Sven Schnelle wrote:
There's no point in presenting a menu to the user if there's only one option to choose from. In that case skip this menu to save some waiting time during boot.
[...]
- /* If we have only one bootdevice,
skip interactive menu */
- if (!BootList->next)
return;
BootList can be NULL here, so this isn't correct.
Ok, that should be easily fixable. It's of course wrong when there's no boot device at all ;)
In any case, I don't think making a special case for bootlist==1 is a good idea.
What's the reason you would not like to show the boot menu? Can you obtain the same by disabling CONFIG_BOOTMENU?
The only reason why i want to have this feature is because my Thinkpad spents the boot wait delay (default 2.5s) waiting for the user to press the F12 key, even though there's only one Boot device.
But if i insert a USB device, i want to have the menu - that's the reason why i've added this.