[U-Boot] [PATCH] menu: don't bother going interactive with just one menu item

Leon Yu leoyu at nvidia.com
Fri Jul 19 10:59:02 UTC 2019


On Wed, Jul 17, 2019 at 11:58:12AM -0400, Tom Rini wrote:
> On Fri, Jun 21, 2019 at 12:12:39PM +0800, Leon Yu wrote:
> 
> > If there is only one menu item available, prompting user to enter
> > choice makes little sense and just causes unnecessary boot delay. This
> > change makes menu_get_choice return the only one item when there is no
> > other choices.
> 
> As you note in a follow up to Frank's comment this is a behavior change
> that can make it harder to get into U-Boot console in some cases.  Can
> you please expand a bit more on the case where we are using a menu and
> waiting the defined number of seconds is a problem (and not addressed
> well enough by changing the timeout, which is configurable, yes?) ?
> Thanks!
> 
> -- 
> Tom

Hi Tom,

Minimal non-zero timeout is one second, which is a bit too short for
users to read and/or select but also too long for boot time critical
applications. We all know how difficult it can be to save one more
second boot time in bootloaders.

As for Frank's earlier comment, his concerns is about unable to enter
console because 'U-Boot console' isn't a real menuitem in bootmenu.
That's not true. 'U-Boot console' is just automatically populated,
rather than from envrironment variables. It's still listed as an item
in boot menu. So with the proposed patch, situations are:

a) If no bootmenu_$ env. variable is present, 'U-Boot console' is the
only item and will be chosen immediately. So console _will_ be
entered as a result.

b) At least one bootmenu_$ env. variable exists, behavior remains the
same.

Yes, behavior is changed but just becomes quicker. Its result will
remain the same. People can have luxurious time to select from
multiple choices and will be fast-forwarded to the only one option
which they have to select anyway.

People might wonder why using a menu for boot time critical applications
-- this patch is to save time for pxe boot with one default option
while still can have sufficient timeout for multiple choices.

What do you think, Tom? Please let me know if I'm missing something,
thanks!

Leon

-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------


More information about the U-Boot mailing list