svn commit: r357103 - head/stand/lua

Kyle Evans kevans at FreeBSD.org
Sat Jan 25 03:02:45 UTC 2020


Author: kevans
Date: Sat Jan 25 03:02:45 2020
New Revision: 357103
URL: https://svnweb.freebsd.org/changeset/base/357103

Log:
  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

Modified:
  head/stand/lua/loader.lua

Modified: head/stand/lua/loader.lua
==============================================================================
--- head/stand/lua/loader.lua	Sat Jan 25 00:06:18 2020	(r357102)
+++ head/stand/lua/loader.lua	Sat Jan 25 03:02:45 2020	(r357103)
@@ -42,14 +42,14 @@ local password = require("password")
 -- need it.
 local menu
 
-try_include("local")
-
 config.load()
+
 -- Our console may have been setup for a different color scheme before we get
 -- here, so make sure we set the default.
 if color.isEnabled() then
 	printc(color.default())
 end
+try_include("local")
 if not core.isMenuSkipped() then
 	menu = require("menu")
 end


More information about the svn-src-all mailing list