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
# 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