mirror of
https://github.com/kenzok8/vmlinux-btf.git
synced 2026-12-05 08:05:16 +00:00
2.7 KiB
2.7 KiB
🧬 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