Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 04 Nov 2013 10:23:06 +0100
From:      =?ISO-8859-1?Q?Ren=E9_Ladan?= <rene@freebsd.org>
To:        =?ISO-8859-1?Q?Bernhard_Fr=F6hlich?= <decke@FreeBSD.org>
Cc:        "ports@freebsd.org Ports" <ports@freebsd.org>
Subject:   Re: KMODDIR needs to be fixed [was: Re: [QAT] r332657: 4x leftovers]
Message-ID:  <5277677A.6060906@freebsd.org>
In-Reply-To: <CAE-m3X39AW9LQ=AwG%2BgHhYb16nL9QiUjjABoFSLae-mEn-jxOQ@mail.gmail.com>
References:  <CAE-m3X39AW9LQ=AwG%2BgHhYb16nL9QiUjjABoFSLae-mEn-jxOQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 04-11-2013 08:46, Bernhard Fröhlich wrote:
>
>
> Am 04.11.2013 02:20 schrieb "Ports-QAT" <qat@redports.org
> <mailto:qat@redports.org>>:
> >
> > Explicitly set KMODDIR to /boot/modules to avoid picking up /boot/kernel
> > as KMODDIR from /usr/share/mk/bsd.own.mk <http://bsd.own.mk>;
> included by the distribution
> > Makefile.
>
Which would have to be repeated for every port using kmod ... instead I
suggest this:

@@ -23,6 +23,9 @@
 
 SSP_UNSAFE=    kernel module does not support SSP
 
+.if ${KMODDIR} == "/boot/kernel"
+KMODDIR=       /boot/modules
+.endif
 KMODDIR?=      /boot/modules
 PLIST_SUB+=    KMODDIR="${KMODDIR:C,^/,,}"
 MAKE_ENV+=     KMODDIR="${KMODDIR}" SYSDIR="${SRC_BASE}/sys"

> Yeah I have noticed the same problem with vbox some months ago when I
> tried to support overriding KMODDIR. This would be needed by some
> jails that have a read only /boot.
> I think we should fix this properly now that we have you new
> USES=kernsrc. We can either introduce a new variable PORTSKMODDIR or
> we hack/fix bsd.own.mk <http://bsd.own.mk>.
>
The above patch wouldn't fix the "leftover" /boot/kernel directory, but
it does fix upgrading the kernel while ports have files installed into
the default location. Installing into /boot/kernel would break ports
when the kernel gets upgraded because the current kernel directory gets
renamed to /boot/kernel.old

For PORTSKMODDIR all ports using kmod need to be updated?

Hacking bsd.own.mk feels wrong, it only defines variables. There is
already a MODULES_WITH_WORLD knob which sets the default modules
directory to /boot/modules, but the include order prevents setting that
in Uses/kmod.mk (hence the explicit override above). The other
disadvantage is that this would create another dependency on the OS version.

René




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5277677A.6060906>