Install this version:
emerge -a =app-admin/opensnitch-ebpf-module-1.8.0
| Version | EAPI | Keywords | Slot |
|---|---|---|---|
| 1.8.0 | 8 | amd64 | 0 |
# 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
llvm-core/clang
llvm-core/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() {
local extra_flags="-fno-stack-protector -fcf-protection"
# kernel 6.19 restructured ns_common with anonymous structs requiring MS extensions
kernel_is -ge 6 19 && extra_flags+=" -Wno-microsoft-anon-tag -fms-extensions"
MODULES_MAKEARGS+=(
ARCH="x86"
EXTRA_FLAGS="${extra_flags}"
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
}
Manage flags for this package:
euse -i <flag> -p app-admin/opensnitch-ebpf-module |
euse -E <flag> -p app-admin/opensnitch-ebpf-module |
euse -D <flag> -p app-admin/opensnitch-ebpf-module
virtual/linux-sources >=sys-kernel/linux-headers-5.5
dist-kernel? ( virtual/dist-kernel:= ) ~app-admin/opensnitch-1.8.0
sys-devel/bc llvm-core/clang llvm-core/llvm
| Type | File | Size | Source URLs |
|---|---|---|---|
| DIST | opensnitch-1.8.0.gh.tar.gz | 1764605 bytes | https://github.com/evilsocket/opensnitch/archive/refs/tags/v1.8.0.tar.gz |