From owner-freebsd-arch@freebsd.org Tue May 3 17:36:35 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 42AFEB2C760 for ; Tue, 3 May 2016 17:36:35 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 26405198F for ; Tue, 3 May 2016 17:36:35 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id CCC78B93A for ; Tue, 3 May 2016 13:36:33 -0400 (EDT) From: John Baldwin To: 'freebsd-arch' Subject: Default KMODDIR Date: Tue, 03 May 2016 10:36:28 -0700 Message-ID: <1702887.zov9WbhYWY@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 03 May 2016 13:36:33 -0400 (EDT) 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:36:35 -0000 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: 1) Someone has installed a custom kernel and finds they need module 'foo' that wasn't in their custom kernel. They might do: # cd /sys/modules/foo # make all install # kldload foo 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. 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. 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. 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 'make install' rather than 'make load' from a module build directory. Strawman diff: Index: share/mk/bsd.own.mk =================================================================== --- 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?= 555 NOBINMODE?= 444 -.if defined(MODULES_WITH_WORLD) KMODDIR?= /boot/modules -.else -KMODDIR?= /boot/kernel -.endif KMODOWN?= ${BINOWN} KMODGRP?= ${BINGRP} KMODMODE?= ${BINMODE} -- John Baldwin