From owner-svn-src-all@freebsd.org Thu Nov 8 03:25:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0B641109DD2; Thu, 8 Nov 2018 03:25:20 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1E4686B1E1; Thu, 8 Nov 2018 03:25:20 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB69E1F03D; Thu, 8 Nov 2018 03:25:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA83PJYO022624; Thu, 8 Nov 2018 03:25:19 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA83PJHK022620; Thu, 8 Nov 2018 03:25:19 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201811080325.wA83PJHK022620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 8 Nov 2018 03:25:19 +0000 (UTC) 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 X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/stand/lua X-SVN-Commit-Revision: 340244 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1E4686B1E1 X-Spamd-Result: default: False [-103.10 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.99)[-0.989,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2018 03:25:20 -0000 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"}, + }, }, }