From owner-freebsd-emulation@FreeBSD.ORG Tue Jan 15 05:57:19 2013 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 907039F3 for ; Tue, 15 Jan 2013 05:57:19 +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 39F7ABEA for ; Tue, 15 Jan 2013 05:57:19 +0000 (UTC) Received: (qmail 10089 invoked from network); 15 Jan 2013 05:57:08 -0000 Received: from unknown (HELO localhost.localdomain) (192.168.0.1) by sneak2.sneakemail.com with SMTP; 15 Jan 2013 05:57:08 -0000 Received: from 206.168.13.214 by mail.sneakemail.com with SMTP; 15 Jan 2013 05:57:08 -0000 Received: (sneakemail censored 3084-1358229427-578562 #2); 15 Jan 2013 05:57:08 -0000 Received: (sneakemail censored 3084-1358229427-578562 #1); 15 Jan 2013 05:57:08 -0000 Date: Mon, 14 Jan 2013 22:57:03 -0700 (MST) Message-ID: <3084-1358229427-578562@sneakemail.com> From: "John Hein" To: freebsd-emulation@freebsd.org To: Warren Block , , "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: <12834-1357944221-165573@sneakemail.com> 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: Tue, 15 Jan 2013 05:57:19 -0000 Warren Block wrote at 00:22 -0700 on Jan 12, 2013: > On Fri, 11 Jan 2013, John Hein wrote: > > 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_WITH_WORLD) > > KMODDIR?= /boot/modules > > ..else > > KMODDIR?= /boot/kernel > > ..endif > > > > And from make.conf(5) ... > > > > MODULES_WITH_WORLD > > (bool) Set to build modules with the system instead of the > > kernel. > > > > Not the best named knob for the KMODDIR adjustment. > > The explanation makes no sense to me. It doesn't really mean build, > it's a choice of where the new modules will be installed. > > MODULES_WITH_WORLD > (bool) Set to install modules in the /boot/modules directory. > Unset to install modules in the /boot/kernel directory along > with the FreeBSD kernel. > > It really should be inverted and the variable named MODULES_WITH_KERNEL. Well, that's not the only place it's used (see the rest of my email). But, yes, the name (and explanation) are misleading if you are considering installation location. The current usage of that knob is used to determine _when_ the modules are built as much as where they go (that's probably why the comment uses 'build'). Using it for ports builds probably isn't right since it was invented to be used during buildworld/buildkernel/install*. Ports really wants to have its own default KMODDIR, but it's made difficult since its current default value defined so early... putting a default 'KMODDIR?= /boot/modules' at the top of bsd.port.mk is too late. Using .undef KMODDIR in b.p.m. seems hacky, but it [mostly] works without having to resort to using knobs intended for the buildworld system (and avoids having to set it globally in /etc/make.conf which would affect buildworld/kernel). It also allows command line or environment override. Index: bsd.port.mk =================================================================== --- bsd.port.mk (revision 310372) +++ bsd.port.mk (working copy) @@ -1140,6 +1140,8 @@ # by individual Makefiles or local system make configuration. PORTSDIR?= /usr/ports LOCALBASE?= /usr/local +.undef KMODDIR +KMODDIR?= /boot/modules LINUXBASE?= /compat/linux DISTDIR?= ${PORTSDIR}/distfiles _DISTDIR?= ${DISTDIR}/${DIST_SUBDIR} However, it prevents the user from being able to define it in /etc/make.conf if he wanted to. That's bad for POLA. This patch to bsd.own.mk would work in all the above cases and allow all but a few individual ports to stop defining KMODDIR... --- /usr/share/mk/bsd.own.mk.orig 2012-05-04 09:03:42.000000000 -0600 +++ /usr/share/mk/bsd.own.mk 2013-01-14 22:43:37.000000000 -0700 @@ -126,7 +126,7 @@ BINMODE?= 555 NOBINMODE?= 444 -.if defined(MODULES_WITH_WORLD) +.if defined(BSDPORTMK) || defined(MODULES_WITH_WORLD) KMODDIR?= /boot/modules .else KMODDIR?= /boot/kernel