Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Apr 2023 02:40:31 GMT
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: d7584aa09fcf - main - loader: lua: unload the kernel when changing BEs
Message-ID:  <202304160240.33G2eVmI005731@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by kevans:

URL: https://cgit.FreeBSD.org/src/commit/?id=d7584aa09fcf8d96544e5bfb3ea78f50d7720c0c

commit d7584aa09fcf8d96544e5bfb3ea78f50d7720c0c
Author:     Cyrus Rahman <crahman@gmail.com>
AuthorDate: 2023-04-16 02:27:53 +0000
Commit:     Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2023-04-16 02:39:52 +0000

    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
---
 stand/lua/menu.lua | 3 +++
 1 file changed, 3 insertions(+)

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()



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