0002-gfxboot-menu-label.patch 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. From: Colin Watson <cjwatson@ubuntu.com>
  2. Date: Wed, 2 Nov 2011 07:57:23 +0100
  3. Subject: Allow boot entry to start with label instead of menu_label.
  4. menu_ptr->menu_label is human-readable (perhaps even translatable!) text if
  5. the MENU LABEL command is used, which isn't very convenient at the start of
  6. a boot entry. Allow the entry to start with menu_ptr->label (an
  7. identifier) as an alternative.
  8. ---
  9. com32/gfxboot/gfxboot.c | 16 ++++++++++------
  10. 1 file changed, 10 insertions(+), 6 deletions(-)
  11. diff --git a/com32/gfxboot/gfxboot.c b/com32/gfxboot/gfxboot.c
  12. index f67132c..4c76a35 100644
  13. --- a/com32/gfxboot/gfxboot.c
  14. +++ b/com32/gfxboot/gfxboot.c
  15. @@ -818,7 +818,7 @@ void boot(int index)
  16. {
  17. char *arg, *alt_kernel;
  18. menu_t *menu_ptr;
  19. - int i, label_len;
  20. + int i, label_len, menu_label_len;
  21. unsigned ipapp;
  22. const struct syslinux_ipappend_strings *ipappend;
  23. char *gfxboot_cwd = (char *) gfx_config.gfxboot_cwd;
  24. @@ -836,18 +836,22 @@ void boot(int index)
  25. if(!menu_ptr || !menu_ptr->menu_label) return;
  26. arg = skipspace(cmdline);
  27. - label_len = strlen(menu_ptr->menu_label);
  28. + label_len = strlen(menu_ptr->label);
  29. + menu_label_len = strlen(menu_ptr->menu_label);
  30. // if it does not start with label string, assume first word is kernel name
  31. - if(strncmp(arg, menu_ptr->menu_label, label_len)) {
  32. + if(!strncmp(arg, menu_ptr->label, label_len)) {
  33. + arg += label_len;
  34. + }
  35. + else if(!strncmp(arg, menu_ptr->menu_label, menu_label_len)) {
  36. + arg += menu_label_len;
  37. + }
  38. + else {
  39. alt_kernel = arg;
  40. arg = skip_nonspaces(arg);
  41. if(*arg) *arg++ = 0;
  42. if(*alt_kernel) menu_ptr->alt_kernel = alt_kernel;
  43. }
  44. - else {
  45. - arg += label_len;
  46. - }
  47. arg = skipspace(arg);