[syslinux] Fix: menu immediate for submenu

Dany St-Amant dany.ephemeral.2014 at icloud.com
Tue Apr 16 14:26:46 PDT 2019


the hot key assigned to a MENU BEGIN (via MENU LABEL) doesn't cause the submenu to be entered automatically when MENU IMMEDIATE is used (at previous level). Here's a patch over syslinux 6.03. Patch was tested on Debian.


*Sample config*
# hot keys: S,1,2 are immediate (screen flash), but not E
LABEL standard
 MENU LABEL ^Standard

 LABEL extra1
   MENU LABEL ^1. One
 LABEL extra2
   MENU LABEL ^2. Two
# end-of-config

*Code analysis*
The 'menu_entry' associated with a label inherits the 'immediate' flag of the parent 'menu' [record()] unless overridden for the label. The sub 'menu' inherits the 'immediate' flag of the parent 'menu' [new_menu()]. But the 'menu_entry' associated with a sub-menu doesn't inherit the 'immediate' flag.

Not sure if this was an oversight in the original delivery of the feature, or if it was intentional (the patch description does cover the design intention)

*Possible issue*
There is no way to individually set MENU IMMEDIATE or MENU NOIMMEDIATE for the submenu entries (existing limitation). If someone want to revert to the broken behaviour, the main setting has to be MENU NOIMMEDIATE, and each label must be individually marked with MENU IMMEDIATE.

--- syslinux-6.03.orig/com32/menu/readconfig.c  2019-04-16 07:42:25.281964266 -0500
+++ syslinux-6.03/com32/menu/readconfig.c       2019-04-16 07:43:06.332309963 -0500
@@ -437,6 +437,7 @@ static struct menu *begin_submenu(const
     me = new_entry(current_menu);
     me->displayname = refstrdup(tag);
+    me->immediate = current_menu->immediate;
     return new_menu(current_menu, me, refstr_get(me->displayname));
# end-of-patch

More information about the Syslinux mailing list