Index: net/wifi-firmware-kmod/Makefile.inc =================================================================== --- net/wifi-firmware-kmod/Makefile.inc +++ net/wifi-firmware-kmod/Makefile.inc @@ -84,23 +84,28 @@ 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. +# Also this is the only way to triger updates in case of __FreeBSD_version bumps +# which we may need to adhere to. USES+= kmod BOOT_LOADERCONFD= /boot/loader.conf.d .include -.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. +# XXX remove comment after April 2026 when 13.5 goes out of support as well. +IGNORE= Not supported for this osversion. +.endif + BOOTFWDIR?= /boot/firmware _SHAREMODE= 0444 NO_BUILD= yes -.else -MAKE_ENV+= FWSRCDIR=${WRKSRC}/fw -.endif post-extract: @${MKDIR} ${WRKSRC}/fw @@ -126,7 +131,6 @@ @${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} @@ -137,44 +141,14 @@ ${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 ' >> ${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 ' >> ${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