Debian based Docker image for building the MediaTek OpenWrt SDK against OpenWrt 25.12, with full support for the Banana Pi R4, including the 8GB RAM variant.
The image backports OpenWrt PR #21437 by @frank-w (8GB DRAM support) into the OpenWrt 25.12 branch pre‑prepared with autobuild.sh prepare. The Dockerfile itself and the remaining patches, are based on the build scripts maintained by @woziwrt and @chenglong-do
All that is done here is to mix these and write it into a docker image for multi-platform usage, reproducibility and clean state management.
docker build --tag openwrt-mtk-builder_openwrt25.12_4bg .docker run -it openwrt-mtk-builder_openwrt25.12_4bg bashThis drops you into a fully prepared OpenWrt/MTK SDK environment where you can rebuild, inspect logs, or modify configs.
From here you can run:
make menuconfigto add/remove packages to the build.
To run the build:
bash ../mtk-openwrt-feeds/autobuild/unified/autobuild.sh filogic-mac80211-mt798x_rfb-wifi7_nic buildThe final images will be located at:
/home/build/openwrt/bin/targets/mediatek/filogic- OpenWrt and MTK feed revisions are pinned.
- All modifications are applied via patches.
- The resulting images boot cleanly on the Banana Pi R4 (8GB RAM model) for all: eMMC, SNAND and SDcard.
There is currently an issue when booting from NAND where the boot procedure hangs after loading the kernel with: "Waiting for root device: /dev/fit0". To fix this you can install only the sysupgrade squashfs part from openwrt online snapshots.Fixed with 865229fa - This Docker image is developed and tested on macos M1, so it pulls Debian for ARM. Packages installed with
aptmay differ between ARM and x86 hosts. - This repository is not intended to upstream or distribute any code or images; it provides a practical build environment to generate working images in multiple host architectures, without dealing with MTK SDK quirks.
- https://git01.mediatek.com/plugins/gitiles/openwrt/feeds/mtk-openwrt-feeds/+/refs/heads/master/autobuild/unified/doc/MediaTek_OpenWrt_2512_User_Guide.md
- https://www.fw-web.de/dokuwiki/doku.php?id=en:bpi-r4:start
- https://forum.openwrt.org/t/banana-bpi-r4-all-related-to-mtk-sdk/221080
- https://www.openwrt.pro/post-640.html
- https://openwrt.org/inbox/toh/sinovoip/bananapi_bpi-r4
- https://forum.openwrt.org/t/tutorial-build-customize-and-use-mediatek-open-source-u-boot-and-atf/134897
- https://github.com/danpawlik/openwrt-builder