jobcore/linux-firmware/PKGBUILD-arch

170 lines
4.7 KiB
Text
Raw Normal View History

2024-01-06 12:48:17 +01:00
# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
# Contributor: Thomas Bächler <thomas@archlinux.org>
2022-03-20 13:19:37 +01:00
pkgbase=linux-firmware
2022-07-21 11:54:06 +02:00
pkgname=(linux-firmware-whence linux-firmware amd-ucode
linux-firmware-{nfp,mellanox,marvell,qcom,liquidio,qlogic,bnx2x}
)
2024-07-16 17:22:50 +02:00
_tag=20240709
pkgver=20240703.e94a2a3b
pkgrel=1
2022-03-20 13:19:37 +01:00
pkgdesc="Firmware files for Linux"
2024-03-19 22:11:19 +01:00
url="https://gitlab.com/kernel-firmware/linux-firmware"
2022-03-20 13:19:37 +01:00
license=('GPL2' 'GPL3' 'custom')
arch=('any')
2024-01-06 12:48:17 +01:00
makedepends=('git' 'rdfind')
2024-05-13 14:32:51 +02:00
options=(!strip !debug)
2024-03-19 22:11:19 +01:00
source=("git+$url.git?signed#tag=${_tag}")
2024-07-16 17:22:50 +02:00
sha256sums=('5504403f513abdcee95756a15fb5a1ac13231e50c0dcadeeff54d5fcc0d330f5')
2022-03-20 13:19:37 +01:00
validpgpkeys=('4CDE8575E547BF835FE15807A31B6BD72486CFD6') # Josh Boyer <jwboyer@fedoraproject.org>
_backports=(
)
prepare() {
2022-07-21 11:54:06 +02:00
cd ${pkgbase}
2022-03-20 13:19:37 +01:00
local _c
for _c in "${_backports[@]}"; do
git log --oneline -1 "${_c}"
git cherry-pick -n "${_c}"
done
}
pkgver() {
2022-07-21 11:54:06 +02:00
cd ${pkgbase}
2022-03-20 13:19:37 +01:00
# 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
2022-07-21 11:54:06 +02:00
if [[ -n ${SOURCE_DATE_EPOCH} ]]; then
2022-03-20 13:19:37 +01:00
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
}
2022-07-21 11:54:06 +02:00
_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
}
2022-03-20 13:19:37 +01:00
package_linux-firmware() {
2022-07-21 11:54:06 +02:00
depends=('linux-firmware-whence')
2022-03-20 13:19:37 +01:00
2022-07-21 11:54:06 +02:00
cd ${pkgbase}
ZSTD_CLEVEL=19 make DESTDIR="${pkgdir}" FIRMWAREDIR=/usr/lib/firmware install-zst
2022-03-20 13:19:37 +01:00
2022-07-21 11:54:06 +02:00
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
2024-03-19 22:11:19 +01:00
_pick amd-ucode usr/lib/firmware/amd-ucode
2022-07-21 11:54:06 +02:00
_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_*}
2023-04-05 12:29:13 +02:00
_pick linux-firmware-qcom usr/share/licenses/${pkgname}/LICENSE.qcom*
2022-07-21 11:54:06 +02:00
_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*
2022-03-20 13:19:37 +01:00
}
package_amd-ucode() {
pkgdesc="Microcode update image for AMD CPUs"
license=(custom)
2024-03-19 22:11:19 +01:00
mv -v $pkgname/* "$pkgdir"
2022-03-20 13:19:37 +01:00
install -Dt "${pkgdir}/boot" -m644 amd-ucode.img
install -Dt "${pkgdir}/usr/share/licenses/${pkgname}" -m644 ${pkgbase}/LICENSE.amd-ucode
}
2022-07-21 11:54:06 +02:00
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}"
}
package_linux-firmware-marvell() {
pkgdesc+=" - marvell / Firmware for Marvell devices"
depends=('linux-firmware-whence')
2022-07-21 11:54:06 +02:00
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}"
}
2022-03-20 13:19:37 +01:00
# vim:set sw=2 et: