diff options
| author | Kyle Evans <kevans@FreeBSD.org> | 2026-06-04 13:57:16 +0000 |
|---|---|---|
| committer | Kyle Evans <kevans@FreeBSD.org> | 2026-06-10 04:00:49 +0000 |
| commit | bddfcbd9bbc68fe11ce53954b7f82584cd5ee40b (patch) | |
| tree | b5c977bb4b6d3dfb2e55a09992c677a219686fc2 /stand/lua/cli.lua | |
| parent | f25b4d986c949b3e0c0e20fe5cbcc42f0f004243 (diff) | |
lualoader: add be-list and be-switch commands
This is useful for driving BE changes from the loader command prompt,
rather than having to use the menu. Note that the active carousel in
the boot environment carousel doesn't currently reflect a switch in
boot environments done this way- I'm considering this only a minor bug,
as you probably can't or won't go back to the menu if you're using these
commands.
Reviewed by: imp (previous version)
(cherry picked from commit c7ff706b31c22f10c2403869c46b443448da3e08)
Diffstat (limited to 'stand/lua/cli.lua')
| -rw-r--r-- | stand/lua/cli.lua | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/stand/lua/cli.lua b/stand/lua/cli.lua index 6832da0a31a5..a405baba9468 100644 --- a/stand/lua/cli.lua +++ b/stand/lua/cli.lua @@ -172,6 +172,29 @@ cli["disable-module"] = function(...) setModule(argv[1], false) end +cli['be-list'] = function(...) + local _, argv = cli.arguments(...) + if #argv ~= 0 then + print("usage error: be-list") + return + end + + for _, bootenv in core.bootenvIter() do + print(bootenv) + end +end + +cli['be-switch'] = function(...) + local _, argv = cli.arguments(...) + if #argv == 0 then + print("usage error: be-switch beName") + return + end + + local env = argv[1] + core.switchBE(env) +end + cli["toggle-module"] = function(...) local _, argv = cli.arguments(...) if #argv == 0 then |
