git » linux-firmware.git » commit d4ff0fa

linux-firmware 20240703.e94a2a3b

author Urja (ARMLFS builder)
2024-07-30 08:44:43 UTC
committer Urja (ARMLFS builder)
2024-07-30 08:44:43 UTC
parent 318771dd76516611a3126877c5d0a0bf041bbf62

linux-firmware 20240703.e94a2a3b

.gitignore +2 -0
PKGBUILD +19 -136
WHENCE.armlfs +105 -0
usb-firmware-list.txt +6 -0
usb-firmware.sh +8 -0

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..a43258a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+/src/
+/pkg/
diff --git a/PKGBUILD b/PKGBUILD
index 059b17f..fea73fd 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,35 +2,21 @@
 # Contributor: Thomas Bächler <thomas@archlinux.org>
 
 pkgbase=linux-firmware
-pkgname=(linux-firmware-whence linux-firmware amd-ucode
-         linux-firmware-{nfp,mellanox,marvell,qcom,liquidio,qlogic,bnx2x}
-)
+pkgname=(linux-firmware)
 _tag=20240709
 pkgver=20240703.e94a2a3b
-pkgrel=1
-pkgdesc="Firmware files for Linux"
+pkgrel=2
+pkgdesc="Firmware files for Linux (ARMLFS set)"
 url="https://gitlab.com/kernel-firmware/linux-firmware"
 license=('GPL2' 'GPL3' 'custom')
 arch=('any')
 makedepends=('git' 'rdfind')
 options=(!strip !debug)
-source=("git+$url.git?signed#tag=${_tag}")
-sha256sums=('5504403f513abdcee95756a15fb5a1ac13231e50c0dcadeeff54d5fcc0d330f5')
+source=("git+$url.git?signed#tag=${_tag}"
+ WHENCE.armlfs)
+sha256sums=('5504403f513abdcee95756a15fb5a1ac13231e50c0dcadeeff54d5fcc0d330f5' SKIP)
 validpgpkeys=('4CDE8575E547BF835FE15807A31B6BD72486CFD6') # Josh Boyer <jwboyer@fedoraproject.org>
 
