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
This commit is contained in:
parent
becda72184
commit
0d7bee6a2a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=338255
@ -50,6 +50,8 @@ local MSG_FAILEXAF = "Failed to execute '%s' after loading '%s'"
|
||||
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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user