aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrus Rahman <crahman@gmail.com>2023-04-16 02:27:53 +0000
committerKyle Evans <kevans@FreeBSD.org>2023-04-20 04:15:15 +0000
commit7e5811f76bb0df289b32144849331a2db83ac718 (patch)
treed12cad569fd507698ee63793956d2ad6abfd292f
parentac7506f22fa6420a85327a3831e766706003c36c (diff)
downloadsrc-7e5811f76bb0df289b32144849331a2db83ac718.tar.gz
src-7e5811f76bb0df289b32144849331a2db83ac718.zip
loader: lua: unload the kernel when changing BEs
Usually the kernel is loaded later, but there are circumstances where it could have been loaded earlier than changing BEs. Unload anything that is already there so that we know we're using artifacts from the proper environment. PR: 265471 Reviewed by: kevans MFC after: 3 days (cherry picked from commit d7584aa09fcf8d96544e5bfb3ea78f50d7720c0c)
-rw-r--r--stand/lua/menu.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/stand/lua/menu.lua b/stand/lua/menu.lua
index 400dbf3d469b..4a326cb54bb9 100644
--- a/stand/lua/menu.lua
+++ b/stand/lua/menu.lua
@@ -58,6 +58,9 @@ local function bootenvSet(env)
loader.setenv("vfs.root.mountfrom", env)
loader.setenv("currdev", env .. ":")
config.reload()
+ if loader.getenv("kernelname") ~= nil then
+ loader.perform("unload")
+ end
end
local function multiUserPrompt()