Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Oct 2018 11:51:09 -0400
From:      Mark Johnston <markj@freebsd.org>
To:        John Baldwin <jhb@freebsd.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r339901 - head/sys/conf
Message-ID:  <20181030155109.GC39423@raichu>
In-Reply-To: <201810300023.w9U0NcOb048740@repo.freebsd.org>
References:  <201810300023.w9U0NcOb048740@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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/<foo>.  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
> +
> +LOCAL_MODULES_DIR?= ${LOCALBASE}/sys/modules
> +
> +# 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?



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