194 lines
6.7 KiB
Bash
194 lines
6.7 KiB
Bash
#!/usr/bin/bash
|
|
# JOBoRun : Jwm OpenBox Obarun RUNit
|
|
# Maintainer : Joe Bo Run <joborun@disroot.org>
|
|
# PkgSource : url="https://gittea.disroot.org/joborun-pkg/jobcore/$pkgname"
|
|
# Website : https://pozol.eu
|
|
#-----------------------------------------| DESCRIPTION |---------------------------------------
|
|
|
|
pkgbase=linux-firmware
|
|
pkgname=(linux-firmware-whence linux-firmware amd-ucode
|
|
linux-firmware-{nfp,mellanox,marvell,qcom,liquidio,qlogic,bnx2x})
|
|
_tag=20230310
|
|
pkgver=20230310.588dd071
|
|
pkgrel=1
|
|
pkgdesc="Firmware files for Linux"
|
|
url="https://git.kernel.org/?p=linux/kernel/git/firmware/linux-firmware.git;a=summary"
|
|
makedepends=('git')
|
|
options=(!strip)
|
|
source=("git+https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git#tag=${_tag}?signed"
|
|
0001-Add-support-for-compressing-firmware-in-copy-firmware.patch)
|
|
|
|
_backports=(
|
|
)
|
|
|
|
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
|
|
}
|
|
|
|
_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
|
|
}
|
|
|
|
package_linux-firmware() {
|
|
depends=('linux-firmware-whence')
|
|
|
|
cd ${pkgbase}
|
|
|
|
make DESTDIR="${pkgdir}" FIRMWAREDIR=/usr/lib/firmware installcompress
|
|
|
|
# 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() {
|
|
pkgdesc="Microcode update image for AMD CPUs"
|
|
license=(custom)
|
|
|
|
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}"
|
|
}
|
|
|
|
package_linux-firmware-marvell() {
|
|
pkgdesc+=" - marvell / Firmware for Marvell devices"
|
|
depends=('linux-firmware-whence')
|
|
|
|
mv -v linux-firmware-marvell/* "${pkgdir}"
|
|
|
|
# remove arm64 firmware #76583
|
|
rm "${pkgdir}"/usr/lib/firmware/mrvl/prestera/mvsw_prestera_fw_arm64-v4.1.img.xz
|
|
}
|
|
|
|
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}"
|
|
}
|
|
|
|
#---- arch license gpg-key & sha256sums ----
|
|
|
|
arch=(x86_64)
|
|
|
|
license=('GPL2' 'GPL3' 'custom')
|
|
|
|
validpgpkeys=('4CDE8575E547BF835FE15807A31B6BD72486CFD6') # Josh Boyer <jwboyer@fedoraproject.org>
|
|
|
|
sha256sums=(SKIP # linux-firmware
|
|
aa11b2eed9c0be42571b45eb7153908a43290f02a5fc715aefcaa81030a1832f) # 0001-Add-support-for-compressing-firmware-in-copy-firmware.patch
|
|
|
|
## 41d5d0c9f089788bc5e58e829cd525f2034bfdab8e5f62225bcb54c6a6105bf8 amd-ucode-20230310.588dd071-1-x86_64.pkg.tar.lz
|
|
## 66149fce218cc3d45009b039eb6331ecf37eb41351e7117aab239a7d720b2cb9 linux-firmware-20230310.588dd071-1-x86_64.pkg.tar.lz
|
|
## ca95a77336ac00a1125292edd6e4f8ffef2b40d5676e6f21da9bf554d1899c07 linux-firmware-bnx2x-20230310.588dd071-1-x86_64.pkg.tar.lz
|
|
## b9c608567f0c5d50d414304ab0b0a3af8a096b6a8f2a2b23af1ea55a72a0f34d linux-firmware-liquidio-20230310.588dd071-1-x86_64.pkg.tar.lz
|
|
## cfa9b9c7cc9e2fa10f312f586a89ef47de25da4ad66e7c7f224addba196f7f66 linux-firmware-marvell-20230310.588dd071-1-x86_64.pkg.tar.lz
|
|
## c53ecbf0d8642d4d620c2699cd7d5611150b0457ae7a2ec66f451b2f1ed7dcf3 linux-firmware-mellanox-20230310.588dd071-1-x86_64.pkg.tar.lz
|
|
## 3679fdf498ae74462aed0b8819da5c71fb95824344c931fb4e08d3fe53660d64 linux-firmware-nfp-20230310.588dd071-1-x86_64.pkg.tar.lz
|
|
## b125b7d54f38a3e0e4fbc73f69625cc8fdfa3452805659b48d1a2a07bab15688 linux-firmware-qcom-20230310.588dd071-1-x86_64.pkg.tar.lz
|
|
## 0a2fece487e7cd977fc02c4d5bd2741268a6354ee4e5b7e822f09210dfd46b9d linux-firmware-qlogic-20230310.588dd071-1-x86_64.pkg.tar.lz
|
|
## 0024b73c432b94625ee08c5597c55f97a6e4cb5a80426fd6f487a07bab4cbe74 linux-firmware-whence-20230310.588dd071-1-x86_64.pkg.tar.lz
|
|
|
|
|