new blfs: sys-kernel/linux-firmware-20250808

This commit is contained in:
2026-01-01 16:43:53 -05:00
parent 148541fee7
commit 1c71413403
2 changed files with 143 additions and 0 deletions

View File

@@ -0,0 +1,86 @@
pkgname=linux-firmware
pkgver=20250808
pkgdesc="Firmware files for Linux"
homepage="https://gitlab.com/kernel-firmware/linux-firmware"
license=("GPL-2" "GPL-2+" "GPL-3" "BSD" "MIT" "MPL-1.1" "linux-fw-redistributable")
arch=(any)
sources=("${pkgname}-${pkgver}.tar.xz"
"linux-firmware-copy-firmware-r9.patch"
)
urls=("https://mirrors.edge.kernel.org/pub/linux/kernel/firmware/${sources[0]}"
"linux-firmware-copy-firmware-r9.patch"
)
md5sums=("e908a4b3f2247fe895f4411d0240f780"
"01969acb02d879f90a2656da32988c0b"
)
options=(!strip)
src_prepare() {
tar -xf ${distdir}/${sources[0]} --strip-components=1
# from Gentoo
patch -p1 -i ${filedir}/${sources[1]}
local unknown_license=(
korg/k1212.dsp
ess/maestro3_assp_kernel.fw
ess/maestro3_assp_minisrc.fw
yamaha/ds1_ctrl.fw
yamaha/ds1_dsp.fw
yamaha/ds1e_ctrl.fw
ttusb-budget/dspbootcode.bin
emi62/bitstream.fw
emi62/loader.fw
emi62/midi.fw
emi62/spdif.fw
ti_3410.fw
ti_5052.fw
mts_mt9234mu.fw
mts_mt9234zba.fw
whiteheat.fw
whiteheat_loader.fw
cpia2/stv0672_vp4.bin
vicam/firmware.fw
edgeport/boot.fw
edgeport/boot2.fw
edgeport/down.fw
edgeport/down2.fw
edgeport/down3.bin
sb16/mulaw_main.csp
sb16/alaw_main.csp
sb16/ima_adpcm_init.csp
sb16/ima_adpcm_playback.csp
sb16/ima_adpcm_capture.csp
sun/cassini.bin
acenic/tg1.bin
acenic/tg2.bin
adaptec/starfire_rx.bin
adaptec/starfire_tx.bin
yam/1200.bin
yam/9600.bin
ositech/Xilinx7OD.bin
qlogic/isp1000.bin
myricom/lanai.bin
yamaha/yss225_registers.bin
lgs8g75.fw
)
echo "Removing files with unknown license ..."
rm -v -- "${unknown_license[@]}"
}
src_install() {
local fwdest="${pkgdir}/lib/firmware"
mkdir -pv "${fwdest}"
./copy-firmware.sh -v -j1 "${fwdest}"
pushd "${fwdest}" &>/dev/null
echo "Removing broken symlinks ..."
find * -xtype l -print -delete
find -type d -empty -delete
popd &>/dev/null
install -Dm644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README.md"
}
# vim:ft=sh syn=sh et sw=2:

View File

@@ -0,0 +1,57 @@
--- a/copy-firmware.sh 2025-03-19 12:33:44.006356623 -0400
+++ b/copy-firmware.sh 2025-03-19 12:37:14.789934375 -0400
@@ -84,6 +84,16 @@ while test $# -gt 0; do
exit 1
;;
+ --firmware-list)
+ if [ -n "$2" ]; then
+ FIRMWARE_LIST=$2
+ shift 2
+ else
+ echo "ERROR: '--firmware-list' requires a non-empty option argument of firmware files to install"
+ exit 1
+ fi
+ ;;
+
-*)
# Ignore anything else that begins with - because that confuses
# the "test" command below
@@ -115,8 +125,18 @@ if test -e .git/config; then
./check_whence.py || err "check_whence.py has detected errors."
fi
+if test -n "${FIRMWARE_LIST}"; then
+ grep -E '^Link:' WHENCE | sed -e 's/^Link: *//g;s/-> //g' | while read l t; do
+ if ! cat "${FIRMWARE_LIST}" | grep -q "${l}"; then continue; fi
+ target="$(realpath --relative-to="$(pwd)" -m -s "$(dirname "$l")/$t")"
+ echo "${target}" >> "${FIRMWARE_LIST}"
+ done
+ FIRMWARE_LIST=$(cat "${FIRMWARE_LIST}")
+fi
+
# shellcheck disable=SC2162 # file/folder name can include escaped symbols
grep -E '^(RawFile|File):' WHENCE | sed -E -e 's/^(RawFile|File): */\1 /;s/"//g' | while read k f; do
+ [ -n "${FIRMWARE_LIST}" ] && if ! echo "${FIRMWARE_LIST}" | grep -q "${f}"; then continue; fi
install -d "$destdir/$(dirname "$f")"
$verbose "copying/compressing file $f$compext"
if test "$compress" != "cat" && test "$k" = "RawFile"; then
@@ -141,6 +161,7 @@ fi
# shellcheck disable=SC2162 # file/folder name can include escaped symbols
grep -E '^Link:' WHENCE | sed -e 's/^Link: *//g;s/-> //g' | while read l t; do
+ [ -n "${FIRMWARE_LIST}" ] && if ! echo "${FIRMWARE_LIST}" | grep -q "${l}"; then continue; fi
directory="$destdir/$(dirname "$l")"
install -d "$directory"
target="$(cd "$directory" && realpath -m -s "$t")"
@@ -166,7 +187,9 @@ fi
# Verify no broken symlinks
if test "$(find "$destdir" -xtype l | wc -l)" -ne 0 ; then
- err "Broken symlinks found:\n$(find "$destdir" -xtype l)"
+ if [ -z "${FIRMWARE_LIST}" ]; then
+ err "Broken symlinks found:\n$(find "$destdir" -xtype l)"
+ fi
fi
exit 0