loader: Add a "kernel.loaded" hook
This hook can be useful, for example to run a local function to choose different modules to load when a user has picked a different kernel from the menu. Reviewed by: kevans Approved by: mav (mentor) MFC after: 1 week Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D24115
This commit is contained in:
parent
6ac25cd4ac
commit
79c20f2260
@ -623,7 +623,7 @@ end
|
|||||||
function config.loadelf()
|
function config.loadelf()
|
||||||
local xen_kernel = loader.getenv('xen_kernel')
|
local xen_kernel = loader.getenv('xen_kernel')
|
||||||
local kernel = config.kernel_selected or config.kernel_loaded
|
local kernel = config.kernel_selected or config.kernel_loaded
|
||||||
local loaded, status
|
local status
|
||||||
|
|
||||||
if xen_kernel ~= nil then
|
if xen_kernel ~= nil then
|
||||||
print(MSG_XENKERNLOADING)
|
print(MSG_XENKERNLOADING)
|
||||||
@ -633,11 +633,10 @@ function config.loadelf()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
print(MSG_KERNLOADING)
|
print(MSG_KERNLOADING)
|
||||||
loaded = config.loadKernel(kernel)
|
if not config.loadKernel(kernel) then
|
||||||
|
|
||||||
if not loaded then
|
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
hook.runAll("kernel.loaded")
|
||||||
|
|
||||||
print(MSG_MODLOADING)
|
print(MSG_MODLOADING)
|
||||||
status = loadModule(modules, not config.verbose)
|
status = loadModule(modules, not config.verbose)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user