4 Commits
Author SHA1 Message Date
QiuSimons 410ada4598 feat: expand BTF coverage with declarative header probes 2026-12-04 15:42:39 +08:00
QiuSimons 4585b7c38a style: add trailing newlines to C stubs and format Makefile spacing 2026-10-20 18:22:20 +08:00
QiuSimons 707ceada49 vmlinux-btf: rework BTF generation using prepared kernel headers
Replace the full shadow kernel build with a lightweight stub compilation
approach against the target's already-prepared kernel headers:

- Add multi-tier C stub units (shadow_btf_core.c, shadow_btf_modules.c,
  shadow_btf_private.c) that include key kernel headers to capture struct
  layouts with exact fidelity, without modifying or rebuilding the host kernel
- Use pahole on the resulting stub object to produce a detached BTF blob
- Simplify Makefile: drop PKG_SOURCE/PKG_HASH, remove shadow kernel patches
  and kernel download steps; build is now fast, deterministic, and SDK-native
- Add multi-arch GitHub Actions CI workflow building against OpenWrt 24 and 25
  SDKs across aarch64_generic, cortex-a53/a72/a76, and x86_64
- Add pahole binary detection with multi-path fallback and version verification
- Add fallback objcopy path for older pahole versions lacking --btf_encode_detached
2026-10-20 15:19:38 +08:00
QiuSimons 415093abbe vmlinux-btf: initial implementation with full shadow kernel build approach
Add Makefile and README for vmlinux-btf package, which supplies kernel BTF
information to enable CO-RE eBPF compatibility on OpenWrt without rebuilding
the kernel. Uses a full shadow kernel build: downloads matching upstream Linux
source, applies OpenWrt patches, copies target kernel .config, enables BTF
debug info flags, compiles vmlinux, and extracts a detached BTF blob via
pahole. Installs to /usr/lib/debug/boot/vmlinux on the target device.
2026-10-20 15:19:38 +08:00