Merge pull request #159830 from chivay/lkrg

lkrg: init at 0.9.5
This commit is contained in:
Luke Granger-Brown 2022-11-25 21:33:04 +01:00 committed by GitHub
commit bebec27baa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 55 additions and 0 deletions

View file

@ -0,0 +1,53 @@
{ lib, stdenv, fetchpatch, fetchFromGitHub, kernel }:
let
isKernelRT = (kernel.structuredExtraConfig ? PREEMPT_RT) && (kernel.structuredExtraConfig.PREEMPT_RT == lib.kernel.yes);
in
stdenv.mkDerivation rec {
name = "${pname}-${version}-${kernel.version}";
pname = "lkrg";
version = "0.9.5";
src = fetchFromGitHub {
owner = "lkrg-org";
repo = "lkrg";
rev = "v${version}";
sha256 = "sha256-+yIKkTvfVbLnFBoXSKGebB1A8KqpaRmsLh8SsNuI9Dc=";
};
patches = [
(fetchpatch {
name = "fix-aarch64.patch";
url = "https://github.com/lkrg-org/lkrg/commit/a4e5c00f13f7081b346bc3736e4c035e3d17d3f7.patch";
sha256 = "sha256-DPscqi+DySHwFxGuGe7P2itPkoyb3XGu5Xp2S/ezP4Y=";
})
];
hardeningDisable = [ "pic" ];
nativeBuildInputs = kernel.moduleBuildDependencies;
makeFlags = kernel.makeFlags ++ [
"KERNEL=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
];
dontConfigure = true;
prePatch = ''
substituteInPlace Makefile --replace "KERNEL := " "KERNEL ?= "
'';
installPhase = ''
runHook preInstall
install -D lkrg.ko $out/lib/modules/${kernel.modDirVersion}/extra/lkrg.ko
runHook postInstall
'';
meta = with lib; {
description = "LKRG Linux Kernel module";
longDescription = "LKRG performs runtime integrity checking of the Linux kernel and detection of security vulnerability exploits against the kernel.";
homepage = "https://lkrg.org/";
license = licenses.gpl2Only;
maintainers = with maintainers; [ chivay ];
platforms = platforms.linux;
broken = kernel.kernelOlder "5.10" || kernel.kernelAtLeast "6.1" || isKernelRT;
};
}

View file

@ -325,6 +325,8 @@ in {
liquidtux = callPackage ../os-specific/linux/liquidtux {};
lkrg = callPackage ../os-specific/linux/lkrg {};
v4l2loopback = callPackage ../os-specific/linux/v4l2loopback { };
lttng-modules = callPackage ../os-specific/linux/lttng-modules { };