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()
|
||||
local xen_kernel = loader.getenv('xen_kernel')
|
||||
local kernel = config.kernel_selected or config.kernel_loaded
|
||||
local loaded, status
|
||||
local status
|
||||
|
||||
if xen_kernel ~= nil then
|
||||
print(MSG_XENKERNLOADING)
|
||||
@ -633,11 +633,10 @@ function config.loadelf()
|
||||
end
|
||||
end
|
||||
print(MSG_KERNLOADING)
|
||||
loaded = config.loadKernel(kernel)
|
||||
|
||||
if not loaded then
|
||||
if not config.loadKernel(kernel) then
|
||||
return false
|
||||
end
|
||||
hook.runAll("kernel.loaded")
|
||||
|
||||
print(MSG_MODLOADING)
|
||||
status = loadModule(modules, not config.verbose)
|
||||
|
Loading…
Reference in New Issue
Block a user