Page MenuHomeFreeBSD

D54760.id169977.diff
No OneTemporary

D54760.id169977.diff

diff --git a/stand/lua/config.lua b/stand/lua/config.lua
--- a/stand/lua/config.lua
+++ b/stand/lua/config.lua
@@ -513,6 +513,22 @@
end
end
+-- Auto-load modules required for explicit vfs paths
+-- this allows bhyveload to pass just the env var in
+-- and required modules can be autoloaded, allowing
+-- bhyve to boot from a default FreeBSD install.
+local function loadRootFSModules()
+ local mountfrom = loader.getenv("vfs.root.mountfrom")
+ if mountfrom == nil then
+ return
+ end
+
+ -- Check for p9fs root and enable virtio_p9fs module
+ if mountfrom:match("^p9fs:") then
+ config.enableModule("virtio_p9fs")
+ end
+end
+
-- Module exports
config.verbose = false
@@ -914,4 +930,6 @@
hook.registerType("config.reloaded")
hook.registerType("kernel.loaded")
hook.registerType("modules.loaded")
+-- Load additional root mount plumbing if required
+hook.register("config.loaded", loadRootFSModules)
return config

File Metadata

Mime Type
text/plain
Expires
Thu, Mar 12, 8:13 AM (20 m, 35 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27717271
Default Alt Text
D54760.id169977.diff (930 B)

Event Timeline