Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Jan 2013 15:43:01 -0700 (MST)
From:      "John Hein" <emul-jfbml@snkmail.com>
To:        <freebsd-emulation@freebsd.org>, "Bernhard Fr=?utf-8?q?=c3=b6?=hlich" <decke@freebsd.org>, "Brandon Gooch" <jamesbrandongooch@gmail.com>
Subject:   Re: VirtualBox kernel modules
Message-ID:  <12834-1357944221-165573@sneakemail.com>
In-Reply-To: <CAE-m3X1VTDeA4QYKs=%2B3haeTMKKf%2B%2BG5qmVavYBKXOvniXxmZg@mail.gmail.com>
References:  <alpine.BSF.2.00.1301101929430.23007@wonkity.com> <CAFMmRNw%2B%2BdNNhYfUUWH4P1pUoO3koC%2BdTKR_PFVbkJCA2p0YMA@mail.gmail.com> <alpine.BSF.2.00.1301102130150.23661@wonkity.com> <CALBk6yJH4P1jSkSR-rOc5st1jWu_jrR1C2JBK_ebbVnnNi%2B%2BEw@mail.gmail.com> <CAE-m3X1VTDeA4QYKs=%2B3haeTMKKf%2B%2BG5qmVavYBKXOvniXxmZg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Bernhard Fr=F6hlich wrote at 16:34 +0100 on Jan 11, 2013:
 > On Fri, Jan 11, 2013 at 4:19 PM, Brandon Gooch
 > <jamesbrandongooch@gmail.com> wrote:
 > > On Thu, Jan 10, 2013 at 10:31 PM, Warren Block <wblock@wonkity.com=
> wrote:
 > >
 > >> On Thu, 10 Jan 2013, Ryan Stone wrote:
 > >>
 > >>  As I recall, a make installkernel will first mv /boot/kernel
 > >>> /boot/kernel.old
 > >>>
 > >>> Should ports put modules in /boot/modules to avoid this kind of =
thing=3F
 > >>>
 > >>
 > >> I thought so, but the Porter's Handbook doesn't say anything abou=
t it.
 > >> multimedia/cuse4bsd-kmod installs a module there.
 > >
 > >
 > >  The previous versions of this port did indeed install the modules=
 into
 > > /boot/modules; only with the most recent version (4.2.6) has this =
changed.
 > > For example:
 > >
 > > $ tar tvf /usr/ports/packages/All/virtualbox-ose-kmod-4.1.22.txz
 > > [...]
 > > -r-xr-xr-x  0 root   wheel  297288 Sep 19 09:19 /boot/modules/vbox=
drv.ko
 > > -r-xr-xr-x  0 root   wheel    9544 Sep 19 09:19 /boot/modules/vbox=
netadp.ko
 > > -r-xr-xr-x  0 root   wheel   26648 Sep 19 09:19 /boot/modules/vbox=
netflt.ko
 > > [...]
 > >
 > > $ tar tvf /usr/ports/packages/All/virtualbox-ose-kmod-4.2.6.txz
 > > [...]
 > > -r-xr-xr-x  0 root   wheel  337912 Jan  6 13:13 /boot/kernel/vboxd=
rv.ko
 > > -r-xr-xr-x  0 root   wheel    9696 Jan  6 13:13 /boot/kernel/vboxn=
etadp.ko
 > > -r-xr-xr-x  0 root   wheel   26808 Jan  6 13:13 /boot/kernel/vboxn=
etflt.ko
 > > [...]
 > >
 > > I don't know WHY this changed, or if it was just an oversight duri=
ng the
 > > update -- perhaps it by (re)design...
 >
 > I think this is an unwanted side effect. In fact I changed the defin=
tion of
 > where the kernel module should be installed in virtualbox-ose-kmod/M=
akefile
 > from KMODDIR=3D/boot/modules to KMODDIR=3F=3D/boot/modules to allow
 > overwriting the KMODDIR in case you want to have a non default direc=
tory
 > for your kernel modules (like in a jail).
 >
 > I haven't found yet where KMODDIR is set to /boot/kernel but it obvi=
ously is
 > defined somewhere. I'm also not sure if that is really a virtualbox
 > problem or if
 > we better should fix that in Mk and set KMODDIR or create a new vari=
able for
 > ports kernel modules.
 >
 > In the meantime overwriting KMODDIR to /boot/modules in your make.co=
nf
 > should help.

It's in /usr/share/mk/bsd.own.mk (which is included early by make(1) -
due to bsd.own.mk inclusion in /usr/shar/mk/bsd.port.mk)...

..if defined(MODULES=5FWITH=5FWORLD)
KMODDIR=3F=3D       /boot/modules
..else
KMODDIR=3F=3D       /boot/kernel
..endif

And from make.conf(5) ...

     MODULES=5FWITH=5FWORLD
                   (bool) Set to build modules with the system instead =
of the
                   kernel.

Not the best named knob for the KMODDIR adjustment.

% cd emulators/virtualbox-ose-kmod
% grep ^KMODDIR Makefile
KMODDIR=3F=3D       /boot/modules
% make -V KMODDIR MODULES=5FWITH=5FWORLD=3D1
/boot/modules

MODULES=5FWITH=5FWORLD is also used in /sys/conf/kern.post.mk and
/usr/src/Makefile.inc1 (the latter is, of course, irrelevant to
modules built in ports).

Probably the ports infrastructure should be set to have KMODDIR point
to /boot/modules by default (and allow overrides - e.g., for jails).

One way to do that might be defining MODULES=5FWITH=5FWORLD for ports
builds.

And another... somewhere in Mk/bsd.ports.mk perhaps:

..undef KMODDIR
KMODDIR=3F=3D /boot/modules

(and then you can remove all the KMODDIR=3D/boot/modules from all
individual ports' Makefiles)




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