git » linux-firmware.git » commit d1f471e

Make amd-ucode reproducible, thanks to esotericnonsense.

author Jelle van der Waa
2019-11-17 17:42:06 UTC
committer Jelle van der Waa
2019-11-17 17:42:06 UTC
parent 29b8b4d82dd15aa58b034fab7395d308a7fbc8ae

Make amd-ucode reproducible, thanks to esotericnonsense.

PKGBUILD +7 -3

diff --git a/PKGBUILD b/PKGBUILD
index 8f3732b..272d40b 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@ pkgbase=linux-firmware
 pkgname=(linux-firmware amd-ucode)
 _commit=2b016afc348ba4b5fb2016ffcb2822f4a293da0c
 pkgver=20191022.2b016af
-pkgrel=2
+pkgrel=3
 pkgdesc="Firmware files for Linux"
 makedepends=('git')
 arch=('any')
@@ -30,9 +30,13 @@ pkgver() {
 build() {
   mkdir -p kernel/x86/microcode
   cat ${pkgbase}/amd-ucode/microcode_amd*.bin > kernel/x86/microcode/AuthenticAMD.bin
-  # Make the .bin reproducible 
+
+  # Reproducibility: set the timestamp on the bin file
   [ ! -z $SOURCE_DATE_EPOCH ] && touch -d @$SOURCE_DATE_EPOCH kernel/x86/microcode/AuthenticAMD.bin
-  echo kernel/x86/microcode/AuthenticAMD.bin | bsdcpio -o -H newc -R 0:0 > amd-ucode.img
+  # 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() {