3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/os-specific/linux/microcode/amd.nix

31 lines
851 B
Nix
Raw Normal View History

2015-03-25 21:44:19 +00:00
{ stdenv, fetchurl, firmwareLinuxNonfree, libarchive }:
stdenv.mkDerivation rec {
2015-03-25 21:44:19 +00:00
name = "amd-ucode-${firmwareLinuxNonfree.version}";
2015-03-25 21:44:19 +00:00
src = firmwareLinuxNonfree;
sourceRoot = ".";
buildInputs = [ libarchive ];
buildPhase = ''
mkdir -p kernel/x86/microcode
find ${firmwareLinuxNonfree}/lib/firmware/amd-ucode -name \*.bin \
-exec sh -c 'cat {} >> kernel/x86/microcode/AuthenticAMD.bin' \;
'';
installPhase = ''
2015-03-25 21:44:19 +00:00
mkdir -p $out
echo kernel/x86/microcode/AuthenticAMD.bin | bsdcpio -o -H newc -R 0:0 > $out/amd-ucode.img
'';
2015-03-25 21:44:19 +00:00
meta = with stdenv.lib; {
description = "AMD Processor microcode patch";
homepage = http://www.amd64.org/support/microcode.html;
2015-03-25 21:44:19 +00:00
license = licenses.unfreeRedistributableFirmware;
maintainers = with maintainers; [ wkennington ];
platforms = platforms.linux;
};
}