From: Petter Reinholdtsen Date: Sat, 3 May 2025 03:50:32 +0000 (+0200) Subject: Changed how ebpf build find kernel headers from running to installed version. X-Git-Tag: archive/raspbian/1.6.9-3+rpi1~1^2~6 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=53e12e434662eb8c926771e31a7d1c019b3501ed;p=opensnitch.git Changed how ebpf build find kernel headers from running to installed version. Forwarded: https://github.com/evilsocket/opensnitch/pull/1327 Last-Update: 2025-04-20 The installed kernel do not match running kernel in chroots and containers. Last-Update: 2025-04-20 Gbp-Pq: Name 1000-installed-kernel-headers.patch --- diff --git a/ebpf_prog/Makefile b/ebpf_prog/Makefile index e92aeef..d919ea4 100644 --- a/ebpf_prog/Makefile +++ b/ebpf_prog/Makefile @@ -3,8 +3,9 @@ # On Debian based distros we need the following 2 directories. # Otherwise, just use the kernel headers from the kernel sources. # -KERNEL_DIR ?= /lib/modules/$(shell uname -r)/source -KERNEL_HEADERS ?= /usr/src/linux-headers-$(shell uname -r)/ +KERNEL_VER ?= $(shell ls -d /lib/modules/*/source | sort | tail -1 | cut -d/ -f4) +KERNEL_DIR ?= /lib/modules/$(KERNEL_VER)/source +KERNEL_HEADERS ?= /usr/src/linux-headers-$(KERNEL_VER)/ CLANG ?= clang LLC ?= llc LLVM_STRIP ?= llvm-strip -g