]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Permit local kernel modules to be built as part of a kernel build.
authorJohn Baldwin <jhb@FreeBSD.org>
Tue, 30 Oct 2018 00:23:37 +0000 (00:23 +0000)
committerJohn Baldwin <jhb@FreeBSD.org>
Tue, 30 Oct 2018 00:23:37 +0000 (00:23 +0000)
commitcd785c1b34467c93168697ab1d8d733266730b3b
treeb386453cd0fc3cc6b44858e09240e4c2a4181e1a
parent25c9cca75768bbbd1f970d5b5da5d3773e20b080
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
sys/conf/kern.post.mk