My OpenWrt firmware image building guide

Debian terminal command:

sudo apt update

More info

More info

Optional.

Download package information (update) and install available upgrades (upgrade) with Debian terminal commands:

sudo apt update
sudo apt upgrade

Or with one Debian terminal command:

sudo apt update && apt upgrade

Other commands (e.g. upgrade) operate on package information (update).

Remove obsolete packages with Debian terminal command:

sudo apt autoremove


Description see Debian apt manpage.

See examples of package installations.

More info

More info

Possible message.

If package list information is not downloaded (step 1.1), message can be:
E: Unable to locate package

Debian terminal command:

exit

Debian terminal command:

git clone -b openwrt-19.07 --single-branch https://git.openwrt.org/openwrt/openwrt.git openwrt_19.07

More info

More info

This is to clone an specific OpenWrt branch/head (-b openwrt-19.07 –single-branch) in a new directory (openwrt_19.07).
Debian git clone manpage.
The OpenWrt source code repositories.

Difference snapshots, releases and branches.

Possible messages.

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_19.07' already exists and is not an empty directory.

Change working directory to the one with cloned repository (step 2.1) by Debian terminal command:

cd openwrt_19.07

Click to display ⇲

Click to hide ⇱

Debian cd manpage.

Possible message.

If repository is not cloned (step 2.1), message can be:
-bash: cd: openwrt_19.07: No such file or directory

Debian terminal command:

git checkout v19.07.8

Click to display ⇲

Click to hide ⇱

Debian git checkout manpage.

List branches (tags) with Debian terminal command:

git tag -l

Debian git tag manpage.

Show current branch (highlighted in green and marked with an asterisk) with Debian terminal command:

git branch

Debian git branch manpage.
or show working tree status with Debian terminal command:

git status

Debian git status manpage.

Debian terminal command:

./scripts/feeds update -a && ./scripts/feeds install -a

Click to display ⇲

Click to hide ⇱

Possible messages.

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

Debian terminal command:

make menuconfig

E.g. for hardware from table

Hardware Target System Subtarget Target Profile Target directory
Belkin F5D8235-4 v1 MediaTek Ralink MIPS RT288x based boards Belkin F5D8235 V1 ?
D-Link DIR-615 rev D3 MediaTek Ralink MIPS RT3x5x/RT5350 based boards D-Link DIR-615 D ?
TP-Link Archer MR200 v1.0 ? ? ? ?
TP-Link TL-WA730RE v1 Atheros AR7xxx/AR9xxx
Atheros ATH79 (DTS)
Devices with small flash TP-LINK TL-WA730RE v1 ar71xx/generic/
ath79\tiny

use corresponding values from menu:

  • “Target System” ⇒ “Select” ⇒ <target system> ⇒ “Select”
  • “Subtarget” ⇒ “Select” ⇒ <subtarget> ⇒ “Select”
  • “Target Profile” ⇒ “Select” ⇒ <target profile> ⇒ “Select”

To add “LuCI”:

  • “LuCI” ⇒ “Select” ⇒ “Collections” ⇒ “Select” ⇒ on “luci” press <Y> to include (= “*” built-in) ⇒ “Exit” ⇒ “Exit”

To remove “ppp”

  • “Network” ⇒ “Select” ⇒ on “ppp” press <N> to exclude (= “ ” excluded) ⇒ “Exit”

To remove “wpad-mini”

  • “Network” ⇒ “Select” ⇒ on “wpad-mini” press <N> to exclude (= “ ” excluded) ⇒ “Exit”

To add “wpad”

  • “Network” ⇒ “Select” ⇒ on “wpad” press <Y> to include (= “*” built-in) ⇒ “Exit”

To exit OpenWrt Configuration and save target with options settings do following:

  • “Exit” ⇒ “Yes”

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>

  • The *-factory.bin image file is for the first installation of OpenWrt on the target.
  • The *-sysupgrade.bin image file is for updating an existing OpenWrt installation.

To recompile the images, remove files from directory ./bin/targets/<target directory> and build image (step 4) again.

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:

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
  • Last modified: 2021/10/15 08:27
  • by bobafetthotmail