]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
loader.lua: re-arrange to load local.lua *after* config loading
authorKyle Evans <kevans@FreeBSD.org>
Sat, 25 Jan 2020 03:02:45 +0000 (03:02 +0000)
committerKyle Evans <kevans@FreeBSD.org>
Sat, 25 Jan 2020 03:02:45 +0000 (03:02 +0000)
commit59ba5b1dc2742257c16060009e5e674ec12bc020
treeff2bba47b99722bfe30c5649ed711d9080b2d644
parentd35738c38d4b9dc6aa56b52ec288ff33d329ea64
loader.lua: re-arrange to load local.lua *after* config loading

The major problem with the current ordering is that loader.conf may contain
all of the magic we need to actually setup the console, so loading local.lua
prior to that can make it excessively difficult and annoying to debug
(whoops, sorry Ravi & Warner).

The new ordering has some implications, but I suspect they are a non-issue.
The first is that it's no longer possible for the local module to inject any
logic prior to loading config -- I suspect no one has relied on this. The
second implication is that the config.loaded hook is now useless, as the
local module will always be included after that hook would have fired.

For config.loaded, I will opt to leave it in, just in case we add an early
point for local lua to get injected or in case one wants to schedule some
deferred logic in a custom loader.lua. The overhead of having it if no hooks
will be invoked is relatively minimal.

Diagnosed by: imp
Reported by: imp, rpokala (most likely)
MFC after: 3 days
stand/lua/loader.lua