How to recreate dts file from live Embedded device ?

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.

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
GoPro 3D System Review 2 - Crazy La... x
GoPro 3D System Review 2 - Crazy Lane Splitting/Filtering UK

Leave a Comment

Sign up to our newsletter!

ADB Commands Android Android Applications Android Build system Application Libraries Application Stack / User Interface Bash / Shell Scripts Bluetooth driver Cloud Technologies Commands and Packages Compilation Content Management System Core Kernel C Programs Development, Debugging and Performance Tools Development and Build Development Environment Setup Django & REST Api Errors & Failures Git Hardware Platforms HTML JAVA Programs Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL Multimedia NDK / Middleware / HAL Operating System Concepts PHP Programming Languages Scripting and Automation Search Engine Optimisation ( SEO ) Social Media Source Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized Web Design and Development Website Hosting Wordpress Yocto Embedded Linux