External Toolchain
Use OpenWrt as External Toolchain
Using an external toolchain reduce build time when starting with a cleaned-up source tree. Useful when using an automated build system like Hudson/Tinderbox.
Step 1: Build Toolchain
Just do the same as everytime you (re)compile OpenWrt. Checkout openwrt repo, set your options in .config and build the whole thing. Only difference you have to select Package the OpenWrt-based Toolchain
in the main view of make menuconfig
Alternatively you can download precompiled toolchain from openwrt download page by searching for the correct toolchain for your target. For example if you need precompiled toolchain for openwrt 22.03.0 for target ipq806x/generic this is the link to use.
Step 2: Build Firmware
- Checkout OpenWrt into directory openwrt
- Follow normal instruction for openwrt prereq
- Use the utility script to setup your buildroot
./scripts/ext-toolchain.sh \ --toolchain TOOLCHAIN_FILE_LOCATION \ --config TARGET_NAME (example ipq806x/generic)
- Use your buildroot like a normal one. Edit your config with
make menuconfig
and runmake
to compile your image
If you want to update a .config to use an external toolchain you can use the --overwrite-config
. For example:
./scripts/ext-toolchain.sh \ --toolchain TOOLCHAIN_FILE_LOCATION \ --overwrite-config --config TARGET_NAME (example ipq806x/generic)