File: 1000-installed-kernel-headers.patch

package info (click to toggle)
opensnitch 1.6.9-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,980 kB
  • sloc: python: 12,604; ansic: 1,965; sh: 435; makefile: 239; xml: 50; sql: 3
file content (22 lines) | stat: -rw-r--r-- 1,082 bytes parent folder | download | duplicates (2)
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