From 8baaff95e6636174ebdf01abe91a4c351234c0ff Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Wed, 25 Mar 2015 11:39:58 -0700 Subject: [PATCH] intel-ucode: Generate an early loadable microcode image --- pkgs/os-specific/linux/microcode/intel.nix | 27 ++++++++++++---------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/pkgs/os-specific/linux/microcode/intel.nix b/pkgs/os-specific/linux/microcode/intel.nix index b72194548e07..da354853cf56 100644 --- a/pkgs/os-specific/linux/microcode/intel.nix +++ b/pkgs/os-specific/linux/microcode/intel.nix @@ -1,31 +1,34 @@ -{ stdenv, fetchurl, microcode2ucode }: +{ stdenv, fetchurl, libarchive }: -let version = "20140624"; in - -stdenv.mkDerivation { +stdenv.mkDerivation rec { name = "microcode-intel-${version}"; + version = "20150121"; src = fetchurl { - url = "http://downloadmirror.intel.com/23984/eng/microcode-${version}.tgz"; - sha256 = "0dza0bdlx7q88yhnynvfgkrhgf7ycrq6mlp6hwnpp2j3h33jlrml"; + url = "http://downloadmirror.intel.com/24661/eng/microcode-${version}.tgz"; + sha256 = "1cznv3f25cxkwxdc930ab0ifvq0c76fryppadi4p26a2pf9knd93"; }; - buildInputs = [ microcode2ucode ]; + buildInputs = [ libarchive ]; sourceRoot = "."; buildPhase = '' - intel-microcode2ucode microcode.dat + gcc -O2 -Wall -o intel-microcode2ucode ${./intel-microcode2ucode.c} + ./intel-microcode2ucode microcode.dat ''; installPhase = '' - mkdir -p $out/lib/firmware - cp -r intel-ucode "$out/lib/firmware/" + mkdir -p $out kernel/x86/microcode + mv microcode.bin kernel/x86/microcode/GenuineIntel.bin + echo kernel/x86/microcode/GenuineIntel.bin | bsdcpio -o -H newc -R 0:0 > $out/intel-ucode.img ''; - meta = { + meta = with stdenv.lib; { homepage = http://www.intel.com/; description = "Microcode for Intel processors"; - license = stdenv.lib.licenses.unfree; + license = licenses.unfree; + maintainers = with maintainers; [ wkennington ]; + platforms = platforms.linux; }; }