How to recreate dts file from a running Android device ?

As we have seen in “How to cross compile static dtc for ARM” we are able to get the DTC cross compiled statically which we will push to the embedded target which exposes the device tree from proc file system.

Using this statically compiled dtc, we will reverse engineer to create human readable DTS file which will give us many more insights into the running embedded target.

This post describes how you can push the DTC to Android device, but you can push/copy this to any device and recreate the DTS.

Execute below command on PC to push the statically compiled DTC binary to Android device using adb,

$ adb push dtc /sdcard/

Now, execute below commands on Android Device to regenerate the DTS file,

$ su
$ cd /
$ mount -o,remount,rw /system
$ mv /sdcard/dtc /system/bin
$ chmod 777 /system/bin/dtc
$ dtc -I fs /proc/device-tree -O dts

The above command will read the /proc/device-tree and recreate the human readable DTS source.

Leave a Comment