This is a very short guide on how to compile your first OpenWrt snapshot firmware. If you want to compile a stable release, use the Beginners guide to building your own firmware as a guide.
This guide does not cover any pitfalls, but provides a quick way if everything goes well. Alternative guides to achieving the same goal: Using the Image Builder, Beginners guide to building your own firmware.
The development branch can contain experimental code that is under active development and should not be used for production environments. Snapshot images may support additional hardware; however, it is experimental, considered unstable, and sometimes won't compile.
Prebuilt snapshot images do not come with any web interface or GUI. You will need to be comfortable using a command line and remote shell to install one yourself → See How to install LuCI and Use SSH to connect to the internet and install Luci Web interface
First we need to make sure the dependencies are installed. See these examples of package installations.
sudo apt-get update sudo apt-get install subversion g++ zlib1g-dev build-essential git python python3 python3-distutils libncurses5-dev gawk gettext unzip file libssl-dev wget libelf-dev ecj fastjar java-propose-classpath
For Ubuntu 18.04 or later:
sudo apt-get install build-essential libncursesw5-dev python unzip
For Fedora 30:
sudo dnf install @c-development @development-tools @development-libs zlib-static elfutils-libelf-devel gawk unzip file wget python3
Get the OpenWrt source code:
umask 0022 git clone https://git.openwrt.org/openwrt/openwrt.git cd openwrt ./scripts/feeds update -a ./scripts/feeds install -a make menuconfig
The last command will open a menu.
If you want to build images for the “TL-WR841N v11” Wifi-Router, select:
In the menu, select Exit and then Yes to save your settings. Now build the images. That may take some time:
Afterwards, the images can be found in ./bin/targets/ar71xx/generic/ - done.
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 downloadprior to parallel compilation is recommended to prevent some of these errors (
-jNis generally safe for the download step for those with faster Internet connectivity.)
make menuconfigand compile again.
<buildroot>/files, e.g. if you want to have
my_configincluded in your image in the directory
<buildroot>/files/etc/config/my_config. If the
filesdirectory doesn't exist on your buildsystem, then create it.