mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-28 00:24:18 +00:00
cc18755c08
Add companion kernel module for mstflint, which is required on some systems with secure boot enabled. Link to corresponding mstflint version. Signed-off-by: Markus Theil <theil.markus@gmail.com>
41 lines
1.2 KiB
Nix
41 lines
1.2 KiB
Nix
{ lib, stdenv, fetchurl, kernel, kmod, mstflint }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "mstflint_access";
|
|
inherit (mstflint) version;
|
|
|
|
src = fetchurl {
|
|
url = "https://github.com/Mellanox/mstflint/releases/download/v${version}/kernel-mstflint-${version}.tar.gz";
|
|
hash = "sha256-rfZts0m8x6clVazpbAa2xK+dYgRU9Us5rbcWa0uHJ1M=";
|
|
};
|
|
|
|
nativeBuildInputs = [ kmod ] ++ kernel.moduleBuildDependencies;
|
|
|
|
makeFlags = kernel.makeFlags ++ [
|
|
"KVER=${kernel.modDirVersion}"
|
|
"KSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
|
];
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
preConfigure = lib.optionals (lib.versionAtLeast kernel.version "6.4") ''
|
|
sed -i "s/class_create(THIS_MODULE, dev->name)/class_create(dev->name)/g" mst_main.c
|
|
'';
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
install -D ${pname}.ko $out/lib/modules/${kernel.modDirVersion}/extra/${pname}.ko
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "A kernel module for Nvidia NIC firmware update";
|
|
homepage = "https://github.com/Mellanox/mstflint";
|
|
license = [ licenses.gpl2Only ];
|
|
maintainers = with maintainers; [ thillux ];
|
|
platforms = platforms.linux;
|
|
};
|
|
}
|