diff options
author | moparisthebest | 2023-10-22 22:03:36 -0400 |
---|---|---|
committer | moparisthebest | 2023-10-22 22:03:36 -0400 |
commit | 9387f649031bccf0603fc775357a3b15deb4b763 (patch) | |
tree | 8c63c926bd46f98b7153f4d7af195cc048976bbf | |
download | aur-9387f649031bccf0603fc775357a3b15deb4b763.tar.gz |
Initial commit
-rw-r--r-- | .SRCINFO | 18 | ||||
-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | PKGBUILD | 54 |
3 files changed, 77 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..8994d221f70b --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,18 @@ +pkgbase = amd-real-ucode-git + pkgdesc = Actually provides the latest CPU microcode for AMD + pkgver = 20231021.ba8eaf5 + pkgrel = 1 + arch = any + license = custom + makedepends = linux-firmware + makedepends = git + provides = amd-ucode + conflicts = amd-ucode + source = CPUMicrocodes::git+https://github.com/platomav/CPUMicrocodes + source = real-ucode::git+https://github.com/divestedcg/real-ucode#commit=c93c9ed85eb3c0566a76d8c3accebd6ee82c1ca9 + source = amd-ucodegen::git+https://github.com/AndyLavr/amd-ucodegen#commit=0d34b54e396ef300d0364817e763d2c7d1ffff02 + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + +pkgname = amd-real-ucode-git diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..8631db7dd9f8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +* +!.gitignore +!PKGBUILD +!.SRCINFO + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..26a19080646a --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,54 @@ +# Maintainer: moparisthebest <admin dot archlinux AT moparisthebest dot com> +# Contributor: Tad <tad@spotco.us> +pkgname=amd-real-ucode-git +pkgver=20231021.ba8eaf5 +pkgrel=1 +pkgdesc="Actually provides the latest CPU microcode for AMD" +arch=('any') +license=('custom') +makedepends=('linux-firmware' 'git') +conflicts=('amd-ucode') +provides=('amd-ucode') +source=('CPUMicrocodes::git+https://github.com/platomav/CPUMicrocodes' 'real-ucode::git+https://github.com/divestedcg/real-ucode#commit=c93c9ed85eb3c0566a76d8c3accebd6ee82c1ca9' 'amd-ucodegen::git+https://github.com/AndyLavr/amd-ucodegen#commit=0d34b54e396ef300d0364817e763d2c7d1ffff02') +sha256sums=(SKIP SKIP SKIP) + +pkgver() { + cd "${srcdir}/CPUMicrocodes" + git log -1 --pretty='format:%cd.%h' --date=format:'%Y%m%d' +} + +build() { + set -eo pipefail + + cd amd-ucodegen + patch -p1 < ../real-ucode/amd-ucodegen-tweak.diff + make + cd ../CPUMicrocodes + mv ../amd-ucodegen/amd-ucodegen . + ../real-ucode/process-amd.sh + cd .. + mkdir -p firmware + cd firmware + cp /usr/lib/firmware/amd-ucode/microcode_amd*.bin . + cp ../CPUMicrocodes/microcode_amd*.bin . + # this directory and exact name matters + # https://gitlab.archlinux.org/archlinux/packaging/packages/linux-firmware/-/blob/main/PKGBUILD?ref_type=heads#L43 + mkdir -p kernel/x86/microcode + cat 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() { + install -Dt "${pkgdir}/boot" -m644 amd-ucode.img + + install -Dt "${pkgdir}/usr/share/licenses/${pkgname}" -m644 real-ucode/LICENSE.amd-ucode +} |