diff options
| author | Kyle Evans <kevans@FreeBSD.org> | 2018-06-10 01:38:52 +0000 |
|---|---|---|
| committer | Kyle Evans <kevans@FreeBSD.org> | 2018-06-10 01:38:52 +0000 |
| commit | 4072dcb3c7da689c3e31b867455278785503649e (patch) | |
| tree | 75472b695d6e9eb4c498a4000976e789255d41c7 /stand/lua | |
| parent | 468910cd7abb32b2701892e283dad90aa389eed0 (diff) | |
Notes
Diffstat (limited to 'stand/lua')
| -rw-r--r-- | stand/lua/config.lua | 40 |
1 files changed, 29 insertions, 11 deletions
diff --git a/stand/lua/config.lua b/stand/lua/config.lua index fc2ac6f50b89..082cca4e2e69 100644 --- a/stand/lua/config.lua +++ b/stand/lua/config.lua @@ -250,6 +250,33 @@ local function loadModule(mod, silent) return status end +local function readConfFiles(loaded_files) + local f = loader.getenv("loader_conf_files") + if f ~= nil then + for name in f:gmatch("([%w%p]+)%s*") do + if loaded_files[name] ~= nil then + goto continue + end + + local prefiles = loader.getenv("loader_conf_files") + + print("Loading " .. name) + -- These may or may not exist, and that's ok. Do a + -- silent parse so that we complain on parse errors but + -- not for them simply not existing. + if not config.processFile(name, true) then + print(MSG_FAILPARSECFG:format(name)) + end + + loaded_files[name] = true + local newfiles = loader.getenv("loader_conf_files") + if prefiles ~= newfiles then + readConfFiles(loaded_files) + end + ::continue:: + end + end +end local function readFile(name, silent) local f = io.open(name) @@ -467,17 +494,8 @@ function config.load(file, reloading) print(MSG_FAILPARSECFG:format(file)) end - local f = loader.getenv("loader_conf_files") - if f ~= nil then - for name in f:gmatch("([%w%p]+)%s*") do - -- These may or may not exist, and that's ok. Do a - -- silent parse so that we complain on parse errors but - -- not for them simply not existing. - if not config.processFile(name, true) then - print(MSG_FAILPARSECFG:format(name)) - end - end - end + local loaded_files = {file = true} + readConfFiles(loaded_files) checkNextboot() |
