stand/lua: Defer kernel/module loading until boot or menu escape
Loading the kernel and modules can be really slow. Loading before the menu draws and every time one changes kernel/boot environment is even more painful. Defer loading until we either boot, auto-boot, or escape to loader prompt. We still need to deal with configuration changes as the boot environment changes, but this is generally much quicker. This commit strips all ELF loading out of config.load/config.reload so that these are purely for configuration. config.loadelf has been created to deal with kernel/module loads. Unloading logic has been ripped out, as we won't need to deal with it in the menu anymore. Discussed in part with: allanjude
This commit is contained in:
@@ -26,6 +26,8 @@
|
||||
-- $FreeBSD$
|
||||
--
|
||||
|
||||
local config = require('config');
|
||||
|
||||
local core = {};
|
||||
|
||||
-- Commonly appearing constants
|
||||
@@ -180,10 +182,12 @@ function core.setDefaults()
|
||||
end
|
||||
|
||||
function core.autoboot()
|
||||
config.loadelf();
|
||||
loader.perform("autoboot");
|
||||
end
|
||||
|
||||
function core.boot()
|
||||
config.loadelf();
|
||||
loader.perform("boot");
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user