2018-07-21 01:44:44 +01:00
|
|
|
{ stdenv, firmwareLinuxNonfree, libarchive }:
|
2012-06-28 18:54:24 +01:00
|
|
|
|
2019-08-13 22:52:01 +01:00
|
|
|
stdenv.mkDerivation {
|
2015-03-25 21:44:19 +00:00
|
|
|
name = "amd-ucode-${firmwareLinuxNonfree.version}";
|
2012-06-28 18:54:24 +01:00
|
|
|
|
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' \;
|
|
|
|
'';
|
2012-06-28 18:54:24 +01:00
|
|
|
|
|
|
|
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
|
2012-06-28 18:54:24 +01:00
|
|
|
'';
|
|
|
|
|
2015-03-25 21:44:19 +00:00
|
|
|
meta = with stdenv.lib; {
|
2013-09-04 13:22:24 +01:00
|
|
|
description = "AMD Processor microcode patch";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://www.amd64.org/support/microcode.html";
|
2015-03-25 21:44:19 +00:00
|
|
|
license = licenses.unfreeRedistributableFirmware;
|
|
|
|
platforms = platforms.linux;
|
2012-06-28 18:54:24 +01:00
|
|
|
};
|
|
|
|
}
|