git: 1556932a72 - main - Handbook - Kernelconfig: Restore PORTS_MODULES section

From: Sergio Carlavilla Delgado <carlavilla_at_FreeBSD.org>
Date: Fri, 13 Feb 2026 18:34:06 UTC
The branch main has been updated by carlavilla:

URL: https://cgit.FreeBSD.org/doc/commit/?id=1556932a7258a8d0090a0e85440fd0c9753e59ab

commit 1556932a7258a8d0090a0e85440fd0c9753e59ab
Author:     Sergio Carlavilla Delgado <carlavilla@FreeBSD.org>
AuthorDate: 2026-02-13 18:33:15 +0000
Commit:     Sergio Carlavilla Delgado <carlavilla@FreeBSD.org>
CommitDate: 2026-02-13 18:33:15 +0000

    Handbook - Kernelconfig: Restore PORTS_MODULES section
    
    Reported by:    des@
---
 .../en/books/handbook/kernelconfig/_index.adoc      | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/documentation/content/en/books/handbook/kernelconfig/_index.adoc b/documentation/content/en/books/handbook/kernelconfig/_index.adoc
index 9769a57018..aa8e845f14 100644
--- a/documentation/content/en/books/handbook/kernelconfig/_index.adoc
+++ b/documentation/content/en/books/handbook/kernelconfig/_index.adoc
@@ -292,8 +292,7 @@ Once the edits to the custom configuration file have been saved, the source code
 # make installkernel KERNCONF=MYKERNEL
 ....
 +
-. Shutdown the system and reboot into the new kernel. If something goes wrong,
-  refer to crossref:kernelconfig[kernelconfig-noboot, The kernel does not boot].
+. Shutdown the system and reboot into the new kernel. If something goes wrong, refer to crossref:kernelconfig[kernelconfig-noboot, The kernel does not boot].
 ====
 
 By default, when a custom kernel is compiled, all kernel modules are rebuilt.
@@ -313,6 +312,24 @@ Alternately, this variable lists which modules to exclude from the build process
 WITHOUT_MODULES = linux acpi sound
 ....
 
+This variable instructs the build to skip kernel modules and compile only the kernel itself:
+
+[.programlisting]
+....
+NO_MODULES = yes
+....
+
+The Ports Framework includes drivers and other modules that depend on kernel interfaces, such as package:graphics/drm-kmod[] or package:emulators/virtualbox-ose-kmod[].
+With the `PORTS_MODULES` variable, every time the kernel is built, the ports containing kernel modules are re‑built against the updated sources.
+This ensures the kernel module stays in‑sync with the kernel itself.
+The kernel and ports trees should be updated together for maximum compatibility.
+`PORTS_MODULES` can be added to [.filename]#/etc/make.conf# to ensure all kernels you build also rebuild these modules.
+
+[.programlisting]
+....
+PORTS_MODULES = drm-kmod virtualbox-ose-kmod
+....
+
 Additional variables are available.
 Refer to man:make.conf[5] for details.