summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app-antivirus/lkrg/Manifest2
-rw-r--r--app-antivirus/lkrg/files/lkrg-0.9.4-gentoo-paths.patch20
-rw-r--r--app-antivirus/lkrg/lkrg-0.9.4.ebuild50
3 files changed, 72 insertions, 0 deletions
diff --git a/app-antivirus/lkrg/Manifest b/app-antivirus/lkrg/Manifest
index e8b582565d8d..442417aab4b3 100644
--- a/app-antivirus/lkrg/Manifest
+++ b/app-antivirus/lkrg/Manifest
@@ -2,3 +2,5 @@ DIST lkrg-0.9.2.tar.gz 125976 BLAKE2B c3da2d4599c9dd5b7d6fbec426fd93d802715f6c85
DIST lkrg-0.9.2.tar.gz.sign 801 BLAKE2B 0cd8b18c8a0fbcca61ffa868b406d048461ddf9189fb08f15faa45e01b8731906a6b14105dfcf92bb5124373860f6695594063ee8d138c94c70adf471bc15e0a SHA512 18b547ca84a7fd2957484857e17983408e92fd005d58b77b399c5156ecb09fc5e9e6c910337654a2655883d103098c1769b1993017eec753bd21e63d6491ad04
DIST lkrg-0.9.3.tar.gz 127986 BLAKE2B 5d059247c9a8a5abe4795d22b3806544dbb4c332947012ec33ceace27747663375acf68a4e859fae293eead5f7d9540b4261d3fef149d1e5c6ee8714a2df28d6 SHA512 9b441b93ff28b733afc513643a5d843c1707ac5a05adb359a3142b9ca7cba6a4790ebca4f9e6ca88a6ddf61f2b06aa242e02f288e9295e74999ed534794fb45d
DIST lkrg-0.9.3.tar.gz.sign 801 BLAKE2B c054522f281d09a008821f92c7b43b5384241100c68ef0b0ea7171b8c492772a5d668b425089e1aac990bf6a675215dd5861f3f2598995e31a8db82a8b2ec7e9 SHA512 87c2bfe8d342b85f3c6c8226be5b698527a507369603a03eefead89ea8635b5ba95f3cbbe1d84cd77ac42bb8a773a7133917e0c87132b4851ff4017f77bc683a
+DIST lkrg-0.9.4.tar.gz 127462 BLAKE2B 4085d517e0a6360739a031e8afe4540354d35a8a59d33c96900c2def0c80bf81bef76b84322bb4beca649917693fd6a121ce81ba8caf652adbe406757729083d SHA512 7dd88a3071bbc7a1e6ca725a339f8a93544bf97f1b73e6a4b424895810a4f094d056b644120ad6df14650cd7e5678a356063b1e40113d770e059a7ca4d3e461c
+DIST lkrg-0.9.4.tar.gz.sign 801 BLAKE2B eb7c6f1aa925f73bbec7cad5da9f6676b3b6b2691151455ff240f8c6af844f61478df7050b73d3144877b2ad64bf9a25e13e8ea9fcbaf85988c02438b82893ab SHA512 6bec0699b15ba42dc7a7afc18a91d77668b3404b9e069db69634ff1e1af33b96eb4ffa5e25ce46cd012acdfdce7535d3cd2eb05ac55ae3bb4134f27f45712ce8
diff --git a/app-antivirus/lkrg/files/lkrg-0.9.4-gentoo-paths.patch b/app-antivirus/lkrg/files/lkrg-0.9.4-gentoo-paths.patch
new file mode 100644
index 000000000000..394f045644cc
--- /dev/null
+++ b/app-antivirus/lkrg/files/lkrg-0.9.4-gentoo-paths.patch
@@ -0,0 +1,20 @@
+commit fa75ae17394574d07cbf55a184a2ac7a73e9a0ed (HEAD -> main)
+Author: John Helmert III <ajak@gentoo.org>
+Date: Sat Jul 23 00:15:11 2022 -0500
+
+ Fix paths for Gentoo
+
+ Signed-off-by: John Helmert III <ajak@gentoo.org>
+
+diff --git a/scripts/bootup/systemd/lkrg.service b/scripts/bootup/systemd/lkrg.service
+index 4ac9812..495adb9 100644
+--- a/scripts/bootup/systemd/lkrg.service
++++ b/scripts/bootup/systemd/lkrg.service
+@@ -18,6 +18,6 @@ ConditionKernelCommandLine=!nolkrg
+ [Service]
+ Type=oneshot
+ ExecStart=/sbin/modprobe -v lkrg
+-ExecStartPost=/sbin/sysctl -p /etc/sysctl.d/01-lkrg.conf
++ExecStartPost=/usr/sbin/sysctl -p /lib/sysctl.d/01-lkrg.conf
+ ExecStop=/sbin/modprobe -v -r lkrg
+ RemainAfterExit=yes
diff --git a/app-antivirus/lkrg/lkrg-0.9.4.ebuild b/app-antivirus/lkrg/lkrg-0.9.4.ebuild
new file mode 100644
index 000000000000..874445ba0318
--- /dev/null
+++ b/app-antivirus/lkrg/lkrg-0.9.4.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit linux-mod linux-info systemd verify-sig
+
+DESCRIPTION="Linux Kernel Runtime Guard"
+HOMEPAGE="https://lkrg.org"
+SRC_URI="https://lkrg.org/download/${P}.tar.gz
+ verify-sig? ( https://lkrg.org/download/${P}.tar.gz.sign )"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64"
+
+BDEPEND="verify-sig? ( sec-keys/openpgp-keys-openwall )"
+
+MODULE_NAMES="lkrg(misc:${S}:${S})"
+VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}/usr/share/openpgp-keys/openwall.asc"
+
+PATCHES=( "${FILESDIR}/${P}-gentoo-paths.patch" )
+
+pkg_setup() {
+ CONFIG_CHECK="HAVE_KRETPROBES KALLSYMS_ALL KPROBES JUMP_LABEL"
+ CONFIG_CHECK+=" MODULE_UNLOAD !PREEMPT_RT ~STACKTRACE"
+ linux-mod_pkg_setup
+
+ # compile against selected (not running) target
+ BUILD_PARAMS="P_KVER=${KV_FULL} P_KERNEL=${KERNEL_DIR}"
+ BUILD_TARGETS="all"
+}
+
+src_unpack() {
+ if use verify-sig; then
+ verify-sig_verify_detached "${DISTDIR}"/${P}.tar.gz{,.sign}
+ fi
+
+ default
+}
+
+src_install() {
+ linux-mod_src_install
+
+ systemd_dounit scripts/bootup/systemd/lkrg.service
+ newinitd scripts/bootup/openrc/lkrg lkrg.initd
+
+ insinto /lib/sysctl.d
+ newins scripts/bootup/lkrg.conf 01-lkrg.conf
+}