1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
Description: Changed how ebpf build find kernel headers from running to installed version.
The installed kernel do not match running kernel in chroots and containers.
Author: Petter Reinholdtsen <pere@hungry.com>
Forwarded: https://github.com/evilsocket/opensnitch/pull/1327
Last-Update: 2025-04-20
---
Index: opensnitch-salsa/ebpf_prog/Makefile
===================================================================
--- opensnitch-salsa.orig/ebpf_prog/Makefile 2025-04-20 09:53:55.679288526 +0200
+++ opensnitch-salsa/ebpf_prog/Makefile 2025-04-20 09:54:12.000000000 +0200
@@ -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
|