2.9 KiB
2.9 KiB
Building Netifyd with OpenWrt Buildroot
Overview
Netifyd requires full OpenWrt buildroot for building because it needs system libraries that are not available in the SDK.
Automatic Build (Recommended)
The local-build.sh script automatically detects netifyd and uses OpenWrt buildroot:
./secubox-tools/local-build.sh build netifyd
This will:
- Download OpenWrt 24.10.5 source (~500 MB)
- Setup feeds
- Copy SecuBox packages
- Install netifyd from SecuBox feed
- Configure and build netifyd
Build time:
- First build: 15-30 minutes (downloads toolchain, builds dependencies)
- Subsequent builds: 2-5 minutes (incremental)
What Gets Built
The buildroot provides all required dependencies:
libmnl- Minimal Netlink librarylibnetfilter-conntrack- Connection trackinglibpcap- Packet capturelibjson-c- JSON parsinglibcurl- HTTP client- Kernel modules: nf_conntrack, nfnetlink, etc.
Output
After successful build:
# Package location
./build/x86-64/netifyd_5.2.1-1_x86_64.ipk
# Also findable at
./openwrt/bin/packages/x86_64/secubox/netifyd_5.2.1-1_x86_64.ipk
Manual Build
If you prefer manual control:
cd openwrt/
# Configure
make menuconfig
# Select: Network > netifyd
# Build
make package/netifyd/compile V=s
Why Not SDK?
The SDK cannot build netifyd because:
- SDK only includes application-level library stubs
- Netifyd needs kernel-level libraries (libmnl, libnetfilter-conntrack)
- These libraries must be compiled against the target system
- Only full buildroot provides the complete dependency chain
Troubleshooting
Issue: Build fails with "libmnl not found"
Cause: Using SDK instead of buildroot
Fix: The script should auto-detect and use buildroot. If not:
# Ensure you're using the build command, not compiling directly in SDK
./secubox-tools/local-build.sh build netifyd
Issue: Build takes too long
Normal: First build downloads toolchain and compiles base libraries (15-30 min)
Speed up: Use faster machine or pre-compiled SDK for dependencies
Issue: Out of disk space
Cause: OpenWrt buildroot needs ~10 GB
Fix: Free up space or use different build directory:
OPENWRT_DIR=/path/to/large/disk/openwrt ./secubox-tools/local-build.sh build netifyd
Comparison: SDK vs Buildroot
| Feature | SDK | Buildroot |
|---|---|---|
| Size | ~300 MB | ~2 GB |
| Build time | Fast (2-5 min) | Slow first time (15-30 min) |
| Can build apps | ✅ Yes | ✅ Yes |
| Can build system daemons | ❌ No | ✅ Yes |
| Kernel libraries | ❌ No | ✅ Yes |
| Full dependency tree | ❌ No | ✅ Yes |
Netifyd needs: Buildroot ✅
See Also
- BUILD-INSTRUCTIONS.md - Detailed build instructions
- SDK-LIMITATION.md - Why SDK doesn't work
- INTEGRATION.md - Integration with SecuBox