From 83f7a74cda593577acbfab22c82a015b782029a6 Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Fri, 2 Nov 2018 03:25:23 +0000 Subject: [PATCH] lualoader: Implement boot-conf MFC after: 3 days --- stand/lua/cli.lua | 10 ++++++++++ stand/lua/cli.lua.8 | 9 +++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/stand/lua/cli.lua b/stand/lua/cli.lua index ff58be98c910..adefabbb3386 100644 --- a/stand/lua/cli.lua +++ b/stand/lua/cli.lua @@ -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 = {...} diff --git a/stand/lua/cli.lua.8 b/stand/lua/cli.lua.8 index 2d77db7449cc..f25a27c01b0b 100644 --- a/stand/lua/cli.lua.8 +++ b/stand/lua/cli.lua.8 @@ -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.