From owner-freebsd-arch@freebsd.org Tue May 3 17:41:03 2016 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20569B2C81D for ; Tue, 3 May 2016 17:41:03 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 065E61B65; Tue, 3 May 2016 17:41:03 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id B695412AB; Tue, 3 May 2016 17:41:02 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Tue, 3 May 2016 17:41:01 +0000 From: Glen Barber To: John Baldwin Cc: 'freebsd-arch' Subject: Re: Default KMODDIR Message-ID: <20160503174101.GX1804@FreeBSD.org> References: <1702887.zov9WbhYWY@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="gU5RoU0MzIDcUgzM" Content-Disposition: inline In-Reply-To: <1702887.zov9WbhYWY@ralph.baldwin.cx> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 May 2016 17:41:03 -0000 --gU5RoU0MzIDcUgzM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 03, 2016 at 10:36:28AM -0700, John Baldwin wrote: > I'd like to change KMODDIR's default from /boot/kernel to /boot/modules. > Kernel builds already set KMODDIR explicitly in sys/conf/kern.pre.mk, so > the only modules affected would be modules built standalone outside of a > kernel build. There are two cases to consider I think: >=20 > 1) Someone has installed a custom kernel and finds they need module > 'foo' that wasn't in their custom kernel. They might do: >=20 > # cd /sys/modules/foo > # make all install > # kldload foo >=20 > For myself, if I need this I find myself instead modifying my kernel > config to include the module in MODULES_OVERRIDE and then doing a > 'make buildkernel && make reinstallkernel' as this will work after my > next source upgrade. >=20 > In this case, foo.ko would now end up in /boot/modules rather than > /boot/kernel. Note that if a user just does 'make load' instead of > 'make install' then nothing changes. >=20 > 2) A module lives outside of the tree (or a vendor wishes to ship a > newer version as a standalone module). All of these modules (including > all of the one in ports) currently have to override KMODDIR explicitly > in the module Makefile. >=20 > It is the 2) case I would like to make more seamless by changing the > default. This does change the behavior for 1) if someone is doing=20 > 'make install' rather than 'make load' from a module build directory. >=20 > Strawman diff: >=20 > Index: share/mk/bsd.own.mk > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- share/mk/bsd.own.mk (revision 298711) > +++ share/mk/bsd.own.mk (working copy) > @@ -49,7 +49,7 @@ > # > # > # KMODDIR Base path for loadable kernel modules > -# (see kld(4)). [/boot/kernel] > +# (see kld(4)). [/boot/modules] > # > # KMODOWN Kernel and KLD owner. [${BINOWN}] > # > @@ -165,11 +165,7 @@ > BINMODE?=3D 555 > NOBINMODE?=3D 444 > =20 > -.if defined(MODULES_WITH_WORLD) > KMODDIR?=3D /boot/modules > -.else > -KMODDIR?=3D /boot/kernel > -.endif > KMODOWN?=3D ${BINOWN} > KMODGRP?=3D ${BINGRP} > KMODMODE?=3D ${BINMODE} >=20 This seems like a good idea to me. I tend to do (1) quite often, and sometimes forget what modules I had temporarily built for testing something specific, and your proposal would be very helpful in finding the modules I do not always want or need installed. Glen --gU5RoU0MzIDcUgzM Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXKOKtAAoJEAMUWKVHj+KTA4kP/2azI81ABLmoeRWfUPVHA+hX yH+P0J2qXYSmtugK3jc+JzwJH7jnJNY6vjYEfig//gTZYgJl9Jmo7axYuGn5V9Af XxCRRnVhbe+WZiHZ8/Cey0LpZPPE3nazapLIWSovulMBAgUTcXxRvbRS931Q5s8h N7Xxyv62m1cKgJZLb5pUDiDAKukDK49IeX9oJtPSDBkR9bjHo4wVZhrSnD8h84Au ikuUeTsQg8EzCV2n4iPiY5gL7zsBu1sFDluUfqIijzx4gVThrumL5Cbo6N3pxqnN k5L6Qj1WdrIlp+bfTQ4r0rughv5JNVFkr6IYlvecrZRF8TZSq0+Ge2IKQJU5o4Bm 71gA9yX9LMurnLLHAxYg9H6dZ6KNBoJTEd06ZXQuXq2T7nzYiZm7Es0en6F9oaAw GFekaU+sxc1L3DXs83E1J3/WswnIS9mFofs4MEyAv3Xrf3KNp4Z9pQWAq2i+4ZRi zhk8HA9ffj17/KPTqKPGVGLoAtibzjzK0MgjzxsWWNPuD67tE7RS+AX1Y/h5k1XE I3vXHAMdqz5ig0otHqHFItiTR8wSRMA+ERxdu/Q34XHqVQ2pgg649gcEYvxgGyX5 /BiPlBi1vlw8oLw+FB8lROeOIiHDt8j56pQwCT3zBBm+/raE0ArAYwoqU/xQCc95 62qK0Si1PMuIfGG47p0J =0DnQ -----END PGP SIGNATURE----- --gU5RoU0MzIDcUgzM--