From f1dc24123f08ba069b89fdb2b2a0011baf9bfeb2 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Sat, 23 Nov 2024 12:40:39 +0000 Subject: [PATCH] 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 --- kdtc/README.md | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/kdtc/README.md b/kdtc/README.md index f5b16b5..fa2acf8 100644 --- a/kdtc/README.md +++ b/kdtc/README.md @@ -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 [] [ []] @@ -24,6 +30,23 @@ Usage: kdtc [] [ []] 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 a 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 ```