Changeset View
Changeset View
Standalone View
Standalone View
stand/lua/menu.lua
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | |||||
end | end | ||||
local function bootenvSet(env) | local function bootenvSet(env) | ||||
loader.setenv("vfs.root.mountfrom", env) | loader.setenv("vfs.root.mountfrom", env) | ||||
loader.setenv("currdev", env .. ":") | loader.setenv("currdev", env .. ":") | ||||
config.reload() | config.reload() | ||||
end | end | ||||
local function multiUserPrompt() | |||||
return loader.getenv("loader_menu_multi_user_prompt") or "Multi user" | |||||
end | |||||
-- Module exports | -- Module exports | ||||
menu.handlers = { | menu.handlers = { | ||||
-- Menu handlers take the current menu and selected entry as parameters, | -- Menu handlers take the current menu and selected entry as parameters, | ||||
-- and should return a boolean indicating whether execution should | -- and should return a boolean indicating whether execution should | ||||
-- continue or not. The return value may be omitted if this entry should | -- continue or not. The return value may be omitted if this entry should | ||||
-- have no bearing on whether we continue or not, indicating that we | -- have no bearing on whether we continue or not, indicating that we | ||||
-- should just continue after execution. | -- should just continue after execution. | ||||
[core.MENU_ENTRY] = function(_, entry) | [core.MENU_ENTRY] = function(_, entry) | ||||
▲ Show 20 Lines • Show All 187 Lines • ▼ Show 20 Lines | return { | ||||
menu_entries.boot_envs, | menu_entries.boot_envs, | ||||
menu_entries.chainload, | menu_entries.chainload, | ||||
menu_entries.vendor, | menu_entries.vendor, | ||||
} | } | ||||
end, | end, | ||||
all_entries = { | all_entries = { | ||||
multi_user = { | multi_user = { | ||||
entry_type = core.MENU_ENTRY, | entry_type = core.MENU_ENTRY, | ||||
name = color.highlight("B") .. "oot Multi user " .. | name = function() | ||||
color.highlight("[Enter]"), | return color.highlight("B") .. "oot " .. | ||||
multiUserPrompt() .. " " .. | |||||
color.highlight("[Enter]") | |||||
end, | |||||
-- Not a standard menu entry function! | -- Not a standard menu entry function! | ||||
alternate_name = color.highlight("B") .. | alternate_name = function() | ||||
"oot Multi user", | return color.highlight("B") .. "oot " .. | ||||
multiUserPrompt() | |||||
end, | |||||
func = function() | func = function() | ||||
core.setSingleUser(false) | core.setSingleUser(false) | ||||
core.boot() | core.boot() | ||||
end, | end, | ||||
alias = {"b", "B"}, | alias = {"b", "B"}, | ||||
}, | }, | ||||
single_user = { | single_user = { | ||||
entry_type = core.MENU_ENTRY, | entry_type = core.MENU_ENTRY, | ||||
▲ Show 20 Lines • Show All 276 Lines • Show Last 20 Lines |