I'm building a custom Live Linux image. I have everything working quite well. I'm now working on preparing a GRUB config file that will present the boot menu.What I'd like to be able to do is to have GRUB display the Boot option, followed by a series of toggles. For example: Don't load framebuffer, Store root filesystem in RAM, Boot in verbose mode and so on. I already have working logic in my Boot menuentry section that will read environment variables and behave accordingly, building a kernel command line and such as needed. But what I can't figure out is the best way to implement the toggles themselves. My idea was to have some menuentry blocks that simply set the environment variables. So, I've tried this:menuentry '[${OPT_VERBOSE}] Boot in verbose mode' { ... }But this simply displays the string verbatim. I tried taking the single quotes out, and I only get the value of the variable inside the [ and ] - apparently the menuentry option only looks at the first token after the directive.(I'm setting the OPT_whatever variables to just Y or N, and before the menuentry sections I initialize them to a set of reasonable defaults) Also, even though selecting the menu entry does toggle the variable, the menu does not re-evaluate the variable so it will always display the initial value.I have temporarily implemented a Show current options menu entry that just echoes out all of the current settings then uses read to wait for the user to hit enter, but this is cumbersome and not the best UX. Is this something that can be done with the current release of GRUB? Basically, I need two things:to be able to have the menuentry titles re-evaluated for variable expansion after executing a menu entry, andto be able to have a menuentry title include a variable but be longer than one word.
GRUB menu toggle switches?
grub2