Skip to content

Commit 91b8104

Browse files
committed
meta-kernel-block: add BPF support
Change-type: patch Signed-off-by: Alex Gonzalez <alexg@balena.io>
1 parent 7c5b43a commit 91b8104

3 files changed

Lines changed: 37 additions & 1 deletion

File tree

layers/meta-kernel-block/recipes-core/images/balena-kernel-block.bb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ LICENSE = "MIT"
33

44
inherit balena-hostapp-extension
55

6-
IMAGE_INSTALL = "kernel-extension-modules kernel-extension-image-initramfs kernel-extension-devicetree"
6+
IMAGE_INSTALL = "kernel-extension-modules kernel-extension-image-initramfs kernel-extension-devicetree bpftool libbpf"
77

88
IMAGE_LINGUAS = ""
99
VIRTUAL-RUNTIME_init_manager = ""
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
COMPATIBLE_HOST = "(x86_64|aarch64).*-linux"
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# BPF LSM + BTF + tracing/observability
2+
#
3+
# Enables the in-kernel BPF security module, BTF type information for
4+
# kernel introspection, always-on JIT, and the function/kprobe tracing
5+
# surface bpftrace/Tetragon-class agents need.
6+
#
7+
# These entries require =y kernel-config changes (LSM hook chain,
8+
# DEBUG_INFO). meta-kernel-modules-block could not have produced them.
9+
10+
# Debug info / BTF prerequisites. Full DWARF is required for BTF.
11+
CONFIG_DEBUG_INFO=y
12+
# CONFIG_DEBUG_INFO_NONE is not set
13+
# CONFIG_DEBUG_INFO_REDUCED is not set
14+
CONFIG_DEBUG_INFO_BTF=y
15+
16+
# BPF core. Most of these are typically already =y in modern defconfigs;
17+
# stating them explicitly keeps the fragment robust against base changes.
18+
CONFIG_BPF=y
19+
CONFIG_BPF_SYSCALL=y
20+
CONFIG_BPF_JIT=y
21+
CONFIG_BPF_JIT_ALWAYS_ON=y
22+
23+
# BPF LSM. CONFIG_LSM is a comma-separated string of active LSMs; the
24+
# value below matches the upstream 5.18+ default with bpf included. If
25+
# the balena base defconfig has a custom LSM order, this overrides it.
26+
CONFIG_BPF_LSM=y
27+
CONFIG_LSM="landlock,lockdown,yama,loadpin,safesetid,bpf,integrity"
28+
29+
# Tracing surface for observability.
30+
CONFIG_FTRACE=y
31+
CONFIG_FUNCTION_TRACER=y
32+
CONFIG_KPROBES=y
33+
CONFIG_KPROBE_EVENTS=y
34+
CONFIG_PERF_EVENTS=y
35+
CONFIG_BPF_EVENTS=y

0 commit comments

Comments
 (0)