Page MenuHomeFreeBSD

D57859.id180662.diff
No OneTemporary

D57859.id180662.diff

diff --git a/share/man/man7/build.7 b/share/man/man7/build.7
--- a/share/man/man7/build.7
+++ b/share/man/man7/build.7
@@ -1116,6 +1116,25 @@
cd /usr/src/sys/modules/sound
make all install clean cleandepend KMODDIR=/boot/kernel
.Ed
+.Pp
+Important detail is that the kernel binary interface is affected
+by its configuration.
+Modules build outside of the regular kernel build procedure still
+must be built against the target kernel configuration, which is
+defined by the set of the
+.Pa opt_*.h
+headers generated by
+.Xr config 8 .
+Use the
+.Va KERNBUILDDIR
+variable to point the module build to the configured kernel.
+There is no need to actually build the configured kernel in
+that directory, module build only consumes the headers from it.
+.Bd -literal -offset -indent
+config -d /home/user/my-kernel-builddir MY-KERNEL
+cd my-module
+make all KERNBUILDDIR=/home/user/my-kernel-builddir
+.Ed
.Ss Example 5: Quickly rebuild a kernel in place
Quickly rebuild and reinstall the kernel, only recompiling the files
changed since last build; note that this will only work if the full

File Metadata

Mime Type
text/plain
Expires
Fri, Aug 28, 8:11 PM (13 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34375538
Default Alt Text
D57859.id180662.diff (1 KB)

Event Timeline