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 .. "'");
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to