Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Feb 2018 03:52:02 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r329550 - head/stand/lua
Message-ID:  <201802190352.w1J3q2Vb087324@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 .. "'");



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