diff options
Diffstat (limited to 'nixpkgs/pkgs/os-specific/linux/microcode/amd.nix')
-rw-r--r-- | nixpkgs/pkgs/os-specific/linux/microcode/amd.nix | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/os-specific/linux/microcode/amd.nix b/nixpkgs/pkgs/os-specific/linux/microcode/amd.nix new file mode 100644 index 000000000000..bd4b3d9377f7 --- /dev/null +++ b/nixpkgs/pkgs/os-specific/linux/microcode/amd.nix @@ -0,0 +1,30 @@ +{ stdenv, firmwareLinuxNonfree, libarchive }: + +stdenv.mkDerivation rec { + name = "amd-ucode-${firmwareLinuxNonfree.version}"; + + 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 = '' + mkdir -p $out + echo kernel/x86/microcode/AuthenticAMD.bin | bsdcpio -o -H newc -R 0:0 > $out/amd-ucode.img + ''; + + meta = with stdenv.lib; { + description = "AMD Processor microcode patch"; + homepage = http://www.amd64.org/support/microcode.html; + license = licenses.unfreeRedistributableFirmware; + maintainers = with maintainers; [ wkennington ]; + platforms = platforms.linux; + }; +} |