diff options
author | Jonathon Fernyhough | 2022-01-21 20:18:41 +0000 |
---|---|---|
committer | Jonathon Fernyhough | 2022-01-21 20:19:33 +0000 |
commit | 842938b2523693d95d1e133ac812b0bd6387321b (patch) | |
tree | d5534fa89b83a2efa5b66f91fc1611020de35222 | |
download | aur-842938b2523693d95d1e133ac812b0bd6387321b.tar.gz |
Initial commit. Disable firmware module compression.
-rw-r--r-- | .SRCINFO | 69 | ||||
-rw-r--r-- | 0001-Add-support-for-compressing-firmware-in-copy-firmware.patch | 123 | ||||
-rw-r--r-- | PKGBUILD | 189 |
3 files changed, 381 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..d3187b8d6bc3 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,69 @@ +pkgbase = linux-firmware-uncompressed + pkgdesc = Firmware files for Linux (without module compression) + pkgver = 20220119.0c6a7b3 + pkgrel = 2 + url = https://git.kernel.org/?p=linux/kernel/git/firmware/linux-firmware.git;a=summary + arch = any + license = GPL2 + license = GPL3 + license = custom + makedepends = git + options = !strip + source = git+https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git#commit=0c6a7b3bf728b95c8b7b95328f94335e2bb2c967?signed + source = 0001-Add-support-for-compressing-firmware-in-copy-firmware.patch + validpgpkeys = 4CDE8575E547BF835FE15807A31B6BD72486CFD6 + sha256sums = SKIP + sha256sums = 41c73f88ac68a3aef01fd406ce6cdb87555c65e4816dab12df10740875551aa7 + +pkgname = linux-firmware-uncompressed + depends = linux-firmware-whence + provides = linux-firmware + conflicts = linux-firmware + +pkgname = amd-ucode-uncompressed + pkgdesc = Microcode update image for AMD CPUs (without module compression) + license = custom + provides = amd-ucode + conflicts = amd-ucode + +pkgname = linux-firmware-nfp-uncompressed + pkgdesc = Firmware files for Linux (without module compression) - nfp / Firmware for Netronome Flow Processors (without module compression) + depends = linux-firmware-whence + provides = linux-firmware-nfp + conflicts = linux-firmware-nfp + +pkgname = linux-firmware-mellanox-uncompressed + pkgdesc = Firmware files for Linux (without module compression) - mellanox / Firmware for Mellanox Spectrum switches (without module compression) + depends = linux-firmware-whence + provides = linux-firmware-mellanox + conflicts = linux-firmware-mellanox + +pkgname = linux-firmware-marvell-uncompressed + pkgdesc = Firmware files for Linux (without module compression) - marvell / Firmware for Marvell devices (without module compression) + depends = linux-firmware-whence + provides = linux-firmware-marvell + conflicts = linux-firmware-marvell + +pkgname = linux-firmware-qcom-uncompressed + pkgdesc = Firmware files for Linux (without module compression) - qcom / Firmware for Qualcomm SoCs (without module compression) + depends = linux-firmware-whence + provides = linux-firmware-qcom + conflicts = linux-firmware-qcom + +pkgname = linux-firmware-liquidio-uncompressed + pkgdesc = Firmware files for Linux (without module compression) - liquidio / Firmware for Cavium LiquidIO server adapters (without module compression) + depends = linux-firmware-whence + provides = linux-firmware-liquidio + conflicts = linux-firmware-liquidio + +pkgname = linux-firmware-qlogic-uncompressed + pkgdesc = Firmware files for Linux (without module compression) - qlogic / Firmware for QLogic devices + depends = linux-firmware-whence + provides = linux-firmware-qlogic + conflicts = linux-firmware-qlogic + +pkgname = linux-firmware-bnx2x-uncompressed + pkgdesc = Firmware files for Linux (without module compression) - bnx2x / Firmware for Broadcom NetXtreme II 10Gb ethernet adapters (without module compression) + depends = linux-firmware-whence + provides = linux-firmware-bnx2x + conflicts = linux-firmware-bnx2x diff --git a/0001-Add-support-for-compressing-firmware-in-copy-firmware.patch b/0001-Add-support-for-compressing-firmware-in-copy-firmware.patch new file mode 100644 index 000000000000..93d82e4a2c4e --- /dev/null +++ b/0001-Add-support-for-compressing-firmware-in-copy-firmware.patch @@ -0,0 +1,123 @@ +From 7eec2b56f54c778d5bd6e7aea49ee03e3b76e769 Mon Sep 17 00:00:00 2001 +From: Peter Robinson <pbrobinson@gmail.com> +Date: Fri, 22 Jan 2021 20:36:23 +0000 +Subject: [PATCH v2] Add support for compressing firmware in copy-firmware.sh + +As of kernel 5.3 there's initial support for loading compressed firmware. +At this stage the only supported compression methis is "xz -C crc32" but +this option brings significant benefits. + +Signed-off-by: Peter Robinson <pbrobinson@gmail.com> +--- + +v2: quote filename for xz command + + Makefile | 4 ++++ + copy-firmware.sh | 47 +++++++++++++++++++++++++++++++---------------- + 2 files changed, 35 insertions(+), 16 deletions(-) + +diff --git a/Makefile b/Makefile +index e1c362f..9a48471 100644 +--- a/Makefile ++++ b/Makefile +@@ -11,3 +11,7 @@ check: + install: + mkdir -p $(DESTDIR)$(FIRMWAREDIR) + ./copy-firmware.sh $(DESTDIR)$(FIRMWAREDIR) ++ ++installcompress: ++ mkdir -p $(DESTDIR)$(FIRMWAREDIR) ++ ./copy-firmware.sh -C $(DESTDIR)$(FIRMWAREDIR) +diff --git a/copy-firmware.sh b/copy-firmware.sh +index 9b46b63..0dd2e5c 100755 +--- a/copy-firmware.sh ++++ b/copy-firmware.sh +@@ -6,6 +6,7 @@ + + verbose=: + prune=no ++compress=no + + while test $# -gt 0; do + case $1 in +@@ -19,6 +20,11 @@ while test $# -gt 0; do + shift + ;; + ++ -C | --compress) ++ compress=yes ++ shift ++ ;; ++ + *) + if test "x$destdir" != "x"; then + echo "ERROR: unknown command-line options: $@" +@@ -31,40 +37,49 @@ while test $# -gt 0; do + esac + done + ++if test "x$compress" = "xyes"; then ++ cmpxtn=.xz ++ grep '^File:' WHENCE | sed -e's/^File: *//g' -e's/"//g' | while read f; do ++ test -f "$f" || continue ++ $verbose "compressing $f" ++ xz -C crc32 "$f" ++ done ++fi ++ + grep '^File:' WHENCE | sed -e's/^File: *//g' -e's/"//g' | while read f; do +- test -f "$f" || continue +- $verbose "copying file $f" +- mkdir -p $destdir/$(dirname "$f") +- cp -d "$f" $destdir/"$f" ++ test -f "$f$cmpxtn" || continue ++ $verbose "copying file $f$cmpxtn" ++ mkdir -p $destdir/$(dirname "$f$cmpxtn") ++ cp -d "$f$cmpxtn" $destdir/"$f$cmpxtn" + done + + grep -E '^Link:' WHENCE | sed -e's/^Link: *//g' -e's/-> //g' | while read f d; do +- if test -L "$f"; then +- test -f "$destdir/$f" && continue +- $verbose "copying link $f" +- mkdir -p $destdir/$(dirname "$f") ++ if test -L "$f$cmpxtn"; then ++ test -f "$destdir/$f$cmpxtn" && continue ++ $verbose "copying link $f$cmpxtn" ++ mkdir -p $destdir/$(dirname "$f$cmpxtn") + cp -d "$f" $destdir/"$f" + + if test "x$d" != "x"; then +- target=`readlink "$f"` ++ target=`readlink "$f$cmpxtn"` + + if test "x$target" != "x$d"; then + $verbose "WARNING: inconsistent symlink target: $target != $d" + else + if test "x$prune" != "xyes"; then +- $verbose "WARNING: unneeded symlink detected: $f" ++ $verbose "WARNING: unneeded symlink detected: $f$cmpxtn" + else +- $verbose "WARNING: pruning unneeded symlink $f" +- rm -f "$f" ++ $verbose "WARNING: pruning unneeded symlink $f$cmpxtn" ++ rm -f "$f$cmpxtn" + fi + fi + else +- $verbose "WARNING: missing target for symlink $f" ++ $verbose "WARNING: missing target for symlink $f$cmpxtn" + fi + else +- $verbose "creating link $f -> $d" +- mkdir -p $destdir/$(dirname "$f") +- ln -sf "$d" "$destdir/$f" ++ $verbose "creating link $f$cmpxtn -> $d$cmpxtn" ++ mkdir -p $destdir/$(dirname "$f$cmpxtn") ++ ln -sf "$d$cmpxtn" "$destdir/$f$cmpxtn" + fi + done + +-- +2.29.2 + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..6683958e8827 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,189 @@ +# Maintainer: Jonathon Fernyhough <jonathon+mx2+dev> +# Contributor: Thomas Bächler <thomas@archlinux.org> + +pkgbase=linux-firmware-uncompressed +pkgname=(linux-firmware-uncompressed amd-ucode-uncompressed + linux-firmware-{nfp,mellanox,marvell,qcom,liquidio,qlogic,bnx2x}-uncompressed +) +#_tag=20211216 +_commit=0c6a7b3bf728b95c8b7b95328f94335e2bb2c967 +pkgver=20220119.0c6a7b3 +pkgrel=2 +pkgdesc="Firmware files for Linux (without module compression)" +url="https://git.kernel.org/?p=linux/kernel/git/firmware/linux-firmware.git;a=summary" +license=('GPL2' 'GPL3' 'custom') +arch=('any') +makedepends=('git') +options=(!strip) +source=("git+https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git#commit=${_commit}?signed" + 0001-Add-support-for-compressing-firmware-in-copy-firmware.patch) +sha256sums=('SKIP' + '41c73f88ac68a3aef01fd406ce6cdb87555c65e4816dab12df10740875551aa7') +validpgpkeys=('4CDE8575E547BF835FE15807A31B6BD72486CFD6') # Josh Boyer <jwboyer@fedoraproject.org> + +_backports=( +) + + +_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 +} + +prepare() { + cd ${pkgbase} + + local _c + for _c in "${_backports[@]}"; do + git log --oneline -1 "${_c}" + git cherry-pick -n "${_c}" + done + + # add firmware compression support - patch taken from Fedora + patch -Np1 -i ../0001-Add-support-for-compressing-firmware-in-copy-firmware.patch +} + +pkgver() { + cd ${pkgbase} + + # Commit date + short rev + 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 +} + +#package_linux-firmware-whence() { +# cd "$pkgbase" +# install -Dt "${pkgdir}/usr/share/licenses/${pkgname}" -m644 WHENCE +#} + +package_linux-firmware-uncompressed() { + depends=('linux-firmware-whence') + conflicts=('linux-firmware') + provides=('linux-firmware') + + cd ${pkgname} + + make DESTDIR="${pkgdir}" FIRMWAREDIR=/usr/lib/firmware install + + # Trigger a microcode reload for configurations not using early updates + echo 'w /sys/devices/system/cpu/microcode/reload - - - - 1' | + install -Dm644 /dev/stdin "${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf" + + install -Dt "${pkgdir}/usr/share/licenses/${pkgname}" -m644 LICEN* + + # split + cd "$pkgdir" + _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-uncompressed() { + pkgdesc="Microcode update image for AMD CPUs (without module compression)" + license=(custom) + conflicts=('amd-ucode') + provides=('amd-ucode') + + install -Dt "${pkgdir}/boot" -m644 amd-ucode.img + + install -Dt "${pkgdir}/usr/share/licenses/${pkgname}" -m644 ${pkgbase}/LICENSE.amd-ucode +} + +package_linux-firmware-nfp-uncompressed() { + pkgdesc+=" - nfp / Firmware for Netronome Flow Processors (without module compression)" + depends=('linux-firmware-whence') + conflicts=('linux-firmware-nfp') + provides=('linux-firmware-nfp') + + mv -v linux-firmware-nfp/* "${pkgdir}" +} + +package_linux-firmware-mellanox-uncompressed() { + pkgdesc+=" - mellanox / Firmware for Mellanox Spectrum switches (without module compression)" + depends=('linux-firmware-whence') + conflicts=('linux-firmware-mellanox') + provides=('linux-firmware-mellanox') + + mv -v linux-firmware-mellanox/* "${pkgdir}" +} + +package_linux-firmware-marvell-uncompressed() { + pkgdesc+=" - marvell / Firmware for Marvell devices (without module compression)" + depends=('linux-firmware-whence') + conflicts=('linux-firmware-marvell') + provides=('linux-firmware-marvell') + + mv -v linux-firmware-marvell/* "${pkgdir}" +} + +package_linux-firmware-qcom-uncompressed() { + pkgdesc+=" - qcom / Firmware for Qualcomm SoCs (without module compression)" + depends=('linux-firmware-whence') + conflicts=('linux-firmware-qcom') + provides=('linux-firmware-qcom') + + mv -v linux-firmware-qcom/* "${pkgdir}" +} + +package_linux-firmware-liquidio-uncompressed() { + pkgdesc+=" - liquidio / Firmware for Cavium LiquidIO server adapters (without module compression)" + depends=('linux-firmware-whence') + conflicts=('linux-firmware-liquidio') + provides=('linux-firmware-liquidio') + + mv -v linux-firmware-liquidio/* "${pkgdir}" +} + +package_linux-firmware-qlogic-uncompressed() { + pkgdesc+=" - qlogic / Firmware for QLogic devices" + depends=('linux-firmware-whence') + conflicts=('linux-firmware-qlogic') + provides=('linux-firmware-qlogic') + + mv -v linux-firmware-qlogic/* "${pkgdir}" +} + +package_linux-firmware-bnx2x-uncompressed() { + pkgdesc+=" - bnx2x / Firmware for Broadcom NetXtreme II 10Gb ethernet adapters (without module compression)" + depends=('linux-firmware-whence') + conflicts=('linux-firmware-bnx2x') + provides=('linux-firmware-bnx2x') + + mv -v linux-firmware-bnx2x/* "${pkgdir}" +} + +# vim:set sw=2 et: |