Commit Graph

11 Commits

Author SHA1 Message Date
Thirupathaiah Annapureddy 5168d7a626 menu: add support for client defined statusline function
Currently displaying status line is done in a weak function
menu_display_statusline().

bootmenu.c overrides the weak default function.
It calls menu_default_choice() and interprets the data as
struct bootmenu_entry.

pxe boot also uses common menu code for pxe menus.
If there is a system that enables both bootmenu and pxe,
menu_display_statusline() defined in bootmenu.c will be called
and it will interpret struct pxe_label as struct bootmenu_entry.
This leads to data aborts and pxe menu corruptions.

This patch adds support for client defined statusline function
to resolve the above bug.

Signed-off-by: Thirupathaiah Annapureddy <thiruan@linux.microsoft.com>
2020-05-07 09:01:42 -04:00
Simon Glass 14b9df1b48 autoboot: Add comments for menu_show()
Add comments for this function. Also remove the #ifdef around it so that
it can be called from 'if (IS_ENABLED(...))'.

Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-02 11:19:14 -04:00
Simon Glass e231306e48 autoboot: Rename CONFIG_MENU_SHOW to include AUTOBOOT
Rename this option to CONFIG_AUTOBOOT_MENU_SHOW this it relates to the
autoboot functionality.

Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-02 11:19:14 -04:00
Tom Rini 83d290c56f SPDX: Convert all of our single license tags to Linux Kernel style
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 <trini@konsulko.com>
2018-05-07 09:34:12 -04:00
Wolfgang Denk 1a4596601f Add GPL-2.0+ SPDX-License-Identifier to source files
Signed-off-by: Wolfgang Denk <wd@denx.de>
[trini: Fixup common/cmd_io.c]
Signed-off-by: Tom Rini <trini@ti.com>
2013-07-24 09:44:38 -04:00
Anatolij Gustschin 6a3439fdad menu: export menu_default_choice() function
Checking the default menu item and obtaining its data can
be useful in custom menu code. Export menu_default_choice()
function which serves this purpose.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
2013-03-29 09:35:34 +01:00
Pali Rohár fc9d64ffcd menu: Add support for user defined item choice function
Selecting menu items is currently done in menu_interactive_choice()
by reading the user input strings from standard input.

Extend menu_interactive_choice() to support user defined function
for selecting menu items. This function and its argument can be
specified when creating the menu.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
2013-03-29 09:35:33 +01:00
Heiko Schocher 317d6c57d5 common, menu: show menu on startup if CONFIG_MENU_SHOW is defined
show a menu on startup instead running the shell.

Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Jason Hobbs <jason.hobbs@calxeda.com>
Cc: Mike Frysinger <vapier@gentoo.org>
Acked-by: Jason Hobbs <jason.hobbs@calxeda.com>
2012-02-12 10:11:24 +01:00
Heiko Schocher e0611dd97b common, menu: add statusline support
add the possibility to show a statusline when printing a menu

Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Jason Hobbs <jason.hobbs@calxeda.com>
Cc: Mike Frysinger <vapier@gentoo.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2012-02-12 10:11:24 +01:00
Jason Hobbs b41bc5a82d common, menu: use abortboot for menu timeout
Signed-off-by: Jason Hobbs <jason.hobbs@calxeda.com>
2011-10-17 22:25:33 +02:00
Jason Hobbs b69bf52dfe Add generic, reusable menu code
This will be used first by the pxe code, but is intended to be
generic and reusable for other jobs in U-boot.

Signed-off-by: Jason Hobbs <jason.hobbs@calxeda.com>
2011-10-17 22:25:33 +02:00