app-admin/opensnitch-ebpf-module: add 1.6.5_p1

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-02-14 19:25:28 +01:00
parent 355fbab7df
commit b58c140311
No known key found for this signature in database
GPG key ID: 6C0517493E2B6142
2 changed files with 76 additions and 0 deletions

View file

@ -1,2 +1,3 @@
DIST opensnitch-1.6.4.tar.gz 1342558 BLAKE2B 3468456b699002634a2a407d1e07c86d54828a73407d0736d6b6a2080b4a2898d91737f48bd70289984578f305d1bfbfcd455bccd6b8b7adedc954e39f4dfe9b SHA512 0a4618af851e2f919d90a9b71b6946a536ed898ae10195e4ceb9a226036c6db299a4641a511b84de05d53a4743fdba8945acd281f4acf2d2fe9ff2ad80688c93
DIST opensnitch-1.6.5.tar.gz 1354754 BLAKE2B 8672208d6b4824186d102054fb5e2f9debc5f761d83908808e5392bdca1dc876bbd3c91468c54b15b92bd020fdd7e07779e3d5cc619e6e28bfcd9bae9320d86b SHA512 f697a75d1dc3f1e50579cda4b04bad8ddfb30969c31998300a78fae7e679d066b1f99430d4a2acaae36af46f5cbc48f46edc981b14ea37f2bbde556121d3a541
DIST opensnitch-1.6.5_p1.tar.gz 1354814 BLAKE2B a3e0ce0b799a59d8d5e5cf9adc16d73b710d42b5325774118da3886a8c25507ef3a3e618796a56edd0cdde2ba8730604275a36d560e105d51744abef42fb833c SHA512 8ea1ad5a00c6b8c4649db5774e2fe7997ebdd52ed24610084ba236992c740b31b2bb19a88778b68d880aad54ff21a387d7388bdb4a8692a0456a4afbd7f47347

View file

@ -0,0 +1,75 @@
# 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"
UPSTREAM_PV=${PV/_p/\.}
# NOTE: app-admin/opensnitch and this ebuild share the same source
SRC_URI="
https://github.com/evilsocket/opensnitch/archive/refs/tags/v${UPSTREAM_PV}.tar.gz -> opensnitch-${PV}.tar.gz
"
S="${WORKDIR}/opensnitch-${UPSTREAM_PV}"
EBPF_DIR=ebpf_prog
KEYWORDS="~amd64"
LICENSE="GPL-3"
SLOT="0"
IUSE="dist-kernel"
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
}