This is a short guide for building an OpenWrt snapshot firmware image. To build a stable release, look to the beginners guide to building your own firmware. There is a FAQ about difference between a release and a snapshot build.
This guide is not intended to cover all pitfalls, but provides a quick way to build an OpenWrt image, if everything goes well. Guides with more information about building an OpenWrt image:
- 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
Use a Linux, BSD or MacOSX system.
In Debian GNU/Linux 10 (buster) for example with:
sudo apt update
If package list information is not downloaded (step 1.1), message can be:
E: Unable to locate package
In Debian GNU/Linux 10 (buster) leave sudo privileged mode for example by:
Maybe alter permissions. For Fedora 30?
git clone https://git.openwrt.org/openwrt/openwrt.git
For more info see: the OpenWrt source code.
If dependency is not installed (step 1.2), message can be:
-bash: git: command not found
If trying second time, message can be:
fatal: destination path 'openwrt' already exists and is not an empty directory.
For following steps go to the openwrt directory.
If repository is not cloned (step 2.1), message can be:
-bash: cd: openwrt: No such file or directory
./scripts/feeds update -a ./scripts/feeds install -a
If dependencies are not installed (step 1.2), messages can be:
Can't exec “make”: No such file or directory at ./scripts/feeds line 22.
Unsupported version of make found: make
Checking 'gcc'… failed.
Checking 'working-gcc'… failed.
Checking 'g++'… failed.
Checking 'working-g++'… failed.
Checking 'ncurses'… failed.
Checking 'awk'… failed.
Checking 'unzip'… failed.
Checking 'bzip2'… failed.
Checking 'wget'… failed.
Checking 'python'… failed.
Checking 'python3'… failed.
Checking 'file'… failed.
If directory is wrong (step 2.2), message can be:
-bash: ./scripts/feeds: No such file or directory
This opens the OpenWrt configuration menu for setting target and options.
E.g. for target “TL-WR841N v11” Wi-Fi router do following:
To exit OpenWrt configuration and save target with options settings do following:
Completion can take time.If successful, the images are in directory ./bin/targets/ar71xx/generic/
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.