Skip to content
Contents
GuidesOpenWrt

Why OpenWrt ImageBuilder rejects patch or getopt even when installed

On Chimera Linux, OpenWrt ImageBuilder 25.12.3 can ask for GNU patch while building for ath79/generic even when the shell finds patch. Check the tools inside the environment that runs make.

On Chimera Linux, OpenWrt ImageBuilder 25.12.3 can ask for GNU patch while building for ath79/generic even when the shell finds patch. Check the tools inside the environment that runs make.

Repeat the checks in the build shell

The bundled include/prereq-build.mk looks for Free Software Foundation in the version output of patch or gpatch. FreeBSD patch can therefore fail the check. The last command should print --test followed by --. If your system supplies gnugetopt, repeat the test with that name.

command -v patch
patch --version
command -v getopt
getopt -o t --long test -- --test

Change PATH for this shell only

Install GNU patch and a getopt implementation with long option support on the build host. Substitute the trusted directory containing those tools below, then repeat the checks. Interactive aliases may be invisible to make. Check inside the container if you build there.

export PATH="/opt/bin:$PATH"
command -v patch
patch --version
getopt -o t --long test -- --test

Ubuntu 24.04 · GNU patch · getopt

In this isolated Ubuntu 24.04 container, getopt passed but patch was initially missing from PATH. Adding the directory mounted read-only exposed GNU patch 2.7.6. This checks tool discovery only. We did not run a full Chimera build.

Verify the build

Keep your original arguments. In a fresh extraction, rerun make image with the same PROFILE and package list, omitting FORCE=1. In this release the failure branch can print an override hint and still return failure. Listing profiles with make info proves little here. Check that prerequisites pass, then check the exit status and the timestamp of the new image. If it fails, keep the first error. Close the temporary shell to restore the original search path. The router needs no changes.

Moving OpenWrt from x86 to ARM: check the ABI, packages and kernel modules

Explore hardware

Comments