mirror of
https://github.com/pentoo/pentoo-overlay
synced 2026-04-21 06:10:56 +02:00
app-admin/opensnitch-ebpf-module: add 1.6.2
Signed-off-by: Kai-Chun Ning <kaichun.ning@gmail.com>
This commit is contained in:
parent
a30a83eb6c
commit
df3ec9347b
2 changed files with 75 additions and 0 deletions
|
|
@ -1 +1,2 @@
|
|||
DIST opensnitch-1.6.0.tar.gz 1291940 BLAKE2B bc9e131f5cdf0631ca828ab41511e2852d2d694bafa5832204f28f38f1a4b0fc103d019267ad12bee84a3077dbca6acf279226fd679ee46f18fd1f24a49072f5 SHA512 4ff4ab840bc81c6df1d37d3390a7719141f583d5a8079561d0d07f5e67d3af5a7b13e0bf196fbe4b969183f63eb67f065a86c65d9c184f58b804efa4ad9a279c
|
||||
DIST opensnitch-1.6.2.tar.gz 1341337 BLAKE2B c71c89f758d9fdc0a7968c28c8b79791ddf0446392e243acf4db95302d1d109a68372b29bd5b068c41d0bd5ae426a68807d7045a448128fc8badc8ecb906952b SHA512 79e32520e9e370718f0096af8766867154e0e556c164f193816ba965e4d267146941e9849842f42cd2c9bcd00838df460c17570e5c34cf3c2a812491638b71ba
|
||||
|
|
|
|||
|
|
@ -0,0 +1,74 @@
|
|||
# Copyright 1999-2023 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}.tar.gz
|
||||
"
|
||||
S="${WORKDIR}/opensnitch-${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
|
||||
}
|
||||
Loading…
Reference in a new issue