Tuesday, March 22, 2016

[TOOL][Linux] Split kernel with appended dtb into standalone kernel and dtbs

What's the tool for:
Almost all Qualcomm device is using linux device tree, and there're 2 ways to handle to kernel:
  1. Use a "dt.img" to pack dtbs and attached it to boot.img. When booting, lk will unpack it and handle dtbs to kernel.(Most devices in this way)
  2. Directly append dtbs on kernel image. When booting, lk will split them off and handle to kernel.(Nexus devices in this way since Nexus 5. Qualcomm switched to this way in every M branch, so generally you won't see a dt.img after unpacking a boot.img from official M release)
This tool is implemented to split a kernel image with appended dtbs into separated kernel and dtb files.

How it works:
Every dtb is started with 0xd00dfeed(defined in scripts/dtc/libfdt/fdt.h in kernel source), and a kernel image with appended dtbs is generated with command similar to the following one:
Code:

echo Image a.dtb b.dtb > Image-dtb
My program will search 0xd00dfeed in the provided kernel image, and dump "Image", "a.dtb", "b.dtb" in "Image-dtb" into sepreated files. After that, you're free to use dtc to decompile the .dtb into .dts

Download & Source:
http://ift.tt/1o4vjJM

XDA:DevDB Information
split-appended-dtb, Tool/Utility for all devices (see above for details)

Contributors
dianlujitao
Source Code: http://ift.tt/1o4vjJM


Version Information
Status: Stable

Created 2016-03-22
Last Updated 2016-03-22


via xda-developers http://ift.tt/1o4vjJQ

IFTTT

Put the internet to work for you.

Turn off or edit this Recipe

No comments:

Post a Comment