1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-11-03 11:59:33 +01:00

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>
This commit is contained in:
Thirupathaiah Annapureddy
2020-03-18 11:38:42 -07:00
committed by Tom Rini
parent fdf0819afb
commit 5168d7a626
4 changed files with 41 additions and 37 deletions

View File

@@ -1237,7 +1237,7 @@ static struct menu *pxe_menu_to_menu(struct pxe_menu *cfg)
* Create a menu and add items for all the labels.
*/
m = menu_create(cfg->title, DIV_ROUND_UP(cfg->timeout, 10),
cfg->prompt, label_print, NULL, NULL);
cfg->prompt, NULL, label_print, NULL, NULL);
if (!m)
return NULL;