2021-01-10 23:54:33 -08:00
|
|
|
{ lib, stdenv, firmwareLinuxNonfree, libarchive }:
|
2012-06-28 10:54:24 -07:00
|
|
|
|
2019-08-13 14:52:01 -07:00
|
|
|
stdenv.mkDerivation {
|
2015-03-25 14:44:19 -07:00
|
|
|
name = "amd-ucode-${firmwareLinuxNonfree.version}";
|
2012-06-28 10:54:24 -07:00
|
|
|
|
2015-03-25 14:44:19 -07: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 10:54:24 -07:00
|
|
|
|
|
|
|
installPhase = ''
|
2015-03-25 14:44:19 -07:00
|
|
|
mkdir -p $out
|
|
|
|
echo kernel/x86/microcode/AuthenticAMD.bin | bsdcpio -o -H newc -R 0:0 > $out/amd-ucode.img
|
2012-06-28 10:54:24 -07:00
|
|
|
'';
|
|
|
|
|
2021-01-10 23:54:33 -08:00
|
|
|
meta = with lib; {
|
2013-09-04 05:22:24 -07:00
|
|
|
description = "AMD Processor microcode patch";
|
2020-08-31 03:25:00 -07:00
|
|
|
homepage = "https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git";
|
2015-03-25 14:44:19 -07:00
|
|
|
license = licenses.unfreeRedistributableFirmware;
|
|
|
|
platforms = platforms.linux;
|
2012-06-28 10:54:24 -07:00
|
|
|
};
|
|
|
|
}
|