aboutsummaryrefslogtreecommitdiffstats
path: root/package/boot/uboot-mediatek/patches/211-cmd-bootmenu-custom-title.patch
blob: 72926ea2e7fefd206a6b9ecbf7de9ec11b86ad21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
--- a/cmd/bootmenu.c
+++ b/cmd/bootmenu.c
@@ -439,7 +439,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);
@@ -524,6 +528,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
@@ -43,6 +43,7 @@ struct bootmenu_data {
 	int active;			/* 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;
 };