diff options
author | Kyle Evans <kevans@FreeBSD.org> | 2018-02-19 16:35:46 +0000 |
---|---|---|
committer | Kyle Evans <kevans@FreeBSD.org> | 2018-02-19 16:35:46 +0000 |
commit | 2e716cec23f1563ddcc65bea7bd6bc89557bb16a (patch) | |
tree | 06eb8f7e17e3bd0801e372e52783e606fec120da /stand/lua/drawer.lua | |
parent | e07fc39c144831bb898110e2f423b346ee5e5983 (diff) | |
download | src-2e716cec23f1563ddcc65bea7bd6bc89557bb16a.tar.gz src-2e716cec23f1563ddcc65bea7bd6bc89557bb16a.zip |
stand/lua: Call menu_entries if it's a function
If we've fetched menu.entries and it turns out it's a function, call it to
get the actual menu entries.
This will be used to swap multi-/single- user boot options if we're booting
single user by default (boot_single="YES" in loader.conf(5)). It can also be
used fairly easily for other non-standard situations.
Notes
Notes:
svn path=/head/; revision=329586
Diffstat (limited to 'stand/lua/drawer.lua')
-rw-r--r-- | stand/lua/drawer.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/stand/lua/drawer.lua b/stand/lua/drawer.lua index 9542ff55967e..2ff6af877ad7 100644 --- a/stand/lua/drawer.lua +++ b/stand/lua/drawer.lua @@ -167,7 +167,9 @@ function drawer.drawmenu(m) local alias_table = {}; local entry_num = 0; local menu_entries = m.entries; - + if (type(menu_entries) == "function") then + menu_entries = menu_entries(); + end for line_num, e in ipairs(menu_entries) do -- Allow menu items to be conditionally visible by specifying -- a visible function. |