@@ -64,6 +64,10 @@ linux-6.6.56-x86_64:
ARGO_SHA: "705a7a8a624b42e13e655d3042059b8a85cdf6a3"
ARGOEXEC_SHA: "d900429f6640acc6f68a3d3a4c945d7da60625d8"
+microcode-x86:
+ extends: .x86_64-artifacts
+ script: ./scripts/x86-microcode.sh
+
#
# The jobs below here are legacy and being phased out.
#
@@ -27,6 +27,9 @@ RUN <<EOF
openssl-dev
perl
+ # Microcode
+ jq
+
# Argo build deps
autoconf
automake
new file mode 100755
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+set -eux -o pipefail
+
+WORKDIR="${PWD}"
+COPYDIR="${WORKDIR}/binaries"
+
+ROOTDIR="${WORKDIR}/root"
+UCODEDIR="${ROOTDIR}/kernel/x86/microcode"
+mkdir -p "${UCODEDIR}"
+
+#
+# Intel microcode comes from github
+#
+curl -fsSL https://api.github.com/repos/intel/Intel-Linux-Processor-Microcode-Data-Files/releases/latest > intel-latest.json
+TARBALL_URL="$(jq -r .tarball_url intel-latest.json)"
+curl -fsSL "${TARBALL_URL}" > intel-latest.tar
+tar xf intel-latest.tar --strip-components=1
+
+(
+ cd intel-ucode
+ cat 06-97-02 # adl-*
+ cat 06-8e-09 # kbl-*
+) > "${UCODEDIR}/GenuineIntel.bin"
+
+#
+# AMD microcode comes from linux-firmware
+#
+curl -fsSLO https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/amd-ucode/microcode_amd_fam17h.bin
+curl -fsSLO https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/amd-ucode/microcode_amd_fam19h.bin
+
+(
+ cat microcode_amd_fam17h.bin # zen2-*, xilinux-*-x86_64-*
+ cat microcode_amd_fam19h.bin # zen3p-*
+) > "${UCODEDIR}/AuthenticAMD.bin"
+
+# Package everything up. It must be uncompressed
+cd "${ROOTDIR}"
+find . | cpio -R 0:0 -H newc -o > "${COPYDIR}/ucode.cpio"
+
+# Print the contents for the build log
+cpio -tv < "${COPYDIR}/ucode.cpio"