OpenWRT automated build system
Find a file
2025-10-25 02:35:45 +02:00
.forgejo/workflows Build on an issue closed 2025-10-25 02:35:45 +02:00
configs Build 24.10.4 2025-10-24 13:00:31 +02:00
.gitignore Fork and commit 2025-10-20 05:31:39 +02:00
LICENSE Update LICENSE 2025-10-25 02:14:13 +02:00
openwrtbuilder files again 2025-10-24 04:16:21 +02:00
README.md Update README.md 2025-10-25 02:20:32 +02:00

openwrtbuilder

This is a quite evily modify of openwrtbuilder a script to automate building OpenWRT firmware images for routers with the imagebuilder SDKs provided for each target.

I don't really care about handling a lot of targets so it's not really optimized the build proccess. From the original version everything was moved from the docker to a simple bash script because it meant to be run in a forgejo runner.

INSTALLATION

Apart from that, it's just a shell script which uses a few basic system commands that should readily be available on a common Linux system with GNU coreutils.


USAGE

The build target and profile are configured with commandline flags. Additional packages to be installed and an optional filesystem tree to be included can also be specified. The options are based on the capabilities of the OpenWRT imagebuilder.

You can use -R, -T and -t ... -P to list available releases, targets and profiles for a particular target respectively.

flag description
-R list available releases
-r RELEASE the release version, can be snapshot or a version like 18.06.4
-T list available targets for chosen release (latest by default)
-t TARGET target architecture and chipset, e.g. ath79/generic
-t TARGET -P list available profiles (specific devices) for a given TARGET
-p PROFILE profile for a particular device, e.g. in the above target: tplink_archer-c7-v2
-i PKGS include or exclude specific packages,
e.g. exclude ppp and include luci-ssl with -i "-ppp luci-ssl"
-d DESTDIR destination directory for the built firmware archive
a concatenation of release version, target, profile and timestamp by default
-f DIRECTORY directory with a filesystem tree to include in firmware
can be used for configuration files like /etc/profile
-c CONFIG source config options from this bash-compatible file
by default, owrtbuildconf in the current directory is used automatically, if found

When building a specific firmware image, the configuration is printed on the terminal and can be copied to a file for later usage with the -c flag. See the configs directory for examples.

EXAMPLES

List available profiles for the ath79/generic target in the latest release:

$ openwrtbuilder -r latest -t ath79/generic -P
available profiles for 22.03.3/ath79/generic:
 - 8dev_carambola2
 - 8dev_lima
/* ... */
 - tplink_archer-c7-v1
 - tplink_archer-c7-v2
/* ... */
 - ziking_cpe46b
 - zyxel_nbg6616

Build a firmware image for the TP-Link Archer C7 v2:

$ openwrtbuilder -r latest -t ath79/generic -p tplink_archer-c7-v2

# openwrtbuilder configuration
MIRROR='https://downloads.openwrt.org'
RELEASE='22.03.3'
TARGET='ath79/generic'
PROFILE='tplink_archer-c7-v2'
PACKAGES=
FILES=''

# build openwrtbuilder image ...

This will result in a directory with factory and sysupgrade images, depending on the specific profile:

$ ls openwrt-ath79-generic-tplink_archer-c7-v2-22.03.3/
openwrt-22.03.3-ath79-generic-tplink_archer-c7-v2.manifest
openwrt-22.03.3-ath79-generic-tplink_archer-c7-v2-squashfs-factory.bin
openwrt-22.03.3-ath79-generic-tplink_archer-c7-v2-squashfs-factory-eu.bin
openwrt-22.03.3-ath79-generic-tplink_archer-c7-v2-squashfs-factory-us.bin
openwrt-22.03.3-ath79-generic-tplink_archer-c7-v2-squashfs-sysupgrade.bin
profiles.json
sha256sums