Placing DTB file inside root filesystem


I'm creating a custom OpenWRT image, using the build system to create the image, the bootloader, kernel and filesystem.

I need to add the DTB file inside my root filesystem during the build process. I could not find the place on the Makefiles where I could do that.

Does anybody can give me a hint on where should I look at?

Best regards,


would this (randomly chosen commit) be a good enough example;a=commit;h=82c8c38a5c236971930167ee9f38a1732d0aeba7 ?

Hi @frollic ,

I don't think so. As far as I understood from the patch, the DTB file is saved on a nand partition.

My project uses emmc. Today there is a partition containing the kernel and dtb files. When running sysupgrade, only the kernel file is updated.

I implemented an update where the DTB file is also updated, when the DTB file is installed inside the sysupgrade file. I added the DTB file inside the sysupgrade too.

But I need the same DTB file to be placed inside the root filesystem, similar to what we do when we place a file inside the files/ directory.

My SoC is i.MX6.

To solve this problem I needed to change the build system image generator script, to add the DTB file inside the sysupgrade image.

And I had also to update the sysupgrade implementation, to detect the presence of this file and, if there, extract and place it on the correct location.