From owner-svn-src-all@freebsd.org Tue Oct 30 16:23:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0711510ED21F; Tue, 30 Oct 2018 16:23:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (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 9F94F6E312; Tue, 30 Oct 2018 16:23:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id E4E9510AFCD; Tue, 30 Oct 2018 12:23:08 -0400 (EDT) Subject: Re: svn commit: r339901 - head/sys/conf To: rgrimes@freebsd.org, Mark Johnston References: <201810301555.w9UFt8eI062308@pdx.rh.CN85.dnsmgr.net> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: John Baldwin Message-ID: <52b0bc50-c142-ddc1-cdb7-70e5b1b0d29d@FreeBSD.org> Date: Tue, 30 Oct 2018 09:23:08 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <201810301555.w9UFt8eI062308@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Tue, 30 Oct 2018 12:23:09 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 16:23:11 -0000 On 10/30/18 8:55 AM, Rodney W. Grimes wrote: >> On Tue, Oct 30, 2018 at 12:23:38AM +0000, John Baldwin wrote: >>> Author: jhb >>> Date: Tue Oct 30 00:23:37 2018 >>> New Revision: 339901 >>> URL: https://svnweb.freebsd.org/changeset/base/339901 >>> >>> Log: >>> Permit local kernel modules to be built as part of a kernel build. >>> >>> Add support for "local" modules. By default, these modules are >>> located in LOCALBASE/sys/modules (where LOCALBASE defaults to >>> /usr/local). Individual modules can be built along with a kernel by >>> defining LOCAL_MODULES to the list of modules. Each is assumed to be >>> a subdirectory containing a valid Makefile. If LOCAL_MODULES is not >>> specified, all of the modules present in LOCALBASE/sys/modules are >>> built and installed along with the kernel. >>> >>> This means that a port that installs a kernel module can choose to >>> install its source along with a suitable Makefile to >>> /usr/local/sys/modules/. Future kernel builds will then include >>> that kernel module using the kernel configuration's opt_*.h headers >>> and install it into /boot/kernel along with other kernel-specific >>> modules. >>> >>> This is not trying to solve the issue of folks running GENERIC release >>> kernels, but is instead aimed at folks who build their own kernels. >>> For those folks this ensures that kernel modules from ports will >>> always be using the right KBI, etc. This includes folks running any >>> KBI-breaking kernel configs (such as PAE). >>> >>> There are still some kinks to be worked out with cross-building (we >>> probably shouldn't include local modules in cross-built kernels by >>> default), but this is a sufficient starting point. >>> >>> Reviewed by: imp >>> MFC after: 3 months >>> Relnotes: yes >>> Differential Revision: https://reviews.freebsd.org/D16966 >>> >>> Modified: >>> head/sys/conf/kern.post.mk >>> >>> Modified: head/sys/conf/kern.post.mk >>> ============================================================================== >>> --- head/sys/conf/kern.post.mk Tue Oct 30 00:22:14 2018 (r339900) >>> +++ head/sys/conf/kern.post.mk Tue Oct 30 00:23:37 2018 (r339901) >>> @@ -35,24 +35,41 @@ KERN_DEBUGDIR?= ${DEBUGDIR} >>> >>> .MAIN: all >>> >>> +.if !defined(NO_MODULES) >>> +# Default prefix used for modules installed from ports >>> +LOCALBASE?= /usr/local >>> + > > .if exists (${LOCALBASE}/sys/modules) >>> +LOCAL_MODULES_DIR?= ${LOCALBASE}/sys/modules > .endif > >>> + >>> +# Default to installing all modules installed by ports unless overridden >>> +# by the user. >>> +.if !defined(LOCAL_MODULES) >>> +LOCAL_MODULES!= ls ${LOCAL_MODULES_DIR} >>> +.endif >>> +.endif >> >> During a buildkernel I now get several instances of: >> >> ls: /usr/local/sys/modules: No such file or directory >> make[2]: "/usr/home/markj/src/freebsd-dev/sys/conf/kern.post.mk" line 47: warning: "ls /usr/local/sys/modules" returned non-zero status >> >> Perhaps /usr/local/sys/modules should be specified in the BSD.usr.dist >> mtree file? I think I prefer Rod's fix. I'll apply it in a bit. -- John Baldwin