Page MenuHomeFreeBSD

loader/lua: auto-load p9fs if vfs.root.mountfrom requires it
Needs ReviewPublic

Authored by dch on Sat, Jan 17, 7:54 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jan 18, 4:05 AM
Unknown Object (File)
Sun, Jan 18, 2:11 AM
Unknown Object (File)
Sun, Jan 18, 12:53 AM
Unknown Object (File)
Sat, Jan 17, 11:15 PM
Unknown Object (File)
Sat, Jan 17, 10:41 PM
Unknown Object (File)
Sat, Jan 17, 9:21 PM
Unknown Object (File)
Sat, Jan 17, 9:21 PM

Details

Reviewers
kevans
manu
imp
Summary

This allows bhyve and bhyveload to boot directly from an
unmodified bsdinstall.
Reported by: pat@patmaddox.com
Sponsored by: SkunkWerks, GmbH

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 69960
Build 66843: arc lint + arc unit

Event Timeline

dch requested review of this revision.Sat, Jan 17, 7:54 PM

I still haven't figured out when the hook is triggered, but this is already pretty neat.

The idea is to give loader enough smarts to be able to directly boot a VM from a clean
install without further modifications.

e.g.https://github.com/freebsd/vm-bhyve/pull/96

If I'm reading this right, it means no more virtio_p9fs_load="YES" needed in loader.conf? If so that would be very cool.

I'm torn on this...
I'd rather have a regexp -> modules to load table that we cruise through so we can also do zfs
But at the same time, I don't want errors for people that have zfs or the p9fs modules in the kernel (I thought my playing with this required an additional module).
So this fills a need, but it's the end of the road for things like this...

This revision is now accepted and ready to land.Sat, Jan 17, 8:55 PM
  • move check earlier, I don't think I can use a hook this early
  • actually works now

testing

  • untar base.txz and kernel.txz somewhere
  • copy in config.lua from this patch
cp -av /usr/src/stand/lua/config.lua /tmp/root/boot/lua/
# bhyvectl --destroy --vm=vm0
# bhyveload -m 1G \
	-h /tmp/root/ \
	-e vfs.root.mountfrom=p9fs:devroot \
	vm0

# bhyve -m 1G -A \
	-l com1,stdio \
	-s 0,hostbridge \
	-s 3,virtio-9p,devroot=/tmp/root \
	-s 31,lpc \
	vm0
This revision now requires review to proceed.Sat, Jan 17, 11:56 PM

I like the idea behind this, just have one question...

stand/lua/config.lua
529

Still haven't answered my question: what about the warning this will cause when virtio_p9fs is compiled into the kernel for normal installs. A warning that can't be suppressed.