0
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2024-11-25 06:26:15 +00:00
openwrt/package/boot/uboot-mediatek/patches/211-cmd-bootmenu-custom-title.patch
Daniel Golle 5745b7e815 uboot-mediatek: import patches improving menu navigation
Using the arrow keys to navigate the U-Boot menu often leads to being
dropped into the U-Boot shell unexpectedly.
This can be prevented in most cases by improving the logic to detect the
arrow key ESC sequence and only reprinting the menu if actually needed.
Also enable CONFIG_SERIAL_RX_BUFFER for all boards as it helps preventing
the remaining cases.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-11-02 22:28:39 +00:00

34 lines
1002 B
Diff

--- a/cmd/bootmenu.c
+++ b/cmd/bootmenu.c
@@ -465,7 +465,11 @@ static void menu_display_statusline(stru
printf(ANSI_CURSOR_POSITION, 1, 1);
puts(ANSI_CLEAR_LINE);
printf(ANSI_CURSOR_POSITION, 2, 3);
- puts("*** U-Boot Boot Menu ***");
+ if (menu->mtitle)
+ puts(menu->mtitle);
+ else
+ puts(" *** U-Boot Boot Menu ***");
+
puts(ANSI_CLEAR_LINE_TO_END);
printf(ANSI_CURSOR_POSITION, 3, 1);
puts(ANSI_CLEAR_LINE);
@@ -550,6 +554,7 @@ static enum bootmenu_ret bootmenu_show(i
return BOOTMENU_RET_FAIL;
}
+ bootmenu->mtitle = env_get("bootmenu_title");
for (iter = bootmenu->first; iter; iter = iter->next) {
if (menu_item_add(menu, iter->key, iter) != 1)
goto cleanup;
--- a/include/menu.h
+++ b/include/menu.h
@@ -47,6 +47,7 @@ struct bootmenu_data {
int last_active; /* last active menu entry */
int count; /* total count of menu entries */
struct bootmenu_entry *first; /* first menu entry */
+ char *mtitle; /* custom menu title */
bool last_choiced;
};