2022-01-09 16:36:20 +00:00
|
|
|
{ lib, stdenv, linux-firmware, libarchive }:
|
2012-06-28 18:54:24 +01:00
|
|
|
|
2019-08-13 22:52:01 +01:00
|
|
|
stdenv.mkDerivation {
|
2022-01-09 16:36:20 +00:00
|
|
|
name = "amd-ucode-${linux-firmware.version}";
|
2012-06-28 18:54:24 +01:00
|
|
|
|
2022-01-09 16:36:20 +00:00
|
|
|
src = linux-firmware;
|
2015-03-25 21:44:19 +00:00
|
|
|
|
|
|
|
sourceRoot = ".";
|
|
|
|
|
|
|
|
buildInputs = [ libarchive ];
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
mkdir -p kernel/x86/microcode
|
2022-01-09 16:36:20 +00:00
|
|
|
find ${linux-firmware}/lib/firmware/amd-ucode -name \*.bin \
|
2015-03-25 21:44:19 +00:00
|
|
|
-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
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2013-09-04 13:22:24 +01:00
|
|
|
description = "AMD Processor microcode patch";
|
2020-08-31 11:25:00 +01:00
|
|
|
homepage = "https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git";
|
2015-03-25 21:44:19 +00:00
|
|
|
license = licenses.unfreeRedistributableFirmware;
|
|
|
|
platforms = platforms.linux;
|
2012-06-28 18:54:24 +01:00
|
|
|
};
|
|
|
|
}
|