Skip to content

williamchenghu/dockerOpenwrt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dockerOpenwrt

Compile Openwrt firmware with docker (e.g. macOS or Windows)

WHY

Official Openwrt no longer supports all legacy hardware after 17.01 (some after 18.06). However, as you might've modded your hardware as I did, let's compile openwrt oursleves to fit our own hardware mods.

HOW

The Dockerfile here is used to merely create a linux environement (ubuntu).

docker build -t docker-openwrt:latest .

Once docker container is launched from the image being built via the Dockerfile, you can choose which script to run according to your needs.

docker run --rm --name openwrt-compiler -it docker-openwrt

Each version is supported via a shell script named after their version number. By executing the script, a commandline menu will be shown for one to tweak build preferences (e.g., target system, subtarget (generic, tiny, nand, etc.), target images (which hardware is one building the image for), kernel modules, various packages).

Note.

  • You may be asked to choose the correct time zone.
  • For v19.07, one shall choose Atheros AR7xxx/AR9xxx under Target System instead of Atheros ATH79 (DTS)
  • some Target Profiles (e.g., tp-wr703n, tp-wr740n) can be found by choosing Devices with small flash (aka. tiny) in Subtarget.
  • remember to enable the web GUI for easy management (disabled for tiny targets by default)
    • luci under LuCI -> Collections
    • luci-theme-openwrt-2020 under LuCI -> Themes
  • consider take out PPPoE related choices if never needed:
    • ppp, ppp-mod-pppoe under Network
    • kmod-ppp, kmod-pppoe, kmod-pppox under Kernel modules -> Network Support
./v19_07_10.sh
or
./v22_03_0.sh

After configuring build parameters (, also ), choose Exit and one will be asked if preferences shall be saved, go ahead and confirm. At this point, one can enter the source code folder (aka. openwrt), and do the compilation.

cd openwrt
make -j $(nproc)

Once done building, you can find the kernel, manifest, factory.bin and sysupgrade.bin inside the folder /openwrt/bin/targets/ar71xx/tiny/ (or /openwrt/bin/targets/ath79/tiny/), which can be then copied out at the docker host's terminal with command

docker cp openwrt-compiler:*FILE_PATH* *LOCAL_PATH*

ps. Your can clean up docker leftovers after compile work

docker system prune -a

Supported Hardware

Hardware Flash(NAND)/RAM now Openwrt version
TP-Link TL-WR703N 8MB (winbond 25Q64FVSIG) / 64MB (ELPIDA D5116AFTA-5B-E) 22.03.0
TP-Link TL-WR740N 8MB (winbond 25Q64FVSIG) / 64MB (ELPIDA D5116AFTA-5B-E) 22.03.0

About

Compile your own Openwrt firmware with docker.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published