mirror of
https://git.freebsd.org/ports.git
synced 2025-04-28 01:26:39 -04:00
net/wifi-firmware-*: add support to set loader tunable
For drivers which currently need to set the compat.linuxkpi.skb.mem_limit tunable add an option to the build to create it automatically for each FLAVOR. There is no harm if it is there multiple times setting it to the same value (apart from file including and parsing overhead in loader -- however that works). Add the option to the rtw88 and rtw89 wifi-firmware Makefile. Having it with the firmware package has multiple advantages: - the user does not have to do any manual configuration anymore - we do not have to configure setting it into the release builds - bsdinstall does not need to know about it to set for the installed system (depending on driver). Bump PORTREVISION. Sponsored by: The FreeBSD Foundation MFC after: 1 minute X-MFC for: releng 14.2 Differential Revision: https://reviews.freebsd.org/D47481
This commit is contained in:
parent
c65c03c3a4
commit
be7bdd6616
3 changed files with 21 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
|||
PORTNAME= wifi-firmware-${FWDRV}-kmod
|
||||
PORTVERSION= ${FWDRV_VERSION}
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= net
|
||||
MASTER_SITES= https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/ \
|
||||
https://ams.source.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/ \
|
||||
|
@ -84,6 +85,8 @@ USES= uidfix
|
|||
# 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)
|
||||
|
@ -106,6 +109,12 @@ post-extract:
|
|||
@${CP} ${DISTDIR}/${DIST_SUBDIR}/WHENCE${DISTURL_SUFFIX} ${WRKSRC}/WHENCE.in
|
||||
@${SED} -e "s@%%XXX%%@${WHENCE_REGEX:Q}@g" ${FILESDIR}/WHENCE.awk.in > ${WRKSRC}/WHENCE.awk
|
||||
@${AWK} -f ${WRKSRC}/WHENCE.awk ${WRKSRC}/WHENCE.in > ${WRKSRC}/WHENCE
|
||||
# Do we need to set a tunable?
|
||||
.if defined(COMPAT_LINUXKPI_SKB_MEM_LIMIT) && ${COMPAT_LINUXKPI_SKB_MEM_LIMIT} > 0
|
||||
@${MKDIR} ${WRKSRC}/${BOOT_LOADERCONFD}
|
||||
@${ECHO_CMD} "compat.linuxkpi.skb.mem_limit=${COMPAT_LINUXKPI_SKB_MEM_LIMIT}" > ${WRKSRC}/${BOOT_LOADERCONFD}/${FLAVOR}.conf
|
||||
@${ECHO_CMD} "${BOOT_LOADERCONFD}/${FLAVOR}.conf" >> ${PLIST}
|
||||
.endif
|
||||
################################################################################
|
||||
.if (${OSVERSION} >= 1500014) || (${OSVERSION} < 1500000 && ${OSVERSION} >= 1402000)
|
||||
.for _f in ${DISTFILES_${FLAVOR}}
|
||||
|
@ -117,7 +126,7 @@ post-extract:
|
|||
(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}
|
||||
@${SORT} -u ${PLIST}.tmp >> ${PLIST}
|
||||
.else
|
||||
################################################################################
|
||||
# Build kernel modules.
|
||||
|
@ -157,4 +166,11 @@ do-install:
|
|||
(cd ${WRKSRC}/fw/ && ${COPYTREE_SHARE} . ${STAGEDIR}/${BOOTFWDIR})
|
||||
.endif
|
||||
|
||||
.if defined(COMPAT_LINUXKPI_SKB_MEM_LIMIT) && ${COMPAT_LINUXKPI_SKB_MEM_LIMIT} > 0
|
||||
post-install:
|
||||
@${MKDIR} ${STAGEDIR}/${BOOT_LOADERCONFD}
|
||||
@${INSTALL_DATA} ${WRKSRC}/${BOOT_LOADERCONFD}/${FLAVOR}.conf ${STAGEDIR}/${BOOT_LOADERCONFD}/${FLAVOR}.conf
|
||||
.endif
|
||||
|
||||
|
||||
.include <bsd.port.post.mk>
|
||||
|
|
|
@ -13,6 +13,8 @@ LICENSE_NAME= Realtek firmware license (${FWDRV})
|
|||
|
||||
WHENCE_REGEX= rtw88 -.*
|
||||
|
||||
COMPAT_LINUXKPI_SKB_MEM_LIMIT= 1
|
||||
|
||||
# The flavor/firmware lists below are generated by a script
|
||||
# also helping to generate the fwget(8) definitions.
|
||||
# { sys/contrib/dev/rtw88/zzz_fw_ports_fwget.sh }
|
||||
|
|
|
@ -10,6 +10,8 @@ LICENSE_NAME= Realtek firmware license (${FWDRV})
|
|||
|
||||
WHENCE_REGEX= rtw89 -.*
|
||||
|
||||
COMPAT_LINUXKPI_SKB_MEM_LIMIT= 1
|
||||
|
||||
# The flavor/firmware lists below are generated by a script
|
||||
# also helping to generate the fwget(8) definitions.
|
||||
# { sys/contrib/dev/rtw89/zzz_fw_ports_fwget.sh }
|
||||
|
|
Loading…
Add table
Reference in a new issue