Skip to content

ImageBuilder

Refers to the OpenWrt wiki Using the Image Builder for detailed options

TIP

Find the target-subtarget of your device using the OpenWrt's Table of Hardware or the firmware-selector

Setup

Export to the environment the target-subtarget and the package architecture

export TARGET=ath79-generic
export ARCH=$(curl -s https://downloads.openwrt.org/snapshots/.targets.json | \
    sed 's/\//-/' | jq -r '."${TARGET}"')

Build on Debian

Refers to the OpenWrt wiki Using the Image Builder

sh
FILE_HOST="https://downloads.openwrt.org"
DOWNLOAD_PATH="releases/25.12.0/targets/ath79/generic"
DOWNLOAD_FILE="imagebuilder-.*x86_64.tar.[xz|zst]"

mkdir imagebuilder; cd imagebuilder
wget -nv "$FILE_HOST/$DOWNLOAD_PATH/sha256sums" -O sha256sums
file_name="$(grep "$DOWNLOAD_FILE" sha256sums | cut -d "*" -f 2)"
wget -nv "$FILE_HOST/$DOWNLOAD_PATH/$file_name"
tar xf "$file_name" --strip=1 --no-same-owner -C .
sh
FILE_HOST="https://downloads.openwrt.org"
DOWNLOAD_PATH="releases/24.10.5/targets/ath79/generic"
DOWNLOAD_FILE="imagebuilder-.*x86_64.tar.[xz|zst]"

mkdir imagebuilder; cd imagebuilder
wget -nv "$FILE_HOST/$DOWNLOAD_PATH/sha256sums" -O sha256sums
file_name="$(grep "$DOWNLOAD_FILE" sha256sums | cut -d "*" -f 2)"
wget -nv "$FILE_HOST/$DOWNLOAD_PATH/$file_name"
tar xf "$file_name" --strip=1 --no-same-owner -C .
sh
FILE_HOST="https://downloads.openwrt.org"
DOWNLOAD_PATH="snapshots/targets/ath79/generic"
DOWNLOAD_FILE="imagebuilder-.*x86_64.tar.[xz|zst]"

mkdir imagebuilder; cd imagebuilder
wget -nv "$FILE_HOST/$DOWNLOAD_PATH/sha256sums" -O sha256sums
file_name="$(grep "$DOWNLOAD_FILE" sha256sums | cut -d "*" -f 2)"
wget -nv "$FILE_HOST/$DOWNLOAD_PATH/$file_name"
tar xf "$file_name" --strip=1 --no-same-owner -C .

Build on Docker

Start an ImageBuilder of your choice, for example ath79-generic if your device is supported within it

sh
mkdir ./images/
docker run -it \
    -e TARGET=$TARGET \
    -e ARCH=$ARCH \
    -v $(pwd)/config/:/builder/files/etc/config/ \
    -v $(pwd)/images:/images/ \
    ghcr.io/openwrt/imagebuilder:$TARGET-v25.12.0
sh
mkdir ./images/
docker run -it \
    -e TARGET=$TARGET \
    -e ARCH=$ARCH \
    -v $(pwd)/config/:/builder/files/etc/config/ \
    -v $(pwd)/images:/images/ \
    ghcr.io/openwrt/imagebuilder:$TARGET-v24.10.5
sh
mkdir ./images/
docker run -it \
    -e TARGET=$TARGET \
    -e ARCH=$ARCH \
    -v $(pwd)/config/:/builder/files/etc/config/ \
    -v $(pwd)/images:/images/ \
    ghcr.io/openwrt/imagebuilder:$TARGET

Add LibreMesh feeds

Within the container add the lime-packages feeds.

sh
cat << EOF >> repositories
https://feed.libremesh.org/master/openwrt-25.12/x86_64/packages.adb
https://feed.libremesh.org/master/openwrt-25.12/$ARCH/packages.adb
https://feed.libremesh.org/profiles/openwrt-25.12/x86_64/packages.adb
EOF

cat << EOF > keys/libremesh.pem
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEdFJZ2qVti49Ol8LJZYuxgOCLowBS
8bI86a7zqhSbs5yon3JON7Yee7CQOgqwPOX5eMALGOu8iFGAqIRx5YjfYA==
-----END PUBLIC KEY-----
EOF
sh
cat << EOF >> repositories.conf
src/gz libremesh_packages https://feed.libremesh.org/master/openwrt-24.10/x86_64
src/gz libremesh_arch_packages https://feed.libremesh.org/master/openwrt-24.10/$ARCH
src/gz profiles https://feed.libremesh.org/profiles/openwrt-24.10/x86_64
EOF

cat << EOF > keys/a71b3c8285abd28b
untrusted comment: signed by libremesh.org key a71b3c8285abd28b
RWSnGzyChavSiyQ+vLk3x7F0NqcLa4kKyXCdriThMhO78ldHgxGljM/8
EOF
sh
cat << EOF >> repositories
https://feed.libremesh.org/master/openwrt-main/x86_64/packages.adb
https://feed.libremesh.org/master/openwrt-main/$ARCH/packages.adb
https://feed.libremesh.org/profiles/openwrt-main/x86_64/packages.adb
EOF

cat << EOF > keys/libremesh.pem
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEdFJZ2qVti49Ol8LJZYuxgOCLowBS
8bI86a7zqhSbs5yon3JON7Yee7CQOgqwPOX5eMALGOu8iFGAqIRx5YjfYA==
-----END PUBLIC KEY-----
EOF

Custom files

Ideally add your own lime-community files within the container in the folder ./files/etc/config/.
To find all possible options consult the [Configuration][/reference/configuration] page.

Now create an image of your choice, to see the names of supported profiles run make info first.

Build

sh
make image \
    PROFILE=ubnt_unifi \
    BIN_DIR=/images \
    FILES=files \
    PACKAGES="-dnsmasq -odhcpd-ipv6only \
        lime-system lime-proto-babeld lime-proto-batadv lime-proto-anygw \
        lime-hwd-openwrt-wan lime-hwd-ground-routing \
        babeld-auto-gw-mode check-date-http batctl-default \
        lime-app lime-debug lime-docs lime-docs-minimal \
        shared-state-babeld_hosts shared-state-bat_hosts \
        shared-state-dnsmasq_hosts shared-state-nodes_and_links"

Build using Network Profiles

Refers to Network Profiles

sh
make image \
    PROFILE=ubnt_unifi \
    BIN_DIR=/images \
    FILES=files \
    PACKAGES="-dnsmasq -odhcpd-ipv6only profile-libremesh-suggested-packages"