Skip to content

Commit 4470261

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 685afa8 commit 4470261

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

kdtc/README.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Install the prerequisites with "sudo apt install cmake device-tree-compiler" - y
99
- *cmake .*
1010
- *sudo make install*
1111

12-
Alternatively, you can just download the latest version using:
12+
Alternatively, to avoid fetching the entire `utils` repository and its history, you can just download it with:
1313
```
1414
$ wget https://raw.githubusercontent.com/raspberrypi/utils/refs/heads/master/kdtc/kdtc
1515
$ chmod +x kdtc
@@ -30,6 +30,23 @@ Usage: kdtc [<opts>] [<infile> [<outfile>]]
3030
3131
When run with no dtc options, kdtc detects the input format and attempts
3232
to do the right thing.
33+
```
3334

34-
If run within a git kernel source tree, the kerndir path is inferred.
35+
Assuming `kdtc` is in your PATH, compiling an overlay without `#include`s 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 `#include`s, use either:
40+
```
41+
$ kdtc -k /path/to/kernel doofer-overlay.dts doofer.dtbo
42+
```
43+
Or, running from a 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.)
48+
49+
To decompile an overlay to `stdout`:
50+
```
51+
$ kdtc mystery.dtbo
3552
```

0 commit comments

Comments
 (0)