Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Nov 2018 03:25:19 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r340244 - stable/12/stand/lua
Message-ID:  <201811080325.wA83PJHK022620@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevans
Date: Thu Nov  8 03:25:18 2018
New Revision: 340244
URL: https://svnweb.freebsd.org/changeset/base/340244

Log:
  MFC r340040, r340152: lualoader boot-conf and chainload
  
  r340040:
  lualoader: Implement boot-conf
  
  r340152:
  lualoader: Add chainload menu entry
  
  Approved by:	re (rgrimes)

Modified:
  stable/12/stand/lua/cli.lua
  stable/12/stand/lua/cli.lua.8
  stable/12/stand/lua/menu.lua
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/stand/lua/cli.lua
==============================================================================
--- stable/12/stand/lua/cli.lua	Thu Nov  8 03:24:24 2018	(r340243)
+++ stable/12/stand/lua/cli.lua	Thu Nov  8 03:25:18 2018	(r340244)
@@ -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 = {...}

Modified: stable/12/stand/lua/cli.lua.8
==============================================================================
--- stable/12/stand/lua/cli.lua.8	Thu Nov  8 03:24:24 2018	(r340243)
+++ stable/12/stand/lua/cli.lua.8	Thu Nov  8 03:25:18 2018	(r340244)
@@ -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-delimite
 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.

Modified: stable/12/stand/lua/menu.lua
==============================================================================
--- stable/12/stand/lua/menu.lua	Thu Nov  8 03:24:24 2018	(r340243)
+++ stable/12/stand/lua/menu.lua	Thu Nov  8 03:25:18 2018	(r340244)
@@ -337,6 +337,22 @@ menu.welcome = {
 			submenu = menu.boot_environments,
 			alias = {"e", "E"},
 		},
+		-- chainload
+		{
+			entry_type = core.MENU_ENTRY,
+			name = function()
+				return 'Chain' .. color.highlight("L") ..
+				    "oad " .. loader.getenv('chain_disk')
+			end,
+			func = function()
+				loader.perform("chain " ..
+				    loader.getenv('chain_disk'))
+			end,
+			visible = function()
+				return loader.getenv('chain_disk') ~= nil
+			end,
+			alias = {"l", "L"},
+		},
 	},
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201811080325.wA83PJHK022620>