Skip to content

Commit

Permalink
kdtc: Expand the README
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
pelwell committed Nov 23, 2024
1 parent 4223460 commit 924bf6a
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion kdtc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ Install the prerequisites with "sudo apt install cmake device-tree-compiler" - y
- *cmake .*
- *sudo make install*

Alternatively, to avoid fetching the entire `utils` repository and its history, you can just download it with:
```
$ wget https://raw.githubusercontent.com/raspberrypi/utils/refs/heads/master/kdtc/kdtc
$ chmod +x kdtc
```

**Usage**
```
Usage: kdtc [<opts>] [<infile> [<outfile>]]
Expand All @@ -24,6 +30,23 @@ Usage: kdtc [<opts>] [<infile> [<outfile>]]
When run with no dtc options, kdtc detects the input format and attempts
to do the right thing.
```

Assuming `kdtc` is in your PATH, compiling an overlay without `#include`s is simple:
```
$ kdtc widget-overlay.dts widget.dtbo
```
For an overlay written as if it were in the kernel tree with `#include`s, use either:
```
$ kdtc -k /path/to/kernel doofer-overlay.dts doofer.dtbo
```
Or, running from directory within the kernel tree:
```
$ kdtc /path/to/whatsit-overlay.dts /path/to/whatsit.dtbo
```
(When run within a git kernel source tree, the `--kerndir` path is inferred.)

If run within a git kernel source tree, the kerndir path is inferred.
To decompile an overlay to `stdout`:
```
$ kdtc mystery.dtbo
```

0 comments on commit 924bf6a

Please sign in to comment.