freebsd-dev/stand/lua
Kyle Evans 5c1b516581 stand/lua: Change boot menu items' names when swapped
[Enter] should be moved to the single user menu item when we swap them.

Define a non-standard menu entry function "alternate_name" to use for this
purpose for ultimate flexibility if we change our minds later. When we're
booting single user, make a shallow copy of the menu that we'd normally
display and swap the items and their name functions to use alternate_name
instead. Toggling single user in the options menu and going back to the main
menu will now correctly reflect the current boot setting with the first two
menu options and "[Enter]" will always be on the right one.

This shallow copy technique has the chance of being quite slow since it's
done on every redraw, but in my testing it does not seem to make any obvious
difference.

shallowCopyTable could likely belong better in a general-purpose utility
module, but this (and the key constnats) are the only candidates we have at
the moment so we'll drop it into our core stuff for the moment and consider
re-organization at a later date.
2018-02-19 17:40:19 +00:00
..
color.lua stand/lua: Rename bootserial for clarity 2018-02-19 15:42:20 +00:00
config.lua stand/lua: Remove inaccurate comment after r329590 2018-02-19 17:09:29 +00:00
core.lua stand/lua: Change boot menu items' names when swapped 2018-02-19 17:40:19 +00:00
drawer.lua stand/lua: Call menu_entries if it's a function 2018-02-19 16:35:46 +00:00
loader.lua
Makefile
menu.lua stand/lua: Change boot menu items' names when swapped 2018-02-19 17:40:19 +00:00
password.lua stand/lua: Clear the screen before prompting for passwords 2018-02-19 02:09:10 +00:00
screen.lua stand/lua: Rename bootserial for clarity 2018-02-19 15:42:20 +00:00