Skip to content

Instantly share code, notes, and snippets.

@aaronautt
Last active April 27, 2020 14:19
Show Gist options
  • Save aaronautt/cacae28729c46b0716b233c0e7dd2535 to your computer and use it in GitHub Desktop.
Save aaronautt/cacae28729c46b0716b233c0e7dd2535 to your computer and use it in GitHub Desktop.
script to compile dts files to dtbs outside of Linux Kernel
#!/bin/bash
PROGNAME="mkdts"
usage()
{
echo $PROGNAME "<file.dts> <output.dtb>"
echo "<file.dts> is the name of the dts to be compiled"
echo "<output.dtb> name of the output dtb"
}
if [ -z $1 || -z $2]
then
echo "please input args"
usage
else
cpp -nostdinc -I include -I arch -undef -x assembler-with-cpp $1 > temp.dts
dtc -O dtb -b 0 -o $2 temp.dts
rm temp.dts
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment