2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, libarchive, iucode-tool }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "microcode-intel";
|
2022-11-21 17:40:18 +00:00
|
|
|
version = "20221108";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "intel";
|
|
|
|
repo = "Intel-Linux-Processor-Microcode-Data-Files";
|
|
|
|
rev = "microcode-${version}";
|
2022-11-21 17:40:18 +00:00
|
|
|
hash = "sha256-JZbBrD3fHgJogDw4u2YggDX7OCXCu5/XEZKzHuVJR9k=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ iucode-tool libarchive ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out kernel/x86/microcode
|
|
|
|
iucode_tool -w kernel/x86/microcode/GenuineIntel.bin intel-ucode/
|
2022-04-15 01:41:22 +00:00
|
|
|
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
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "http://www.intel.com/";
|
|
|
|
description = "Microcode for Intel processors";
|
|
|
|
license = licenses.unfreeRedistributableFirmware;
|
|
|
|
platforms = platforms.linux;
|
2022-01-19 23:45:15 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|