1 { stdenv, lib, fetchzip, kernel }:
3 /* The python script shouldn't be needed for users of this kernel module.
4 https://github.com/rr-debugger/rr/blob/master/scripts/zen_workaround.py
5 The module itself is called "zen_workaround" (a bit generic unfortunately).
7 stdenv.mkDerivation rec {
8 pname = "rr-zen_workaround";
9 version = "2023-11-23";
12 url = "https://gist.github.com/glandium/01d54cefdb70561b5f6675e08f2990f2/archive/f9d2070a7d87388da39acd157e0e53666a7d6ee0.zip";
13 sha256 = "sha256-VqqKYjd8J7Uh5ea+PjLT93cNdQFvGIwGu4bzx+weSvo=";
16 hardeningDisable = [ "pic" ];
17 nativeBuildInputs = kernel.moduleBuildDependencies;
20 "-C${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
23 makeFlags="$makeFlags M=$(pwd)"
25 buildFlags = [ "modules" ];
28 modDestDir = "$out/lib/modules/${kernel.modDirVersion}/kernel"; #TODO: longer path?
31 mkdir -p "${modDestDir}"
32 cp *.ko "${modDestDir}/"
33 find ${modDestDir} -name '*.ko' -exec xz -f '{}' \;
38 description = "Kernel module supporting the rr debugger on (some) AMD Zen-based CPUs";
39 homepage = "https://github.com/rr-debugger/rr/wiki/Zen#kernel-module";
40 license = licenses.gpl2;
41 maintainers = [ maintainers.vcunat ];
42 platforms = [ "x86_64-linux" ];
43 broken = versionOlder kernel.version "4.19"; # 4.14 breaks and 4.19 works