Skip to content

Commit 89f585a

Browse files
committed
kdtc: Expand the README
Add some more usage examples to the README, mainly copied from a Forums post. See: https://forums.raspberrypi.com/viewtopic.php?t=377084 Signed-off-by: Phil Elwell <[email protected]>
1 parent 4223460 commit 89f585a

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

kdtc/README.md

+24-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ Install the prerequisites with "sudo apt install cmake device-tree-compiler" - y
99
- *cmake .*
1010
- *sudo make install*
1111

12+
Alternatively, to avoid fetching the entire `utils` repository and its history, you can just download it with:
13+
```
14+
$ wget https://raw.githubusercontent.com/raspberrypi/utils/refs/heads/master/kdtc/kdtc
15+
$ chmod +x kdtc
16+
```
17+
1218
**Usage**
1319
```
1420
Usage: kdtc [<opts>] [<infile> [<outfile>]]
@@ -24,6 +30,23 @@ Usage: kdtc [<opts>] [<infile> [<outfile>]]
2430
2531
When run with no dtc options, kdtc detects the input format and attempts
2632
to do the right thing.
33+
```
34+
35+
Assuming `kdtc` is in your PATH, compiling an overlay without `#includes` is simple:
36+
```
37+
$ kdtc widget-overlay.dts widget.dtbo
38+
```
39+
For an overlay written as if it were in the kernel tree with `#includes`, use either:
40+
```
41+
$ kdtc -k /path/to/kernel doofer-overlay.dts doofer.dtbo
42+
```
43+
Or, running from directory within the kernel tree:
44+
```
45+
$ kdtc /path/to/whatsit-overlay.dts /path/to/whatsit.dtbo
46+
```
47+
(When run within a git kernel source tree, the `--kerndir` path is inferred.)
2748

28-
If run within a git kernel source tree, the kerndir path is inferred.
49+
To decompile an overlay to `stdout`:
50+
```
51+
$ kdtc mystery.dtbo
2952
```

0 commit comments

Comments
 (0)