211-cmd-bootmenu-custom-title.patch 993 B

123456789101112131415161718192021222324252627282930313233
  1. --- a/cmd/bootmenu.c
  2. +++ b/cmd/bootmenu.c
  3. @@ -452,7 +452,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. @@ -537,6 +541,7 @@ static enum bootmenu_ret bootmenu_show(i
  17. return BOOTMENU_RET_FAIL;
  18. }
  19. + bootmenu->mtitle = env_get("bootmenu_title");
  20. for (iter = bootmenu->first; iter; iter = iter->next) {
  21. if (menu_item_add(menu, iter->key, iter) != 1)
  22. goto cleanup;
  23. --- a/include/menu.h
  24. +++ b/include/menu.h
  25. @@ -45,6 +45,7 @@ struct bootmenu_data {
  26. int active; /* active menu entry */
  27. int count; /* total count of menu entries */
  28. struct bootmenu_entry *first; /* first menu entry */
  29. + char *mtitle; /* custom menu title */
  30. bool last_choiced;
  31. };