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”.


Subscribe with Valid Email Id to receive updates in Inbox. ( Secured by Google FeedBurner )

   


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
lynxbee_ezoic

Leave a Comment

Android Android Build system Android Commands Android Java Applications 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 & Build Development, Debugging and Performance Tools 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 Audio, Video, Images NDK / Middleware / HAL OS 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 / Bitbake / Openembedded