mirror of
https://github.com/kenzok8/vmlinux-btf.git
synced 2026-12-05 16:08:54 +00:00
bebda8098511d7f042a201823ed4b46425492d75
改动:kernel_version 输入对两个 lane 都生效,新增 sdk/arch 过滤(setup job 生成矩阵),限定过滤时跳过发布以免冲掉其它架构的包。 原因:24.10 的点版本内核与分支 HEAD 不一致,BTF 必须按用户实际 uname -r 构建,否则发出的 BTF 对不上任何一台常规设备。
🧬 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%