# DTS support in imagebuilder

**URL:** <https://forum.openwrt.org/t/dts-support-in-imagebuilder/12320>\
**Category:** For Developers\
**Created:** [March 6, 2018, 12:27pm UTC](https://forum.openwrt.org/t/dts-support-in-imagebuilder/12320 "2018-03-06T12:27:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bugblue](https://forum.openwrt.org/letter_avatar/bugblue/32/5_5575768a8748004e209b776fc1b2916d.png) [@bugblue](https://forum.openwrt.org/u/bugblue)\
**Post date:** [March 6, 2018, 12:27pm UTC](https://forum.openwrt.org/t/dts-support-in-imagebuilder/12320/1 "2018-03-06T12:27:37Z")

</div>

When using imagebuilder, the make scripts don't rebuild the kernel images in buildir/target-/linux--.

This means that updating DTS files has to be done by rebuilding the whole of openwrt/kernel. Is there an easier fix?

Kind regards

---

<div class="post-metadata">

**Author:** ![robimarko](https://forum.openwrt.org/user_avatar/forum.openwrt.org/robimarko/32/617_2.png) [@robimarko](https://forum.openwrt.org/u/robimarko)\
**Post date:** [March 6, 2018, 12:46pm UTC](https://forum.openwrt.org/t/dts-support-in-imagebuilder/12320/2 "2018-03-06T12:46:50Z")

</div>

No,you gotta rebuild the kernel for that.  
And for that you gotta build from source

---

<div class="post-metadata">

**Author:** ![bugblue](https://forum.openwrt.org/letter_avatar/bugblue/32/5_5575768a8748004e209b776fc1b2916d.png) [@bugblue](https://forum.openwrt.org/u/bugblue)\
**Post date:** [March 6, 2018, 12:52pm UTC](https://forum.openwrt.org/t/dts-support-in-imagebuilder/12320/3 "2018-03-06T12:52:56Z")

</div>

In previous versions (Chaos Calmer) it did rebuild the dtb in image builder, and all the tools to rebuild the dtb seems to be still included in imagebuilder. Is there a specific reason that this behaviour changed?

---

<div class="post-metadata">

**Author:** ![bugblue](https://forum.openwrt.org/letter_avatar/bugblue/32/5_5575768a8748004e209b776fc1b2916d.png) [@bugblue](https://forum.openwrt.org/u/bugblue)\
**Post date:** [March 6, 2018, 2:02pm UTC](https://forum.openwrt.org/t/dts-support-in-imagebuilder/12320/4 "2018-03-06T14:02:11Z")

</div>

I really like YOLO solutions. As the most of the image builder process is doing everything I want the only thing I needed was to update the DTB.

```
make image PROFILE=rt5350f-olinuxino FILES=files/ PACKAGES="kmod-usb-storage block-mount kmod-fs-ext4"

ORIGVMLINUX=build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_rt305x/vmlinux
DTBFILE=build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_rt305x/OLINUXINO-RT5350F.dtb
TMPFWFILE=build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_rt305x/tmp/lede-17.01.4-ramips-rt305x-rt5350f-olinuxino-squashfs-sysupgrade.bin
UIMAGE=build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_rt305x/uImage.lzma

cp ${ORIGVMLINUX} ${ORIGVMLINUX}-olinuxino-rt5350f
/root/dtc -O dtb -o ./${DTBFILE} ./target/linux/ramips/dts/RT5350F-OLINUXINO.hack
./staging_dir/host/bin/patch-dtb ${ORIGVMLINUX}-olinuxino-rt5350f ${DTBFILE}
./staging_dir/host/bin/lzma e ${ORIGVMLINUX}-olinuxino-rt5350f -lc1 -lp2 -pb2 ${ORIGVMLINUX}-olinuxino-rt5350f.lzma

./staging_dir/host/bin/mkimage -A mips -O linux -T kernel -C lzma -a 0x80000000 -e 0x80000000 -n "MIPS OpenWrt Linux-4.4.92" -d ${ORIGVMLINUX}-olinuxino-rt5350f.lzma ${UIMAGE}

dd if=${UIMAGE} > ${TMPFWFILE}

dd if=build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_rt305x/root.squashfs >> ${TMPFWFILE}
./staging_dir/host/bin/padjffs2 ${TMPFWFILE} 4 8 16 64 128 256
echo '{ "supported_devices":["rt5350f-olinuxino"], "version": { "dist": "LEDE", "version": "17.01.4", "revision": "r3560-79f57e422d", "board": "ramips" } }' | ./staging_dir/host/bin/fwtool -I - ${TMPFWFILE}
cp ${TMPFWFILE} bin/targets/ramips/rt305x/lede-17.01.4-ramips-rt305x-rt5350f-olinuxino-squashfs-sysupgrade.bin

```

When you need a DTB files, just use fdtdump and edit as you like.  
The advantage is that I don't have to modify my kernel and I do not have to recompile everything for every time. Exactly as DTB files are intended.

---

<div class="post-metadata">

**Author:** ![youxiaojie](https://forum.openwrt.org/user_avatar/forum.openwrt.org/youxiaojie/32/12185_2.png) [@youxiaojie](https://forum.openwrt.org/u/youxiaojie)\
**Post date:** [October 18, 2021, 4:30pm UTC](https://forum.openwrt.org/t/dts-support-in-imagebuilder/12320/6 "2021-10-18T16:30:07Z")

</div>

well done.........................

---

<div class="post-metadata">

**Author:** ![tmomas](https://forum.openwrt.org/letter_avatar/tmomas/32/5_5575768a8748004e209b776fc1b2916d.png) [@tmomas](https://forum.openwrt.org/u/tmomas)\
**Post date:** [October 28, 2021, 4:31pm UTC](https://forum.openwrt.org/t/dts-support-in-imagebuilder/12320/7 "2021-10-28T16:31:02Z")

</div>

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
