Sometimes it happens that you don’t have source code of the device on which you are working but want to know some kernel configurations or peripheral mappings etc in those case’s Linux kernel provides good insight through /proc filesystem. In this post also, we will try to showcase how you can regenerate dts file from already booted Linux / Android device so that you can understand how the peripheral devices are mapped for this embedded target . Note: This needs a rooted device or a device which at-least has sufficient access to proc filesystem.
Implementation details
For this, we will also need “dtc” binary for Ubuntu, you can check “ How to Compile and Install device-tree-compiler On Ubuntu” for getting the dtc binary . For both android and any other embedded device, you will first need to push dtc binary to device filesystem. In android you can use adb push command , or in other embedded targets you may use copy over network using “scp”. For Android, Type Below commands on Android’s adb shell $ su $ cd / $ mount -o,remount,rw /system $ mv /sdcard/dtc /system/bin $ chmod 777 /system/bin/dtc $ dtc -I fs /proc/device-tree -O generated_dts_file.dts Now, you can pull this dts on your Ubuntu desktop using “adb pull” command. For Embedded Linux Target devices $ su $ chmod 777 /bin/dtc $ dtc -I fs /proc/device-tree -O generated_dts_file.dts
Gotchas and common issues
Permission checks - verify user access rights and sudo privileges before executing system-level operations.
Environment configuration - double-check path variables and dependency versions to prevent runtime failures.
Backup safeguards - maintain configuration backups before applying system or database modifications.
Following these steps ensures clean configuration and reliable execution for recreate dts file from live embedded device.
Comments and corrections