aboutsummaryrefslogtreecommitdiff
path: root/stand/lua/core.lua.8
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/core.lua.8
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/core.lua.8')
-rw-r--r--stand/lua/core.lua.817
1 files changed, 16 insertions, 1 deletions
diff --git a/stand/lua/core.lua.8 b/stand/lua/core.lua.8
index 325320b2fce8..5cb2b46bd9d1 100644
--- a/stand/lua/core.lua.8
+++ b/stand/lua/core.lua.8
@@ -24,7 +24,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd April 8, 2026
+.Dd June 4, 2026
.Dt CORE.LUA 8
.Os
.Sh NAME
@@ -175,6 +175,12 @@ returns true, then the boot environment is retained in the list.
Otherwise, the boot environment is hidden.
The old filter, if any, is returned to allow the caller to compose a filter on
top of another filter.
+.It Fn core.bootenvIter
+Returns an iterator over the known boot environment list.
+The returned boot environment names do not include the boot environmnt root,
+which would need to be added back on from the
+.Ev zfs_be_root
+environment variable.
.It Fn core.bootenvList
Returns a table of boot environments, or an empty table.
These will be picked up using the
@@ -229,6 +235,15 @@ If there are no elements, this returns nil and nil.
If there is one element, this returns the front element and an empty table.
This will not operate on truly associative tables; numeric indices are
required.
+.It Fn core.switchBE beName
+Switch to the requested
+.Fa beName .
+It may be either be formatted as a fully-qualified loader dataset path
+.Dq zfs:pool/ROOT/beName ,
+or like one of
+.Dq pool/ROOT/beName
+or
+.Dq beName .
.It Fn core.loaderTooOld
Returns true if the loader is too old.
Specifically, this means, is the loader old enough to require one or more