69a3a07b901b7d05203c3f35f9b85ae81d655c11
[openwrt/staging/dedeckeh.git] / package / boot / uboot-mediatek / patches / 211-cmd-bootmenu-custom-title.patch
1 --- a/cmd/bootmenu.c
2 +++ b/cmd/bootmenu.c
3 @@ -449,7 +449,11 @@ static void menu_display_statusline(stru
4 printf(ANSI_CURSOR_POSITION, 1, 1);
5 puts(ANSI_CLEAR_LINE);
6 printf(ANSI_CURSOR_POSITION, 2, 3);
7 - puts("*** U-Boot Boot Menu ***");
8 + if (menu->mtitle)
9 + puts(menu->mtitle);
10 + else
11 + puts(" *** U-Boot Boot Menu ***");
12 +
13 puts(ANSI_CLEAR_LINE_TO_END);
14 printf(ANSI_CURSOR_POSITION, 3, 1);
15 puts(ANSI_CLEAR_LINE);
16 @@ -534,6 +538,7 @@ static enum bootmenu_ret bootmenu_show(i
17 return BOOTMENU_RET_FAIL;
18 }
19
20 + bootmenu->mtitle = env_get("bootmenu_title");
21 for (iter = bootmenu->first; iter; iter = iter->next) {
22 if (menu_item_add(menu, iter->key, iter) != 1)
23 goto cleanup;
24 --- a/include/menu.h
25 +++ b/include/menu.h
26 @@ -44,6 +44,7 @@ struct bootmenu_data {
27 int active; /* active menu entry */
28 int count; /* total count of menu entries */
29 struct bootmenu_entry *first; /* first menu entry */
30 + char *mtitle; /* custom menu title */
31 bool last_choiced;
32 };
33