1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-02 08:42:48 +00:00

lualoader: Implement boot-conf

MFC after:	3 days
This commit is contained in:
Kyle Evans 2018-11-02 03:25:23 +00:00
parent 78c2a9806e
commit 83f7a74cda
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=340040
2 changed files with 15 additions and 4 deletions

View File

@ -115,6 +115,16 @@ function cli.autoboot(...)
core.autoboot(argstr)
end
cli['boot-conf'] = function(...)
local _, argv = cli.arguments(...)
local kernel, argstr = parseBootArgs(argv)
if kernel ~= nil then
loader.perform("unload")
config.selectKernel(kernel)
end
core.autoboot(argstr)
end
-- Used for splitting cli varargs into cmd_name and the rest of argv
function cli.arguments(...)
local argv = {...}

View File

@ -26,7 +26,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd June 9, 2018
.Dd October 31, 2018
.Dt CLI.LUA 8
.Os
.Sh NAME
@ -80,10 +80,11 @@ Arguments may be passed to it as usual, space-delimited.
As of present, the
.Nm
module by default provides commands for
.Ic autoboot
.Ic autoboot ,
.Ic boot ,
and
.Ic boot .
In both cases, the
.Ic boot-conf.
In all three cases, the
.Xr core.lua 8
module will load all ELF modules as-needed before executing the equivalent
built-in loader commands.