aboutsummaryrefslogtreecommitdiff
path: root/stand/lua/core.lua
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2018-03-21 03:07:16 +0000
committerKyle Evans <kevans@FreeBSD.org>2018-03-21 03:07:16 +0000
commitaea262bfc480c11865a027e911f8a8d3165a48fc (patch)
tree77803d6a7302976c4ee5bd63092a5c31234e423c /stand/lua/core.lua
parent4948f7bf1153b9dd92239cf752888e26af21199f (diff)
downloadsrc-aea262bfc480c11865a027e911f8a8d3165a48fc.tar.gz
src-aea262bfc480c11865a027e911f8a8d3165a48fc.zip
lualoader: Add primitive hook module, use it to untangle bogus reference
See: comments in the hook module about intended usage, as well as the introduced use for config.reloaded. Use the newly introduced hook module to define a "config.reloaded" hook. This is currently used to register core's clearKernelCache as a reload hook to avoid a circular dependency and fix this functionality- it didn't actually work out, and it isn't immediately obvious how it slipped into src. Other hook types will be introduced into the core lualoader as useful hook points are identified.
Notes
Notes: svn path=/head/; revision=331281
Diffstat (limited to 'stand/lua/core.lua')
-rw-r--r--stand/lua/core.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/stand/lua/core.lua b/stand/lua/core.lua
index 87146590cd79..d38822deab5f 100644
--- a/stand/lua/core.lua
+++ b/stand/lua/core.lua
@@ -30,6 +30,7 @@
--
local config = require("config")
+local hook = require("hook")
local core = {}
@@ -138,7 +139,7 @@ function core.setSafeMode(safe_mode)
core.sm = safe_mode
end
-function core.configReloaded()
+function core.clearCachedKernels()
-- Clear the kernel cache on config changes, autodetect might have
-- changed or if we've switched boot environments then we could have
-- a new kernel set.
@@ -364,4 +365,6 @@ end
if core.isSystem386() and core.getACPIPresent(false) then
core.setACPI(true)
end
+
+hook.register("config.reloaded", core.clearCachedKernels)
return core