svn commit: r338255 - head/stand/lua

Kyle Evans kevans at FreeBSD.org
Thu Aug 23 16:26:04 UTC 2018


Author: kevans
Date: Thu Aug 23 16:26:03 2018
New Revision: 338255
URL: https://svnweb.freebsd.org/changeset/base/338255

Log:
  lualoader: Fix (add) Xen support
  
  lualoader was not respecting the 'xen_kernel' environment variable, which
  hints to the interpreter that it should load a Xen kernel prior to loading
  any other kernel that might be specified. If a Xen kernel is specified and
  we fail to load it, we should not proceed to boot.
  
  Reported by:	royger
  Tested by:	royger

Modified:
  head/stand/lua/config.lua

Modified: head/stand/lua/config.lua
==============================================================================
--- head/stand/lua/config.lua	Thu Aug 23 16:24:27 2018	(r338254)
+++ head/stand/lua/config.lua	Thu Aug 23 16:26:03 2018	(r338255)
@@ -50,6 +50,8 @@ local MSG_FAILEXAF = "Failed to execute '%s' after loa
 local MSG_MALFORMED = "Malformed line (%d):\n\t'%s'"
 local MSG_DEFAULTKERNFAIL = "No kernel set, failed to load from module_path"
 local MSG_KERNFAIL = "Failed to load kernel '%s'"
+local MSG_XENKERNFAIL = "Failed to load Xen kernel '%s'"
+local MSG_XENKERNLOADING = "Loading Xen kernel..."
 local MSG_KERNLOADING = "Loading kernel..."
 local MSG_MODLOADING = "Loading configured modules..."
 local MSG_MODLOADFAIL = "Could not load one or more modules!"
@@ -554,9 +556,17 @@ function config.reload(file)
 end
 
 function config.loadelf()
+	local xen_kernel = loader.getenv('xen_kernel')
 	local kernel = config.kernel_selected or config.kernel_loaded
 	local loaded
 
+	if xen_kernel ~= nil then
+		print(MSG_XENKERNLOADING)
+		if cli_execute_unparsed('load ' .. xen_kernel) ~= 0 then
+			print(MSG_XENKERNFAIL:format(xen_kernel))
+			return
+		end
+	end
 	print(MSG_KERNLOADING)
 	loaded = config.loadKernel(kernel)
 


More information about the svn-src-all mailing list