06 Jun, 2018

1 commit

  • For distro-boot, the TIMEOUT directive in the boot script specifies
    how long to pause in units of 1/10 sec. [1]

    Commit 8594753ba0a7 ("menu: only timeout when menu is displayed")
    corrected this by simply dividing the timeout value by 10 in
    menu_interactive_choice().

    I see two problems:

    - For example, "TIMEOUT 5" should wait for 0.5 sec, but the current
    implementation cannot handle the granularity of 1/10 sec.
    In fact, it never breaks because "m->timeout / 10" is zero,
    which means no timeout.

    - The menu API is used not only by cmd/pxe.c but also by
    common/autoboot.c . For the latter case, the unit of the
    timeout value is _second_ because its default is associated
    with CONFIG_BOOTDELAY.

    To fix the first issue, use DIV_ROUND_UP() so that the timeout value
    is rounded up to the closest integer.

    For the second issue, move the division to the boundary between
    cmd/pxe.c and common/menu.c . This is a more desirable place because
    the comment of struct pxe_menu says:

    * timeout - time in tenths of a second to wait for a user key-press before
    * booting the default label.

    Then, the comment of menu_create() says:

    * timeout - A delay in seconds to wait for user input. If 0, timeout is
    * disabled, and the default choice will be returned unless prompt is 1.

    [1] https://www.syslinux.org/wiki/index.php?title=SYSLINUX#TIMEOUT_timeout

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

07 May, 2018

1 commit

  • When U-Boot started using SPDX tags we were among the early adopters and
    there weren't a lot of other examples to borrow from. So we picked the
    area of the file that usually had a full license text and replaced it
    with an appropriate SPDX-License-Identifier: entry. Since then, the
    Linux Kernel has adopted SPDX tags and they place it as the very first
    line in a file (except where shebangs are used, then it's second line)
    and with slightly different comment styles than us.

    In part due to community overlap, in part due to better tag visibility
    and in part for other minor reasons, switch over to that style.

    This commit changes all instances where we have a single declared
    license in the tag as both the before and after are identical in tag
    contents. There's also a few places where I found we did not have a tag
    and have introduced one.

    Signed-off-by: Tom Rini

    Tom Rini
     

27 Mar, 2016

1 commit


28 May, 2015

1 commit

  • Previously, if the menu activated by the 'sysboot' command gets
    interrupted by a Ctrl-C, the behaviour is as if the menu timeout was
    reached - i.e. boot the default menu entry. This patch fixes that
    so a Ctrl-C now terminates the command as the user would expect.

    Signed-off-by: Tuomas Tynkkynen
    Reviewed-by: Simon Glass

    Tuomas Tynkkynen
     

25 Oct, 2014

1 commit


30 May, 2014

2 commits


24 Jul, 2013

1 commit


29 Mar, 2013

2 commits


22 Jun, 2012

1 commit

  • Make the menu timeout apply only when prompt flag is set and after the
    menu is displayed. This allows auto boot to work no matter whether prompt
    is set or cleared. Use the default selection if the menu times out.

    This also fixes the timeout value given to readline_into_buffer to be
    seconds instead of 10th of seconds.

    Old behavior:

    if prompt
    display menu and wait for choice
    else
    wait for timeout
    if key pressed
    display menu and wait for choice
    else
    exit command

    New behavior:

    if prompt
    display menu
    if key pressed
    wait for choice
    else
    boot default entry on timeout
    else
    boot default entry

    Signed-off-by: Rob Herring

    Rob Herring
     

12 Feb, 2012

3 commits


06 Dec, 2011

1 commit

  • Fix:
    menu.c: In function 'menu_item_print':
    menu.c:91: warning: passing argument 1 of 'putc' makes integer from
    pointer without a cast

    Signed-off-by: Anatolij Gustschin
    Acked-by: Heiko Schocher
    Tested-by: Heiko Schocher
    Acked-by: Marek Vasut

    Anatolij Gustschin
     

29 Nov, 2011

1 commit

  • common/menu.c used printf() in a number of places to print user
    provided, constant strings (like the "title" string). printf() is
    dangerous here for example in case the user unwittingly embeds some
    '%' caracters that printf() would interpret as formatting and then
    pick up random arguments. Use puts() instead.

    We also omit the trailing ':' in the title line - if a user wants
    this, he can provide it as part of the title string.

    Signed-off-by: Wolfgang Denk

    Wolfgang Denk
     

18 Oct, 2011

2 commits