This script preprocesses Device Tree Source (DTS) files using the C preprocessor (cpp
) and compiles them into Device Tree Blob (DTB) or Device Tree Overlay (DTBO) files using dtc
. It provides a convenient way to preprocess and compile DTS files for embedded systems development, particularly targeting the ARM architecture.
The script accepts the following command-line arguments:
-i, --input Input DTS file
-o, --output Output format (dtb, dts, or dtbo)
-h, --help Display help menu
-
Preprocess a DTS file and generate a DTB file:
./makedtb -i input_filename.dts -o dtb
-
Preprocess a DTS file and generate a DTBO file:
./makedtb -i input_filename.dts -o dtbo
-
Preprocess a DTS file and keep it as DTS:
./makedtb -i input_filename.dts -o dts
Make sure to have these installed on your system before running the script. Google is your friend to know how to get them for your distribution.
arm-none-eabi-cpp
: C preprocessor for the ARM architecture.dtc
: Device Tree Compiler.
This project is licensed under the MIT License. See the LICENSE file for details.