-_backports=(
-)
-
-prepare() {
-  cd ${pkgbase}
-
-  local _c
-  for _c in "${_backports[@]}"; do
-    git log --oneline -1 "${_c}"
-    git cherry-pick -n "${_c}"
-  done
-}
-
 pkgver() {
   cd ${pkgbase}
 
@@ -38,132 +24,29 @@ pkgver() {
   echo $(TZ=UTC git show -s --pretty=%cd --date=format-local:%Y%m%d HEAD).$(git rev-parse --short HEAD)
 }
 
-build() {
-  mkdir -p kernel/x86/microcode
-  cat ${pkgbase}/amd-ucode/microcode_amd*.bin > kernel/x86/microcode/AuthenticAMD.bin
-
-  # Reproducibility: set the timestamp on the bin file
-  if [[ -n ${SOURCE_DATE_EPOCH} ]]; then
-    touch -d @${SOURCE_DATE_EPOCH} kernel/x86/microcode/AuthenticAMD.bin
-  fi
-
-  # Reproducibility: strip the inode and device numbers from the cpio archive
-  echo kernel/x86/microcode/AuthenticAMD.bin |
-    bsdtar --uid 0 --gid 0 -cnf - -T - |
-    bsdtar --null -cf - --format=newc @- > amd-ucode.img
-}
-
-_pick() {
-  local p="$1" f d; shift
-  for f; do
-    d="$srcdir/$p/${f#$pkgdir/}"
-    mkdir -p "$(dirname "$d")"
-    mv "$f" "$d"
-    rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
-  done
-}
-
-package_linux-firmware-whence() {
-  pkgdesc+=" - contains the WHENCE license file which documents the vendor license details"
-
-  install -Dt "${pkgdir}/usr/share/licenses/${pkgname}" -m644 ${pkgbase}/WHENCE
+prepare() {
+  # The WHENCE files controls the install process, so overwriting it
+  # allows us to cleanly pick the firmwares we want.
+  #return 1
+  cat WHENCE.armlfs > "${pkgbase}"/WHENCE
 }
 
 package_linux-firmware() {
-  depends=('linux-firmware-whence')
+  local _LICS=(
+  WHENCE
+  LICENCE.atheros_firmware
+  LICENCE.open-ath9k-htc-firmware
+  LICENCE.rtlwifi_firmware.txt
+  LICENCE.NXP
+  )
 
   cd ${pkgbase}
 
   ZSTD_CLEVEL=19 make DESTDIR="${pkgdir}" FIRMWAREDIR=/usr/lib/firmware install-zst
 
-  install -Dt "${pkgdir}/usr/share/licenses/${pkgname}" -m644 LICEN*
-
-  cd "${pkgdir}"
-
-  # remove arm64 firmware https://bugs.archlinux.org/task/76583
-  rm usr/lib/firmware/mrvl/prestera/mvsw_prestera_fw_arm64-v4.1.img.zst
-
-  # split
-  _pick amd-ucode usr/lib/firmware/amd-ucode
-
-  _pick linux-firmware-nfp usr/lib/firmware/netronome
-  _pick linux-firmware-nfp usr/share/licenses/${pkgname}/LICENCE.Netronome
-
-  _pick linux-firmware-mellanox usr/lib/firmware/mellanox
-
-  _pick linux-firmware-marvell usr/lib/firmware/{libertas,mwl8k,mwlwifi,mrvl}
-  _pick linux-firmware-marvell usr/share/licenses/${pkgname}/LICENCE.{Marvell,NXP}
-
-  _pick linux-firmware-qcom usr/lib/firmware/{qcom,a300_*}
-  _pick linux-firmware-qcom usr/share/licenses/${pkgname}/LICENSE.qcom*
-
-  _pick linux-firmware-liquidio usr/lib/firmware/liquidio
-  _pick linux-firmware-liquidio usr/share/licenses/${pkgname}/LICENCE.cavium_liquidio
-
-  _pick linux-firmware-qlogic usr/lib/firmware/{qlogic,qed,ql2???_*,c{b,t,t2}fw-*}
-  _pick linux-firmware-qlogic usr/share/licenses/${pkgname}/LICENCE.{qla1280,qla2xxx}
-
-  _pick linux-firmware-bnx2x usr/lib/firmware/bnx2x*
-}
-
-package_amd-ucode() {
-  pkgdesc="Microcode update image for AMD CPUs"
-  license=(custom)
-
-  mv -v $pkgname/* "$pkgdir"
-
-  install -Dt "${pkgdir}/boot" -m644 amd-ucode.img
-
-  install -Dt "${pkgdir}/usr/share/licenses/${pkgname}" -m644 ${pkgbase}/LICENSE.amd-ucode
-}
-
-package_linux-firmware-nfp() {
-  pkgdesc+=" - nfp / Firmware for Netronome Flow Processors"
-  depends=('linux-firmware-whence')
-
-  mv -v linux-firmware-nfp/* "${pkgdir}"
-}
-
-package_linux-firmware-mellanox() {
-  pkgdesc+=" - mellanox / Firmware for Mellanox Spectrum switches"
-  depends=('linux-firmware-whence')
-
-  mv -v linux-firmware-mellanox/* "${pkgdir}"
-}
+  install -Dt "${pkgdir}/usr/share/licenses/${pkgname}" -m644 "${_LICS[@]}"
 
-package_linux-firmware-marvell() {
-  pkgdesc+=" - marvell / Firmware for Marvell devices"
-  depends=('linux-firmware-whence')
-
-  mv -v linux-firmware-marvell/* "${pkgdir}"
-}
-
-package_linux-firmware-qcom() {
-  pkgdesc+=" - qcom / Firmware for Qualcomm SoCs"
-  depends=('linux-firmware-whence')
-
-  mv -v linux-firmware-qcom/* "${pkgdir}"
-}
-
-package_linux-firmware-liquidio() {
-  pkgdesc+=" - liquidio / Firmware for Cavium LiquidIO server adapters"
-  depends=('linux-firmware-whence')
-
-  mv -v linux-firmware-liquidio/* "${pkgdir}"
-}
-
-package_linux-firmware-qlogic() {
-  pkgdesc+=" - qlogic / Firmware for QLogic devices"
-  depends=('linux-firmware-whence')
-
-  mv -v linux-firmware-qlogic/* "${pkgdir}"
 }
 
-package_linux-firmware-bnx2x() {
-  pkgdesc+=" - bnx2x / Firmware for Broadcom NetXtreme II 10Gb ethernet adapters"
-  depends=('linux-firmware-whence')
-
-  mv -v linux-firmware-bnx2x/* "${pkgdir}"
-}
 
 # vim:set sw=2 et:
diff --git a/WHENCE.armlfs b/WHENCE.armlfs
new file mode 100644
index 0000000..2d0629b
--- /dev/null
+++ b/WHENCE.armlfs
@@ -0,0 +1,105 @@
+             **********
+             * WHENCE *
+             **********
+
+This file attempts to document the origin and licensing information,
+if known, for each piece of firmware distributed for use with the Linux
+kernel.
+Modified for ARMLFS to only include firmware for the USB devices
+we build drivers for.
+
+--------------------------------------------------------------------------
+
+Driver: ath9k_htc - Atheros HTC devices (USB)
+
+File: ar9271.fw
+File: ar7010.fw
+File: ar7010_1_1.fw
+File: htc_9271.fw
+Version: 1.3.1
+File: htc_7010.fw
+Version: 1.3.1
+
+Licence: Redistributable. See LICENCE.atheros_firmware for details
+
+File: ath9k_htc/htc_7010-1.4.0.fw
+Version: 1.4.0
+File: ath9k_htc/htc_9271-1.4.0.fw
+Version: 1.4.0
+
+Licence: Free software. See LICENCE.open-ath9k-htc-firmware for details
+
+--------------------------------------------------------------------------
+
+Driver: mwifiex - Marvell Wi-Fi fullmac-type 802.11n/ac cards
+
+File: mrvl/sd8787_uapsta.bin
+Version: W14.68.35.p66
+
+File: mrvl/usb8766_uapsta.bin
+Version: 14.68.22.p16
+
+File: mrvl/sd8797_uapsta.bin
+Version: W14.68.29.p59
+
+File: mrvl/usb8797_uapsta.bin
+Version: W14.68.29.p60
+
+File: mrvl/sd8897_uapsta.bin
+Version: W15.68.19.17
+
+File: mrvl/usb8897_uapsta.bin
+Version: 15.68.4.p103
+
+File: mrvl/pcie8897_uapsta.bin
+Version: W15.68.19.p21
+
+File: mrvl/sd8887_uapsta.bin
+Version: W15.68.7.p189
+
+File: mrvl/sd8801_uapsta.bin
+Version: W14.68.36.p204
+
+File: mrvl/usb8801_uapsta.bin
+Version: W14.68.36.p138
+
+File: mrvl/pcieuart8997_combo_v4.bin
+Version: W16.68.1.p179
+
+File: mrvl/pcieusb8997_combo_v4.bin
+Version: W16.68.10.p159.1
+
+File: mrvl/pcie8997_wlan_v4.bin
+Version: W16.68.10.p159.1
+
+File: mrvl/usbusb8997_combo_v4.bin
+Version: W16.68.1.p183
+
+File: mrvl/sdsd8997_combo_v4.bin
+Version: W16.68.1.p179
+
+File: mrvl/sdsd8977_combo_v2.bin
+Version: W16.68.1.p195
+
+Licence: Redistributable. See LICENCE.NXP for details.
+Originates from https://github.com/NXP/mwifiex-firmware.git
+
+--------------------------------------------------------------------------
+
+Driver: rtl8192cu - Realtek 802.11n WLAN driver for RTL8192CU
+
+File: rtlwifi/rtl8192cufw.bin
+File: rtlwifi/rtl8192cufw_A.bin
+File: rtlwifi/rtl8192cufw_B.bin
+File: rtlwifi/rtl8192cufw_TMSC.bin
+Info: From Vendor's rtl8188C_8192C_usb_linux_v4.0.1_6911.20130308 driver
+      All files extracted from driver/hal/rtl8192c/usb/Hal8192CUHWImg.c
+      Relevant variables (CONFIG_BT_COEXISTENCE not set):
+        - rtlwifi/rtl8192cufw_A.bin: Rtl8192CUFwUMCACutImgArray
+        - rtlwifi/rtl8192cufw_B.bin: Rtl8192CUFwUMCBCutImgArray
+        - rtlwifi/rtl8192cufw_TMSC.bin: Rtl8192CUFwTSMCImgArray
+
+Licence: Redistributable. See LICENCE.rtlwifi_firmware.txt for details.
+
+--------------------------------------------------------------------------
+
diff --git a/usb-firmware-list.txt b/usb-firmware-list.txt
new file mode 100644
index 0000000..c036065
--- /dev/null
+++ b/usb-firmware-list.txt
@@ -0,0 +1,6 @@
+rtlwifi/rtl8192cufw_TMSC.bin
+rtlwifi/rtl8192cufw_B.bin
+rtlwifi/rtl8192cufw_A.bin
+rtlwifi/rtl8192cufw.bin
+ath9k_htc/htc_9271-1.4.0.fw
+ath9k_htc/htc_7010-1.4.0.fw
diff --git a/usb-firmware.sh b/usb-firmware.sh
new file mode 100755
index 0000000..e8b2daf
--- /dev/null
+++ b/usb-firmware.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+# Run from a directory containing the kernel modules
+for mod in $(find -name '*.ko*'); do
+	USB=$(modinfo $mod | grep -E '^alias:.*usb:')
+	if [ -n "$USB" ]; then
+		modinfo $mod | grep '^firmware:' | cut -b 17- >> usb-firmware-list.txt
+	fi
+done