Custom DTS / DTB building with ImageBuilder

Joseph Mullally jwmullally at
Tue Mar 9 21:44:19 GMT 2021

Great, it turns out to be very straightforward.

To build a DTS into DTB and assemble the firmware kernel image using
the Image Builder Makefile recipes, you just need to manually invoke
the built target for it. You'll also need to fetch any missing DTS
header dependencies it complains about. Then you can build the image
as normal.

    ln -sf /usr/bin/cpp staging_dir/host/bin/mips-openwrt-linux-musl-cpp
    PATH=$(pwd)/staging_dir/host/bin:$PATH make --trace -C
TOPDIR="$(pwd)" INCLUDE_DIR="$(pwd)/include" TARGET_BUILD=1
BOARD="ath79" SUBTARGET="generic" PROFILE="tplink_archer-c7-v5"
    make image PROFILE="tplink_archer-c7-v5"

Full example which patches in a new custom device profile and builds it:

On Sat, Feb 27, 2021 at 12:21 AM Joseph Mullally <jwmullally at> wrote:
> Hi,
> Device Tree is great as it decouples the hardware layout from the
> kernel build. What are peoples thoughts on supporting custom DTS
> building in ImageBuilder? There are a few advantages: Uses the
> official kernel, makes it easier to support out-of-tree unofficial
> firmwares etc. [1] says DTS files were rebuilt in Chaos Calmer Image
> Builder?
> As an example:
> As you can see from the Makefile, most of the tools are already
> included in ImageBuilder except for cpp and some DTS headers from the
> kernel (ignore the tplink-firmware.c patching as its unavoidable).
> There are some clunky parts there, like needing to manually assemble
> the "-kernel.bin" instead of using the OpenWRT Makefile definitions.
> Does anyone know how to do that? I got close using "make -C
> target/linux/ath79/image install" with "IB" undefined, but I wasn't
> able to narrow it down enough to build just one DTB + image for a
> single profile. That would probably solve most of the issue and make
> these out-of-tree builds much simpler.
> Other examples from the forums:
> [1]
> [2]
> [3]
> Thanks
> - Joe

More information about the openwrt-devel mailing list