microcode-intel: enable building on platforms other than x86_64-linux (#380722)

This commit is contained in:
Aleksana
2025-05-22 00:25:45 +08:00
committed by GitHub
+3 -5
View File
@@ -4,6 +4,7 @@
fetchFromGitHub,
libarchive,
iucode-tool,
buildPackages,
}:
stdenv.mkDerivation rec {
@@ -17,16 +18,13 @@ stdenv.mkDerivation rec {
hash = "sha256-xasV1w6+8qnD+RLWsReMo+xm7a9nguV2st3IC4FURDU=";
};
nativeBuildInputs = [
iucode-tool
libarchive
];
nativeBuildInputs = [ libarchive ];
installPhase = ''
runHook preInstall
mkdir -p $out kernel/x86/microcode
iucode_tool -w kernel/x86/microcode/GenuineIntel.bin intel-ucode/
${stdenv.hostPlatform.emulator buildPackages} ${lib.getExe iucode-tool} -w kernel/x86/microcode/GenuineIntel.bin intel-ucode/
touch -d @$SOURCE_DATE_EPOCH kernel/x86/microcode/GenuineIntel.bin
echo kernel/x86/microcode/GenuineIntel.bin | bsdtar --uid 0 --gid 0 -cnf - -T - | bsdtar --null -cf - --format=newc @- > $out/intel-ucode.img