• Stars
    star
    270
  • Rank 152,189 (Top 3 %)
  • Language
    Python
  • License
    GNU General Publi...
  • Created over 7 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Extract device tree blobs (dtb) from kernel images

extract-dtb

Tool to split a kernel image with appended dtbs into separated kernel and dtb files.

A Device Tree is a data structure for describing hardware. They are used in a lot of ARM devices (e.g. Android), otherwise these would not be able to boot.

This tool is similar to split-appended-dtb but it is written in Python and its code is simpler and almost 3x shorter. Moreover, it doesn't require any external Python library.

If you want to learn more about DTB you can have a look at the Device Tree Reference.

Install & Usage

extract-dtb is available on PyPI!

$ pip install extract-dtb

The extract-dtb command is now available:

$ extract-dtb --help
usage: extract-dtb [-h] [-o OUTPUT_DIR] [-n] [-V] filename

Extract dtbs from kernel images.

positional arguments:
  filename       Android kernel image

optional arguments:
  -h, --help     show this help message and exit
  -o OUTPUT_DIR  Output directory
  -n             Do not extract, just output information
  -V, --version  show program's version number and exit

Example:

$ extract-dtb -n /tmp/postmarketOS-export/vmlinuz-motorola-titan
Found 9 appended dtbs

$ extract-dtb /tmp/postmarketOS-export/vmlinuz-motorola-titan -o /tmp/dtb
Dumped kernel, start=0 end=7534024
Dumped dtbdump_01_Motorola_QC-MSM8226_Titan.dtb, start=7534024 end=7728853
Dumped dtbdump_02_Motorola_QC-MSM8226_Titan.dtb, start=7728853 end=7923682
Dumped dtbdump_03_Motorola_QC-MSM8226_Titan.dtb, start=7923682 end=8118511
Dumped dtbdump_04_Motorola_QC-MSM8226_Titan.dtb, start=8118511 end=8313340
Dumped dtbdump_05_Motorola_QC-MSM8226_Titan.dtb, start=8313340 end=8508169
Dumped dtbdump_06_Motorola_QC-MSM8226_Thea.dtb, start=8508169 end=8700762
Dumped dtbdump_07_Motorola_QC-MSM8226_Thea.dtb, start=8700762 end=8894086
Dumped dtbdump_08_Motorola_QC-MSM8226_Thea.dtb, start=8894086 end=9087470
Dumped dtbdump_09_Motorola_QC-MSM8226_Thea.dtb, start=9087470 end=9280854
Extracted 9 appended dtbs + kernel to /tmp/dtb

$ ls -l /tmp/dtb/
total 9088
-rw-rw-r-- 1 pablo pablo  194829 Aug 21 01:48 dtbdump_01_Motorola_QC-MSM8226_Titan.dtb
-rw-rw-r-- 1 pablo pablo  194829 Aug 21 01:48 dtbdump_02_Motorola_QC-MSM8226_Titan.dtb
-rw-rw-r-- 1 pablo pablo  194829 Aug 21 01:48 dtbdump_03_Motorola_QC-MSM8226_Titan.dtb
-rw-rw-r-- 1 pablo pablo  194829 Aug 21 01:48 dtbdump_04_Motorola_QC-MSM8226_Titan.dtb
-rw-rw-r-- 1 pablo pablo  194829 Aug 21 01:48 dtbdump_05_Motorola_QC-MSM8226_Titan.dtb
-rw-rw-r-- 1 pablo pablo  192593 Aug 21 01:48 dtbdump_06_Motorola_QC-MSM8226_Thea.dtb
-rw-rw-r-- 1 pablo pablo  193324 Aug 21 01:48 dtbdump_07_Motorola_QC-MSM8226_Thea.dtb
-rw-rw-r-- 1 pablo pablo  193384 Aug 21 01:48 dtbdump_08_Motorola_QC-MSM8226_Thea.dtb
-rw-rw-r-- 1 pablo pablo  193384 Aug 21 01:48 dtbdump_09_Motorola_QC-MSM8226_Thea.dtb
-rw-rw-r-- 1 pablo pablo 7534024 Aug 21 01:48 kernel

This tool can also be run directly on boot.img images.

Star History

Star History Chart

More Repositories

1

libreborme

Plataforma web para la consulta y el análisis del Boletín Oficial del Registro Mercantil
Python
125
star
2

awesome-ws2812

A curated list of awesome resources for ws2812 LED strips and matrices
121
star
3

pablog-scripts

Misc personal scripts
Python
54
star
4

bormeparser

A Python library for parsing BORME files (Boletín Oficial del Registro Mercantil in Spain).
Python
42
star
5

libcnml

libcnml is a CNML parser library for Python
Python
4
star
6

libchamplain

http://live.gnome.org/libchamplain
C
3
star
7

screenlets

screenlets git mirror (from https://code.launchpad.net/screenlets)
Python
3
star
8

ep_maadix

User-Management System for etherpad-lite
JavaScript
2
star
9

nolotiro-android

Android app for nolotiro.org
Java
2
star
10

telepathy-python

personal branch
Python
2
star
11

rsak

Router Swiss Army Knife
Python
2
star
12

CVMakers-modelos

Modelos STL - Coronavirus makers (NO OFICIAL)
G-code
2
star
13

guifinetstudio

Desktop application built using GTK+ and Python that lets you manage your wireless community networks
Python
1
star
14

portland

Git import of the original CVS repository at http://webcvs.freedesktop.org/portland/portland/
Shell
1
star
15

poivy-webpy

Send SMS using poivy.com service. Web application made in python-webpy
Python
1
star
16

sound-2.6-hptx2000

Modifications to add full support for the HP Tx2000 audio driver
C
1
star
17

libbitcoin-packages

Libbitcoin Debian packages build scripts
Shell
1
star
18

gnome-rss-applet

GNOME applet. RSS reader for the notification area. Based on yarssr which is written in perl and is no longer maintaned.
1
star