From owner-svn-src-head@freebsd.org Mon Feb 19 03:52:04 2018 Return-Path: Delivered-To: svn-src-head@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 68475F23678; Mon, 19 Feb 2018 03:52:04 +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 859DD7D893; Mon, 19 Feb 2018 03:52:02 +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 808A1156A3; Mon, 19 Feb 2018 03:52:02 +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 w1J3q2uh087325; Mon, 19 Feb 2018 03:52:02 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1J3q2Vb087324; Mon, 19 Feb 2018 03:52:02 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802190352.w1J3q2Vb087324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 19 Feb 2018 03:52:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329550 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329550 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Feb 2018 03:52:04 -0000 Author: kevans Date: Mon Feb 19 03:52:02 2018 New Revision: 329550 URL: https://svnweb.freebsd.org/changeset/base/329550 Log: stand/lua: Store the loaded kernel as config.kernel_loaded 'nil' means the 'first kernel found in module_path', which is the same interpretation as passing 'nil' to loadkernel. Otherwise, it denotes the name of a kernel that we've successfully loaded. When reloaded later, we will still need to do the full search again to locate the actual kernel in case things have changed, so just the name is good enough. This is in support of upcoming boot environment support. vfs.root.mountfrom and currdev will be changed, then we will reload configuration and attempt to reload the currently chosen kernel unless we shouldn't. Modified: head/stand/lua/config.lua Modified: head/stand/lua/config.lua ============================================================================== --- head/stand/lua/config.lua Mon Feb 19 02:09:10 2018 (r329549) +++ head/stand/lua/config.lua Mon Feb 19 03:52:02 2018 (r329550) @@ -297,6 +297,8 @@ function config.loadkernel(other_kernel) local res = load_bootfile(); if (res ~= nil) then + -- Default kernel is loaded + config.kernel_loaded = nil; return true; else print("No kernel set, failed to load from module_path"); @@ -321,6 +323,7 @@ function config.loadkernel(other_kernel) -- succeeded, add path to module_path if (res ~= nil) then + config.kernel_loaded = kernel; if (module_path ~= nil) then loader.setenv("module_path", v .. ";" .. module_path); @@ -333,6 +336,7 @@ function config.loadkernel(other_kernel) -- try as a file res = try_load(kernel); if (res ~= nil) then + config.kernel_loaded = kernel; return true; else print("Failed to load kernel '" .. kernel .. "'");