git: ac61f18d6fbb - main - net/wifi-firmware-kmod: remove obsolete kernel module build code
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 11 Dec 2025 23:26:25 UTC
The branch main has been updated by bz:
URL: https://cgit.FreeBSD.org/ports/commit/?id=ac61f18d6fbb373a892a3366efa75d590b0a423a
commit ac61f18d6fbb373a892a3366efa75d590b0a423a
Author: Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2025-11-11 01:18:05 +0000
Commit: Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2025-12-11 23:26:09 +0000
net/wifi-firmware-kmod: remove obsolete kernel module build code
All supported FreeBSD versions either shipped firmware along with
source and do not need this, or they support plain firmware file
loading.
Remove the now obsolete kernel module build code to simplify the
logic in the file. Further cleanup will be done once 13.5-R is
out of support in a few months.
Sponsored by: The FreeBSD Foundation
Reviewed by: jrm
Differential Revision: https://reviews.freebsd.org/D53679
---
net/wifi-firmware-kmod/Makefile.inc | 56 +++++++++----------------------------
1 file changed, 13 insertions(+), 43 deletions(-)
diff --git a/net/wifi-firmware-kmod/Makefile.inc b/net/wifi-firmware-kmod/Makefile.inc
index cdd2f657ff55..ee5194eeb608 100644
--- a/net/wifi-firmware-kmod/Makefile.inc
+++ b/net/wifi-firmware-kmod/Makefile.inc
@@ -82,25 +82,25 @@ ONLY_FOR_ARCHS= aarch64 amd64 i386
ONLY_FOR_ARCHS_REASON= LinuxKPI driver only available for these architectures
USES= uidfix
-# We do not need that anymore for the modern build but making it conditional on
-# OSVERSION seems to not add the _USES_install bits from kmod.mk.
-USES+= kmod
-
-BOOT_LOADERCONFD= /boot/loader.conf.d
.include <bsd.port.pre.mk>
-.if (${OSVERSION} >= 1500014) || (${OSVERSION} < 1500000 && ${OSVERSION} >= 1402000)
# src.git main 479905a1ed26c54ef29cdff65cf25f7feade654b (stable/14 2ca7b03d6275)
-# allows direct loading of firmware files. For anything before that we still need
-# to create kernel modules. We need to write a PLIST file so we can then simply use
-# COPYTREE_SHARE with adjusted permissions to copy the files over.
+# allows direct loading of firmware files.
+# We write a PLIST file so we can then simply use COPYTREE_SHARE with adjusted
+# permissions to copy the files over.
+.if (${OSVERSION} < 1402000) || (${OSVERSION} >= 1500000 && ${OSVERSION} < 1500014)
+# For 13.5, which is the last supported release before plain firmware loading is
+# implemented, we did ship firmware in src/ still so there is no need to build.
+# Also mtw (mt7601u) was never in a version earlier than this.
+# XXX remove comment after April 2026 when 13.5 goes out of support as well.
+IGNORE= Not supported for this osversion.
+.endif
+
+BOOT_LOADERCONFD= /boot/loader.conf.d
BOOTFWDIR?= /boot/firmware
_SHAREMODE= 0444
NO_BUILD= yes
-.else
-MAKE_ENV+= FWSRCDIR=${WRKSRC}/fw
-.endif
post-extract:
@${MKDIR} ${WRKSRC}/fw
@@ -126,55 +126,25 @@ post-extract:
@${ECHO_CMD} "${BOOT_LOADERCONFD}/iwlwifi-${FLAVOR}.conf" >> ${PLIST}
.endif
################################################################################
-.if (${OSVERSION} >= 1500014) || (${OSVERSION} < 1500000 && ${OSVERSION} >= 1402000)
.for _f in ${DISTFILES_${FLAVOR}:O:u}
# Create firmware source directory and copy in distfile.
@${MKDIR} ${WRKSRC}/fw/${_f:H}
${CP} ${DISTDIR}/${DIST_SUBDIR}/${_f} ${WRKSRC}/fw/${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@}
@${ECHO_CMD} ${BOOTFWDIR}/${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@} >> ${PLIST}.tmp
.endfor
+ # Create PLIST for firmware files.
(cd ${WRKSRC}/fw/ && ${FIND} . -type d -mindepth 1 | \
${AWK} -vB="${BOOTFWDIR}/" '{ sub("^./", "@dir "B); print; }') >> ${PLIST}.tmp
# Remove possibly duplicate @dir entries
@${SORT} -u ${PLIST}.tmp >> ${PLIST}
-.else
################################################################################
-# Build kernel modules.
- # Prepare toplevel Makefile and Makefile.inc.
- @${ECHO_CMD} "SUBDIR=" > ${WRKSRC}/Makefile
- @${SED} -e "s@%%FWDRV%%@${FWDRV}@g" \
- -e "s@%%FWSUBDIR%%@${FWSUBDIR}@g" \
- ${FILESDIR}/Makefile.inc.in > ${WRKSRC}/Makefile.inc
-.for _f in ${DISTFILES_${FLAVOR}:O:u}
- # We remove '.' and '-' as well as '/' as they don't work well in loader.conf.
- @${MKDIR} ${WRKSRC}/${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@:S,.,_,g:S,-,_,g:S,/,_,g}
- # Create subdir (firmware file) Makefile.
- @${ECHO_CMD} "FWNAME=${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@:T}" > ${WRKSRC}/${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@:S,.,_,g:S,-,_,g:S,/,_,g}/Makefile
-.if (${_f:H:C,^[^/]*,,1:C,^/,,} != "")
- @${ECHO_CMD} "FWSUBSUBDIR=${_f:H:C,^[^/]*,,1:C,^/,,}" >> ${WRKSRC}/${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@:S,.,_,g:S,-,_,g:S,/,_,g}/Makefile
-.endif
- # XXX-BZ recover firmware versions later again from somewhere? Pain to keep track though, else use 0 or ${FWDRV_VERSION}?
- @${ECHO_CMD} "VERSION=0" >> ${WRKSRC}/${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@:S,.,_,g:S,-,_,g:S,/,_,g}/Makefile
- @${ECHO_CMD} '.include <bsd.kmod.mk>' >> ${WRKSRC}/${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@:S,.,_,g:S,-,_,g:S,/,_,g}/Makefile
- # Add subdir to top-level Makefile.
- @${ECHO_CMD} "SUBDIR+=${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@:S,.,_,g:S,-,_,g:S,/,_,g}" >> ${WRKSRC}/Makefile
- # Create firmware source directory and copy in distfile.
- @${MKDIR} ${WRKSRC}/fw/${_f:H}
- ${CP} ${DISTDIR}/${DIST_SUBDIR}/${_f} ${WRKSRC}/fw/${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@}
- @${ECHO_CMD} ${KMODDIR}/${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@:S,.,_,g:S,-,_,g:S,/,_,g}.ko >> ${PLIST}
-.endfor
- @${ECHO_CMD} '.include <bsd.subdir.mk>' >> ${WRKSRC}/Makefile
-################################################################################
-.endif
# Copy in additional licenses files.
.for _f in ${DISTFILES_${FLAVOR}_lic}
${CP} ${DISTDIR}/${DIST_SUBDIR}/${_f} ${WRKSRC}/lic/${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@:S,/,_,g}
.endfor
-.if (${OSVERSION} >= 1500014) || (${OSVERSION} < 1500000 && ${OSVERSION} >= 1402000)
do-install:
(cd ${WRKSRC}/fw/ && ${COPYTREE_SHARE} . ${STAGEDIR}/${BOOTFWDIR})
-.endif
post-install:
.if defined(COMPAT_LINUXKPI_SKB_MEM_LIMIT) && ${COMPAT_LINUXKPI_SKB_MEM_LIMIT} > 0