This method is NOT OFFICIALLY supported.
A native GNU/Linux environment is recommended.
Current supported OpenWrt releases are for 16/128 devices - at least 16Mbytes Flash and 128MBytes RAM.
Devices with ≤4MB Flash and/or ≤32MB RAM (so-called “4/32 devices”) sometimes can be made to work but they will be very limited (maybe no additional packages can be installed or ran, setting password or changing network settings might not be possible any more, device can get useless) because of low RAM/Flash space.
Build guide mainly based on an old revision of OpenWrt document "Quick Image Building Guide".
A suitable case-sensitive file system.
Last tested on WSL2 (Windows Version 10.0.19044.1586) with Debian GNU/Linux 11 (bullseye).
Mind issue with path!
Debian terminal command:
sudo apt update
See examples of package installations.
Verify link and required packages!
Debian terminal command:
exit
|
For OpenWrt 19.07 Debian terminal command: git clone -b openwrt-19.07 --single-branch https://git.openwrt.org/openwrt/openwrt.git openwrt_19.07 |
For OpenWrt 21.02 Debian terminal command: git clone -b openwrt-21.02 --single-branch https://git.openwrt.org/openwrt/openwrt.git openwrt_21.02 |
|
For OpenWrt 19.07 Debian terminal command: cd openwrt_19.07 |
For OpenWrt 21.02 Debian terminal command: cd openwrt_21.02 |
If there is a new release in the branch, update local branch repository with Debian terminal command:
git pull
|
For OpenWrt 19.07 Debian terminal command: git checkout v19.07.8 |
For OpenWrt 21.02 Debian terminal command: git checkout v21.02.3 |
Debian terminal command:
./scripts/feeds update -a && ./scripts/feeds install -a
For router hardware select corresponding values in menu ( link to router hardware table):
Maybe add “LuCI”:
Maybe remove some packages to save space.
- remove “PPP daemon”:
- remove “IPv6 support”:
Maybe make WPA2 Enterprise with wpa_supplicant available by:
- remove “wpad-mini”:
|
For OpenWrt 19.07:
|
For OpenWrt 21.02:
|
- add “wpad”:
|
For OpenWrt 19.07:
|
For OpenWrt 21.02:
|
Maybe add load balancing/failover with multiple WAN interfaces.
- add “MAC-VLAN support”:
- add “LuCI support for the MWAN3 multiwan hotplug script”:
- or without LuCI, add “Multiwan hotplug script with connection tracking support”:
Maybe add network watchdog utility.
- add “LuCI Support for Watchcat”:
- or without LuCI, add “Watchcat”:
To exit OpenWrt Configuration and save target with options settings do following:
Debian terminal command:
make V=s 2>&1 | tee build.log
Completion can take time. If successful, the images are in the directory ./bin/targets/<target directory>
To recompile the images, remove files from directory ./bin/targets/<target directory> and build image (step 4) again.
What about cleaning up “make clean”, “make dirclean”, “make distclean”?
For faster compiling, use make -j N, where N is the number of CPU cores + 1. Be aware that this method is prone to errors during compiling. In case you encounter compile errors, your very first step is to compile again without -j N. Use of make download prior to parallel compilation is recommended to prevent some of these errors (-jN is generally safe for the download step for those with faster Internet connectivity.)
To build an OpenWrt firmware image for other hardware or with other options, use the OpenWrt Configuration (step 3) and then build image (step 4) again.
Also more hardware info on wikidevi.
Other OpenWrt pages: