mirror of
https://github.com/kenzok8/vmlinux-btf.git
synced 2026-12-05 16:08:54 +00:00
7fa8cdbe30f841847923850b176bd514745ca345
The package build expands Build/Compile twice, so shell variables written as double-dollar did not survive: the CI log shows the executed recipe with MAKE_BIN (from $$CMAKE_BIN), ATH (from $$PATH) and an empty -j (from $$(nproc)) — 'MAKE_BIN: command not found', Error 127. Drop shell variables entirely: pick cmake with a make-time wildcard test, expand PATH with $(PATH) and the job count with $(shell nproc) — all resolve to literals on the first expansion, so the second expansion cannot mangle them. Verified locally with a double-expansion test on the real define block (output identical after two expansions, cmake path and -j number intact).
🧬 vmlinux-btf
Supply kernel BTF to OpenWrt firmware built without it, so dae / daed start.
简体中文 | English
🤔 Why
dae / daed load CO-RE eBPF programs that need the running kernel's BTF.
| Kernel | /sys/kernel/btf/vmlinux |
daed starts |
|---|---|---|
CONFIG_DEBUG_INFO_BTF enabled (ImmortalWrt 25.12, …) |
✅ present | ✅ yes |
| Not enabled (stock OpenWrt, online ImageBuilder images) | ❌ absent | ❌ fails |
Many firmwares ship without BTF, so daed won't start. Installing this package fixes that.
⚙️ How it works
OpenWrt kernel source + .config
│ enable DEBUG_INFO_BTF, build a shadow kernel
▼
shadow vmlinux ──pahole──▶ detached vmlinux.btf
│ package & install
▼
/usr/lib/debug/boot/vmlinux-<release>
│
▼
cilium/ebpf falls back here when
/sys/kernel/btf/vmlinux is absent → daed starts ✓
The package version tracks the kernel version (
PKG_VERSION = LINUX_VERSION). BTF is compatible within a kernel minor series, so a6.6.xpackage works on other6.6.yfirmware.
📦 Support matrix
| Kernel | SDK | Pkg fmt | Typical firmware |
|---|---|---|---|
6.6.x |
ImmortalWrt 24.10 | IPK | Stock OpenWrt 24.10 and 24.10-based images |
6.12.x |
ImmortalWrt 25.12 | APK | 25.12-based images that lack BTF |
ImmortalWrt's own images usually ship BTF in-kernel and don't need this package.
🚀 Install
# 1. Confirm the firmware really lacks BTF
[ -e /sys/kernel/btf/vmlinux ] && echo "BTF present, skip" || echo "BTF missing, install"
# 2. Check kernel version + arch, download the matching package, install
uname -r # e.g. 6.6.141 → pick the 6.6.x package
opkg install ./vmlinux-btf_*.ipk # or: apk add ./vmlinux-btf-*.apk
# 3. Restart daed
/etc/init.d/daed restart
🔨 Build it yourself
gh workflow run build.yml
Builds all 9 architectures × {24.10 IPK, 25.12 APK} and publishes them to Releases.
🙏 Credit
Recipe adapted from sbwml / QiuSimons vmlinux-btf.
BTF support for openwrt-daede and other eBPF dependencies
Languages
Python
59.4%
Makefile
40.6%