[syslinux] RFC: Feature: MENU HIDDEN behaviour on ANY key
Dany St-Amant
dany.ephemeral.2014 at icloud.com
Wed Apr 10 18:59:05 PDT 2019
Hello,
Here's a small enhancement feature for menu.c32. Looking for feedback before starting any coding (not sure when I'll have time for implementation)
Regards,
Dany St-Amant
*Problem statement*
When MENU HIDDEN is used on an headless server, any noise on the serial console can interrupt the boot; it would be preferable if there only specific keys were allowed to interrupt, reducing the probability of unwanted interruption. Even with TOTALTIMEOUT present, there's a delay present as TOTALTIMEOUT has to be large enough to make it useable during intentional boot interruption.
*Basic behaviour change*
Provide a way to assign "reveal menu" to specific key(s)
Provide a default behaviour for unassigned keys (other than current "reveal menu")
*Possible user interface change*
MENU HIDDENMENUKEY key[,key]
MENU HIDDDENKEY key[,key] [command...]
Add ANY as an acceptable value for key
Make command optional, defaulting to boot default.
*Behaviour*
If pressed key is defined by HIDDENKEY, that action is always taken.
no HIDDENMENUKEY, no HIDDENKEY ANY: all keys bring the menu (current behaviour)
HIDDENMENUKEY ANY: all keys bring the menu (current behaviour)
HIDDENMENUKEY Esc, HIDDENKEY ANY (without commands): Esc brings the menu, all keys autoboot
HIDDENMENUKEY Esc, no HIDDENKEY ANY: Esc brings the menu, all keys trigger nothing.
*Exclusion*
No similar support for boot prompt.
No code/behaviour analysis made for cmenu.c32
*Affected code* (outside config parsing)
menumain.c:do_hidden_menu()
Extra comparison when handling mygetkey(),ignoring unbound key if ANY not assigned (or defaulted). Return NULL, if hide_key[key] matches HIDDENMENUKEY. A few extra globals likely required to track/reference pseudo-commands "reveal menu" and "boot default" inside hide_key[] table. Need to use/steal an unused entry of hide_key[] as the ANY key.
*Rejected/discarded interface option*
MENU HIDDENSECUREKEY key[,key] [STRICT]
MENU HIDDENDEFAULTKEY 0|1
MENU HIDDENANYKEY MENU|IGNORE|BOOT
MENU HIDDENKEY ANY|key[,key] MENU|IGNORE|BOOT|command...
Last one is rejected to avoid collision with exiting configuration which might be using label matching the keywords.
More information about the Syslinux
mailing list