# [OpenWRT](https://openwrt.org/) ## Environment Setup ### Ubuntu ### macOS ### WSL2 ## Build - [[OpenWrt Wiki] Build system usage](https://openwrt.org/docs/guide-developer/toolchain/use-buildsystem) ### Default config for Bananapi BPi-R64 - `make defconfig` - `make menuconfig` - Target System -> MediaTek Ralink ARM - Subtarget -> MT7622 - Target Profile -> Bananapi BPi-R64 - Save -> Ok -> Exit - `make -j $(nproc) kernel_menuconfig` - Save -> Ok -> Exit - `make -j $(nproc) download` - `make -j $(($(nproc)+1)) V=s` - Image Location - `<openwrt>/bin/targets/mediatek/mt7622/openwrt-mediatek-mt7622-bananapi_bpi-r64-sdcard.img.gz` ### Build the OpenWrt Image Builder - `make menuconfig` - `[*] Build the OpenWrt Image Builder` - `[ ] Include package repositories` - Save -> Ok -> Exit - `make -j $(($(nproc)+1)) V=s` - Image Builder Location - `<openwrt>/bin/targets/mediatek/mt7622/openwrt-imagebuilder-mediatek-mt7622.Linux-x86_64.tar.xz` ### Issue #### Build failed with externel toolchain - https://blog.csdn.net/weixin_38387929/article/details/117020343 - https://insidelinuxdev.net/article/a098rr.html - https://patchwork.ozlabs.org/project/openwrt/patch/20190611103248.31917-1-nylon7@andestech.com/ - https://github.com/openwrt/openwrt/commit/2555ffb4536e2727465e9a0d426ad3c4f1ef003a - https://stackoverflow.com/questions/48777554/what-is-the-difference-between-ar-nm-and-gcc-ar-gcc-nm ## BPI-R3 - https://wiki.banana-pi.org/Banana_Pi_BPI-R3 - https://github.com/BPI-SINOVOIP/BPI-R3-OPENWRT-V21.02.3 - https://forum.banana-pi.org/t/banana-pi-bpi-r3-openwrt-image/13236/4 - https://github.com/openwrt/openwrt/commit/a96382c1bb204698cd43e82193877c10e4b63027#diff-f54843b2d13758fa12550a0a284276695bc0b66919fc7a192c025f2db196b70f - https://forum.banana-pi.org/t/bpi-r3-hw-issues/14027 - https://github.com/openwrt/mt76 - Disable `CONFIG_GDB` - https://git01.mediatek.com/plugins/gitiles/?format=HTML ## Reference - https://www.cnblogs.com/xiaomingjun/p/16112836.html