1 # Maintainer: Thomas Bächler <thomas@archlinux.org>
4 pkgname=(linux-firmware amd-ucode)
6 pkgver=20211027.1d00989
8 pkgdesc="Firmware files for Linux"
9 url="https://git.kernel.org/?p=linux/kernel/git/firmware/linux-firmware.git;a=summary"
10 license=('GPL2' 'GPL3' 'custom')
14 source=("git+https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git#tag=${_tag}?signed")
16 validpgpkeys=('4CDE8575E547BF835FE15807A31B6BD72486CFD6') # Josh Boyer <jwboyer@fedoraproject.org>
25 for _c in "${_backports[@]}"; do
26 git log --oneline -1 "${_c}"
27 git cherry-pick -n "${_c}"
34 # Commit date + short rev
35 echo $(TZ=UTC git show -s --pretty=%cd --date=format-local:%Y%m%d HEAD).$(git rev-parse --short HEAD)
39 mkdir -p kernel/x86/microcode
40 cat ${pkgbase}/amd-ucode/microcode_amd*.bin > kernel/x86/microcode/AuthenticAMD.bin
42 # Reproducibility: set the timestamp on the bin file
43 if [[ -n ${SOURCE_DATE_EPOCH} ]]; then
44 touch -d @${SOURCE_DATE_EPOCH} kernel/x86/microcode/AuthenticAMD.bin
47 # Reproducibility: strip the inode and device numbers from the cpio archive
48 echo kernel/x86/microcode/AuthenticAMD.bin |
49 bsdtar --uid 0 --gid 0 -cnf - -T - |
50 bsdtar --null -cf - --format=newc @- > amd-ucode.img
53 package_linux-firmware() {
56 make DESTDIR="${pkgdir}" FIRMWAREDIR=/usr/lib/firmware install
58 # Trigger a microcode reload for configurations not using early updates
59 echo 'w /sys/devices/system/cpu/microcode/reload - - - - 1' |
60 install -Dm644 /dev/stdin "${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf"
62 install -Dt "${pkgdir}/usr/share/licenses/${pkgname}" -m644 LICEN* WHENCE
66 pkgdesc="Microcode update image for AMD CPUs"
69 install -Dt "${pkgdir}/boot" -m644 amd-ucode.img
71 install -Dt "${pkgdir}/usr/share/licenses/${pkgname}" -m644 ${pkgbase}/LICENSE.amd-ucode