2022-05-23 15:13:48 +00:00
|
|
|
{ stdenv, fetchFromGitHub, fetchpatch, kernel, lib }:
|
2020-11-14 16:05:17 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-12-07 19:40:23 +00:00
|
|
|
pname = "vendor-reset";
|
|
|
|
version = "unstable-2021-02-16-${kernel.version}";
|
2020-11-14 16:05:17 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "gnif";
|
|
|
|
repo = "vendor-reset";
|
|
|
|
rev = "225a49a40941e350899e456366265cf82b87ad25";
|
|
|
|
sha256 = "sha256-xa7P7+mRk4FVgi+YYCcsFLfyNqPmXvy3xhGoTDVqPxw=";
|
|
|
|
};
|
|
|
|
|
2022-05-23 15:13:48 +00:00
|
|
|
patches = [
|
|
|
|
# Fix build with Linux 5.18.
|
|
|
|
# https://github.com/gnif/vendor-reset/pull/58
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/gnif/vendor-reset/commit/5bbffcd6fee5348e8808bdbfcb5b21d455b02f55.patch";
|
|
|
|
sha256 = "sha256-L1QxVpcZAVYiaMFCBfL2EJgeMyOR8sDa1UqF1QB3bns=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-11-14 16:05:17 +00:00
|
|
|
nativeBuildInputs = kernel.moduleBuildDependencies;
|
|
|
|
|
|
|
|
hardeningDisable = [ "pic" ];
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"KVER=${kernel.modDirVersion}"
|
|
|
|
"KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
|
|
|
];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -D vendor-reset.ko -t "$out/lib/modules/${kernel.modDirVersion}/kernel/drivers/misc/"
|
|
|
|
'';
|
|
|
|
|
2022-05-23 15:14:01 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2020-11-14 16:05:17 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Linux kernel vendor specific hardware reset module";
|
|
|
|
homepage = "https://github.com/gnif/vendor-reset";
|
|
|
|
license = licenses.gpl2Only;
|
|
|
|
maintainers = with maintainers; [ wedens ];
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
broken = kernel.kernelOlder "4.19";
|
|
|
|
};
|
|
|
|
}
|