From nobody Fri Nov 01 02:27:53 2024 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XflBx6cpmz5bRkM; Fri, 01 Nov 2024 02:27:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XflBx64qwz4WpZ; Fri, 1 Nov 2024 02:27:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730428073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bhu2rgE8t4UUNQW08Yb9g7EOukHJ7RU3XpNBItRgyHA=; b=FNgvOxXjVy7vOISa3UaKeHB39i6MGB4z7AHvs7HJUb17ztRfx+yhyIKGWGyXOANxK6PV/L 0E3WO8sgH68Stg2RZinj83PsNd45v4vorlWqM+grDdJKUvJBLEQNQt0z8n2CMfX6tXOD/l fqvZRpIsDPrRAMZdgINSzxuTgSMAOZAFZ7Zv/lOCcfPVMT2o6oqwEkIsY9ekOJvJtJrpmN 0MzobUiF5Te8nphACsZ7G87gcjRfOtp7UTig2Q185TFkXkUtNN1aCG2LsGbkpskzvlxpsC rpDGI9VHdAYu4Ank15bEVWv40Sp2bq2wZMXcc/UPSqm+a9WYBLnnsKqm4M//Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730428073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bhu2rgE8t4UUNQW08Yb9g7EOukHJ7RU3XpNBItRgyHA=; b=VFUIapCq4msVukLqDLCmGqPQDJwqmHFw+8SnfrK9R/vzZ7/yIgU875n3iWInBllUT4hFlq g2j2RRel6muC2OJiTke+SgcT9Nkxo878K83o7a47ozIns6LKJdQSNztJ9am40y1JsCiEfv t7Baa25TVcOPCd8f/bTMDcXmvg4eBpxBh6iMihgjUAo097gEUs/4e/F460RSTu5K6Cr7l2 sfV5eVBDBX90Dvc6+rktcB4YOCas/JcWvqZ4jxiFs8kfPMFFaTNszM52PMLfNF4RLVDSYH KjJKUvU3ZceZVl5cAjdVyvLBO7Ic02wtd3i4sK+zGubCHppmmgyUqBP6fQB9sw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730428073; a=rsa-sha256; cv=none; b=Y2QAzNetxoY/O3O4UB29CAoNHRAukcKk8uVVtF7XgqXhtZIIOX6W3/DH/s0/m/GDLpfyvn PonVFu39lB2Hy2yt8D1v6mkoxJH2kstsdu8FrlXzfAw7R9/otC0CdyH87f/W6G2nVO/zGD bs6752hLE35D8OOng1Hv+3YxXI4GZjNGYeTzWJe7Y9uYDnsMCnnbnVvTSdBDB6sAt027FV eq3t9PAyvOw9PZN639yHtxqCX3PMuQqrGA2U9VdxzS/oML66v1G63iljqpHSBoPYdtBQA3 nWOE99RnHSLqfQmp6qdHHCbSgxFz+G295u6777tyg+uw+6pOdkUSo82quFrCZA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XflBx5hBwz12BP; Fri, 1 Nov 2024 02:27:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A12RrRw039828; Fri, 1 Nov 2024 02:27:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A12Rr16039825; Fri, 1 Nov 2024 02:27:53 GMT (envelope-from git) Date: Fri, 1 Nov 2024 02:27:53 GMT Message-Id: <202411010227.4A12Rr16039825@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 7a02aa98f615 - main - net/wifi-firmware-kmod: stop building kmods on main and 14.2 and on List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-main@freebsd.org Sender: owner-dev-commits-ports-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7a02aa98f615f499ee7e3cb87cec9d3da4f3d80b Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/ports/commit/?id=7a02aa98f615f499ee7e3cb87cec9d3da4f3d80b commit 7a02aa98f615f499ee7e3cb87cec9d3da4f3d80b Author: Bjoern A. Zeeb AuthorDate: 2024-10-11 20:41:29 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-11-01 02:10:59 +0000 net/wifi-firmware-kmod: stop building kmods on main and 14.2 and on In Feb 2024 a feature to firmware(9) was introduced to be able to load plain firmware files (not kernel modules) from /boot/firmware/ . If the system is modern enough stop building kernel modules but simply copy the firmware files in. This makes the entire build process a lot simpler. For older versions we still have to generate kernel modules (though they all shipped with firmware in src so we can possibly unsupport them in the future). Sponsored by: The FreeBSD Foundation Reviewed by: jrm, imp Differential Revision: https://reviews.freebsd.org/D47068 --- net/wifi-firmware-kmod/Makefile.inc | 54 ++++++++++++++++++++++++++++++------- 1 file changed, 45 insertions(+), 9 deletions(-) diff --git a/net/wifi-firmware-kmod/Makefile.inc b/net/wifi-firmware-kmod/Makefile.inc index fa3bb2068848..f592ac252d75 100644 --- a/net/wifi-firmware-kmod/Makefile.inc +++ b/net/wifi-firmware-kmod/Makefile.inc @@ -49,16 +49,13 @@ LICENSE_PERMS_whence= ${LICENSE_PERMS} .if "${DISTFILES_${FLAVOR}_lic}" .for _n in ${DISTFILES_${FLAVOR}_lic:range} LICENSE+= extra${_n} -LICENSE_FILE_extra${_n}= ${WRKSRC}/fw/${DISTFILES_${FLAVOR}_lic:[${_n}]:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@:S,/,_,g} +LICENSE_FILE_extra${_n}= ${WRKSRC}/lic/${DISTFILES_${FLAVOR}_lic:[${_n}]:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@:S,/,_,g} LICENSE_NAME_extra${_n}= ${LICENSE_NAME} (extra fw license) LICENSE_PERMS_extra${_n}= ${LICENSE_PERMS} .endfor .endif -# Add firmware files to plist. -.for _f in ${DISTFILES_${FLAVOR}} -PLIST_FILES+= ${KMODDIR}/${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@:S,.,_,g:S,-,_,g:S,/,_,g}.ko -.endfor +PLIST= ${WRKDIR}/PLIST # Split things into the full package (driver name) and more specific flavors. FLAVORS= ${FWDRV} \ @@ -82,17 +79,48 @@ EXTRACT_ONLY= ONLY_FOR_ARCHS= aarch64 amd64 i386 ONLY_FOR_ARCHS_REASON= LinuxKPI driver only available for these architectures -USES= kmod uidfix - +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 + +.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. +BOOTFWDIR?= /boot/firmware +_SHAREMODE= 0444 +NO_BUILD= yes +.else MAKE_ENV+= FWSRCDIR=${WRKSRC}/fw +.endif post-extract: @${MKDIR} ${WRKSRC}/fw + @${MKDIR} ${WRKSRC}/lic # Deal with supplementary licenses files. @${CP} ${DISTDIR}/${DIST_SUBDIR}/${LICENSE_FILE}${DISTURL_SUFFIX} ${WRKSRC}/${LICENSE_FILE} @${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 +################################################################################ +.if (${OSVERSION} >= 1500014) || (${OSVERSION} < 1500000 && ${OSVERSION} >= 1402000) +.for _f in ${DISTFILES_${FLAVOR}} + # 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 + (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" \ @@ -114,11 +142,19 @@ post-extract: # 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}/fw/${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@:S,/,_,g} + ${CP} ${DISTDIR}/${DIST_SUBDIR}/${_f} ${WRKSRC}/lic/${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@:S,/,_,g} .endfor -.include +.if (${OSVERSION} >= 1500014) || (${OSVERSION} < 1500000 && ${OSVERSION} >= 1402000) +do-install: + (cd ${WRKSRC}/fw/ && ${COPYTREE_SHARE} . ${STAGEDIR}/${BOOTFWDIR}) +.endif + +.include