From owner-freebsd-emulation@FreeBSD.ORG Fri Jan 11 22:50:29 2013 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6726D6D4 for ; Fri, 11 Jan 2013 22:50:29 +0000 (UTC) (envelope-from emul-jfbml@snkmail.com) Received: from sneak2.sneakemail.com (sneak2.sneakemail.com [38.113.6.65]) by mx1.freebsd.org (Postfix) with SMTP id 0A8007C7 for ; Fri, 11 Jan 2013 22:50:28 +0000 (UTC) Received: (qmail 7815 invoked from network); 11 Jan 2013 22:43:41 -0000 Received: from unknown (HELO localhost.localdomain) (192.168.0.1) by sneak2.sneakemail.com with SMTP; 11 Jan 2013 22:43:41 -0000 Received: from 206.168.13.214 by mail.sneakemail.com with SMTP; 11 Jan 2013 22:43:41 -0000 Received: (sneakemail censored 12834-1357944221-165573 #2); 11 Jan 2013 22:43:41 -0000 Received: (sneakemail censored 12834-1357944221-165573 #1); 11 Jan 2013 22:43:41 -0000 Date: Fri, 11 Jan 2013 15:43:01 -0700 (MST) Message-ID: <12834-1357944221-165573@sneakemail.com> From: "John Hein" To: freebsd-emulation@freebsd.org To: "Julian Bradfield" , viewmail-info@nongnu.org To: , "Bernhard Fr=?utf-8?q?=c3=b6?=hlich" , "Brandon Gooch" MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: VirtualBox kernel modules In-Reply-To: References: X-Mailer: Perl5 Mail::Internet v X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jan 2013 22:50:29 -0000 Bernhard Fr=F6hlich wrote at 16:34 +0100 on Jan 11, 2013: > On Fri, Jan 11, 2013 at 4:19 PM, Brandon Gooch > wrote: > > On Thu, Jan 10, 2013 at 10:31 PM, Warren Block 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)