- Replace full shadow kernel build with direct stub compilation against target headers - Add multi-tier stub units for core, module, and private kernel structures - Ensure exact struct layout fidelity without modifying host kernel Kconfig - Simplify and modernize OpenWrt Makefile for maintainability - Add multi-arch GitHub Actions CI workflow supporting OpenWrt 24 and 25 SDKs fix(ci): install real llvm package for multi-arch llvm-objcopy support fix(ci): bridge llvm-objcopy to objcopy for pahole -J BTF encoding - Clean redundant narrative comments in Makefile for idiomatic KISS structure - Link llvm-objcopy to target/host objcopy so older pahole -J can insert .BTF section fix(makefile): add fallback for older pahole without --btf_encode_detached fix(makefile): use wildcard linking to prevent make eval expansion error and drop unsupported --jobs from pahole ci: fix YAML string termination in Debian sources configuration ci: repoint Debian Bullseye to archive.debian.org to fix EOL 404 ci: fix host pahole installation and streamline path detection - Install dwarves (which provides pahole in Bullseye) with fallback to pahole - Add fail-fast check in CI to verify pahole existence before OpenWrt compilation - Symlink detected pahole binary into OpenWrt staging_dir/host/bin - Streamline BTF_PAHOLE search paths in Makefile (KISS: staging_dir, /usr/bin, /usr/local/bin) ci: fix host pahole detection under OpenWrt isolated PATH - Explicitly install pahole and dwarves packages in SDK container - Symlink host pahole into OpenWrt staging_dir/host/bin to survive PATH sanitization - Add absolute wildcard fallbacks (/usr/bin/pahole, /usr/local/bin/pahole) in Makefile - Verify pahole executable viability via --version before BTF generation
vmlinux-btf
OpenWrt package that generates a detached BTF (vmlinux) file from kernel headers and .config, enabling CO-RE (Compile Once – Run Everywhere) eBPF programs on OpenWrt without rebuilding or replacing the running kernel.
Overview
Official OpenWrt release kernels typically omit CONFIG_DEBUG_INFO_BTF=y. Without kernel BTF, modern eBPF tools that rely on CO-RE (such as libbpf-based loaders) cannot resolve kernel type layouts.
Rather than recompiling the entire kernel tree, this package compiles lightweight stub sources (src/shadow_btf_*.c) against the prepared target kernel headers ($(LINUX_DIR)) using the target configuration and toolchain. pahole then extracts the detached BTF blob from the linked object.
Requirements
- OpenWrt buildroot or SDK environment.
- Host
pahole>= 1.22 (from thedwarvespackage).
Building
In OpenWrt SDK
git clone https://github.com/QiuSimons/vmlinux-btf.git package/vmlinux-btf
make package/vmlinux-btf/compile V=s
In OpenWrt Buildroot
Select vmlinux-btf under Kernel in make menuconfig, then build:
make package/vmlinux-btf/compile V=s
Installed Files
/usr/lib/debug/boot/vmlinux: Detached BTF file./usr/lib/debug/boot/vmlinux-<release>: Symlink targetingvmlinux(linked touname -ron target installation).
Standard loaders such as libbpf look for BTF at /usr/lib/debug/boot/vmlinux-$(uname -r) and /usr/lib/debug/boot/vmlinux by default.
License
GPL-3.0-or-later