aboutsummaryrefslogtreecommitdiff
path: root/stand/lua/cli.lua
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2026-06-04 13:57:16 +0000
committerKyle Evans <kevans@FreeBSD.org>2026-06-10 04:00:39 +0000
commitf77062f506f7bc752316da35e8d7da9a1ddb0d91 (patch)
treed65ff012b9a663c2c74f0b0d24ae1f3d79bf2b07 /stand/lua/cli.lua
parent76720b010873f350b94231c5380e2d19b8839795 (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.lua23
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