lualoader: Add reload-conf loader command

This command will trigger a reload of the configuration from disk. This is
useful if you've changed currdev from recovery media to local disk as much
as I have over the past ~2 hours and are tired of the extra keystrokes.

This is really just a glorified shortcut, but reload-conf is likely easier
to remember for other people and does save some keystrokes when reloading
the configuration. It is also resilient to the underlying config method
changing interface, but this is unlikely to happen.

MFC after:	1 week
This commit is contained in:
Kyle Evans 2019-09-14 03:38:18 +00:00
parent 1c56203bcf
commit af876563d1
2 changed files with 20 additions and 3 deletions

View File

@ -125,6 +125,10 @@ cli['boot-conf'] = function(...)
core.autoboot(argstr) core.autoboot(argstr)
end end
cli['reload-conf'] = function(...)
config.reload()
end
-- Used for splitting cli varargs into cmd_name and the rest of argv -- Used for splitting cli varargs into cmd_name and the rest of argv
function cli.arguments(...) function cli.arguments(...)
local argv = {...} local argv = {...}

View File

@ -26,7 +26,7 @@
.\" .\"
.\" $FreeBSD$ .\" $FreeBSD$
.\" .\"
.Dd October 31, 2018 .Dd September 13, 2019
.Dt CLI.LUA 8 .Dt CLI.LUA 8
.Os .Os
.Sh NAME .Sh NAME
@ -82,14 +82,27 @@ As of present, the
module by default provides commands for module by default provides commands for
.Ic autoboot , .Ic autoboot ,
.Ic boot , .Ic boot ,
.Ic boot-conf ,
and and
.Ic boot-conf. .Ic reload-conf .
In all three cases, the .Pp
For
.Ic autoboot ,
.Ic boot ,
and
.Ic boot-conf ,
the
.Xr core.lua 8 .Xr core.lua 8
module will load all ELF modules as-needed before executing the equivalent module will load all ELF modules as-needed before executing the equivalent
built-in loader commands. built-in loader commands.
All non-kernel arguments to these commands are passed in the same order to the All non-kernel arguments to these commands are passed in the same order to the
loader command. loader command.
.Pp
The
.Ic reload-conf
command will reload the configuration from disk.
This is useful if you have manually changed currdev and would like to easily
reload the configuration from the new device.
.Ss Exported Functions .Ss Exported Functions
The following functions are exported from The following functions are exported from
.Nm : .Nm :