app-admin/opensnitch-ebpf-module: add 1.6.6

Signed-off-by: Kai-Chun Ning (Github Signing key) <kaichun.ning@gmail.com>
This commit is contained in:
Kai-Chun Ning (Github Signing key) 2024-07-08 19:15:56 +02:00
parent d6b3cce245
commit cb154076c2
No known key found for this signature in database
GPG key ID: 6C0517493E2B6142
2 changed files with 75 additions and 0 deletions

View file

@ -1 +1,2 @@
DIST opensnitch-1.6.5.1.gh.tar.gz 1354814 BLAKE2B a3e0ce0b799a59d8d5e5cf9adc16d73b710d42b5325774118da3886a8c25507ef3a3e618796a56edd0cdde2ba8730604275a36d560e105d51744abef42fb833c SHA512 8ea1ad5a00c6b8c4649db5774e2fe7997ebdd52ed24610084ba236992c740b31b2bb19a88778b68d880aad54ff21a387d7388bdb4a8692a0456a4afbd7f47347
DIST opensnitch-1.6.6.gh.tar.gz 1359621 BLAKE2B b6b2fa5b13f39413deb622fc7b0ebaab1789f41f25522da2e0a86262754861e9407697362b4af3a5106f9b4f781c7f5727a089a8ae2d648aafa8994f1c4b9bf4 SHA512 2fcdcc3a6ae44b5d5ed1a436f6622e74d5834e01856c9a072bb759638192f8ba9f49cbb48bfd875978d87284a20d1206352690a0e6e5f584e247506c8829d99f

View file

@ -0,0 +1,74 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit linux-info
DESCRIPTION="eBPF process monitor module for opensnitch"
HOMEPAGE="https://github.com/evilsocket/opensnitch"
# NOTE: app-admin/opensnitch and this ebuild share the same source
SRC_URI="
https://github.com/evilsocket/opensnitch/archive/refs/tags/v${PV}.tar.gz -> opensnitch-${PV}.gh.tar.gz
"
S="${WORKDIR}/opensnitch-${PV}"
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64"
IUSE="dist-kernel"
EBPF_DIR=ebpf_prog
MINKV=5.5 # only compatible with kernels >= 5.5
RDEPEND="
dist-kernel? ( virtual/dist-kernel:= )
~app-admin/opensnitch-$PV
"
DEPEND="
virtual/linux-sources
>=sys-kernel/linux-headers-${MINKV}
"
BDEPEND="
sys-devel/bc
sys-devel/clang
sys-devel/llvm
"
RESTRICT="strip test"
QA_PREBUILT="*"
pkg_setup() {
# see https://github.com/evilsocket/opensnitch/discussions/978
local CONFIG_CHECK="
CGROUP_BPF
BPF_EVENTS
FTRACE_SYSCALLS
KPROBES_ON_FTRACE
KPROBE_EVENTS
UPROBE_EVENTS
"
linux-info_pkg_setup
kernel_is -ge ${MINKV//./ } || die "Kernel version at least ${MINKV} required"
}
src_compile() {
MODULES_MAKEARGS+=(
ARCH="x86"
EXTRA_FLAGS="-fno-stack-protector -fcf-protection"
KERNEL_DIR="${KV_DIR}"
KERNEL_HEADERS=/usr # gentoo installs linux-headers to /usr
)
emake "${MODULES_MAKEARGS[@]}" -C "$EBPF_DIR" || die
llvm-strip -g "$EBPF_DIR"/opensnitch*.o
}
src_install(){
insinto /usr/lib/opensnitchd/ebpf/
doins "$EBPF_DIR"/opensnitch.o
doins "$EBPF_DIR"/opensnitch-dns.o
doins "$EBPF_DIR"/opensnitch-procs.o
}