Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Mar 2018 04:11:14 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r330564 - head/stand/lua
Message-ID:  <201803070411.w274BEji037741@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevans
Date: Wed Mar  7 04:11:14 2018
New Revision: 330564
URL: https://svnweb.freebsd.org/changeset/base/330564

Log:
  lualoader: Only loadelf before boot/autoboot if no kernel loaded
  
  Back when I "fixed" the loading of kernel/modules to be deferred until
  booting, I inadvertently broke the ability to manually load a set of kernels
  and modules in case of something bad having happened. lualoader would
  instead happily load whatever is specified in loader.conf(5) and go about
  the boot, leading to a panic loop as you try to rediscover a way to stop the
  panicky efirt module from loading and fail miserably.
  
  Reported by:	me, sadly

Modified:
  head/stand/lua/core.lua

Modified: head/stand/lua/core.lua
==============================================================================
--- head/stand/lua/core.lua	Wed Mar  7 03:54:38 2018	(r330563)
+++ head/stand/lua/core.lua	Wed Mar  7 04:11:14 2018	(r330564)
@@ -240,12 +240,18 @@ function core.setDefaults()
 end
 
 function core.autoboot(argstr)
-	config.loadelf()
+	-- loadelf() only if we've not already loaded a kernel
+	if loader.getenv("kernelname") == nil then
+		config.loadelf()
+	end
 	loader.perform(composeLoaderCmd("autoboot", argstr))
 end
 
 function core.boot(argstr)
-	config.loadelf()
+	-- loadelf() only if we've not already loaded a kernel
+	if loader.getenv("kernelname") == nil then
+		config.loadelf()
+	end
 	loader.perform(composeLoaderCmd("boot", argstr))
 end
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803070411.w274BEji037741>