2022-01-09 17:36:20 +01:00
|
|
|
{ lib, stdenv, linux-firmware, libarchive }:
|
2012-06-28 19:54:24 +02:00
|
|
|
|
2019-08-13 23:52:01 +02:00
|
|
|
stdenv.mkDerivation {
|
2022-01-22 18:13:29 +01:00
|
|
|
pname = "amd-ucode";
|
|
|
|
version = linux-firmware.version;
|
2012-06-28 19:54:24 +02:00
|
|
|
|
2022-01-09 17:36:20 +01:00
|
|
|
src = linux-firmware;
|
2015-03-25 22:44:19 +01:00
|
|
|
|
|
|
|
sourceRoot = ".";
|
|
|
|
|
2023-09-21 08:49:06 +02:00
|
|
|
nativeBuildInputs = [ libarchive ];
|
2015-03-25 22:44:19 +01:00
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
mkdir -p kernel/x86/microcode
|
2022-03-27 00:56:55 +01:00
|
|
|
find ${linux-firmware}/lib/firmware/amd-ucode -name \*.bin -print0 | sort -z |\
|
|
|
|
xargs -0 -I{} sh -c 'cat {} >> kernel/x86/microcode/AuthenticAMD.bin'
|
2015-03-25 22:44:19 +01:00
|
|
|
'';
|
2012-06-28 19:54:24 +02:00
|
|
|
|
|
|
|
installPhase = ''
|
2015-03-25 22:44:19 +01:00
|
|
|
mkdir -p $out
|
2022-03-27 00:56:55 +01:00
|
|
|
touch -d @$SOURCE_DATE_EPOCH kernel/x86/microcode/AuthenticAMD.bin
|
|
|
|
echo kernel/x86/microcode/AuthenticAMD.bin | bsdtar --uid 0 --gid 0 -cnf - -T - | bsdtar --null -cf - --format=newc @- > $out/amd-ucode.img
|
2012-06-28 19:54:24 +02:00
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2013-09-04 14:22:24 +02:00
|
|
|
description = "AMD Processor microcode patch";
|
2020-08-31 12:25:00 +02:00
|
|
|
homepage = "https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git";
|
2015-03-25 22:44:19 +01:00
|
|
|
license = licenses.unfreeRedistributableFirmware;
|
|
|
|
platforms = platforms.linux;
|
2012-06-28 19:54:24 +02:00
|
|
|
};
|
|
|
|
}
|