diff --git a/device-tree/dtspp/preprocess.sh b/device-tree/dtspp/preprocess.sh deleted file mode 100755 index efa00ec..0000000 --- a/device-tree/dtspp/preprocess.sh +++ /dev/null @@ -1,5 +0,0 @@ -rm -f dtbs/* -for file in `ls ../{*.dts,*.dtsi}`; do - echo "Processing $file to ${file##*/}" - cpp -I/usr/src/linux-headers-6.8.0-31-generic/include/ -nostdinc -undef -x assembler-with-cpp $file > ${file##*/} -done diff --git a/device-tree/make_dtb.sh b/device-tree/make_dtb.sh new file mode 100755 index 0000000..7449b58 --- /dev/null +++ b/device-tree/make_dtb.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# Takes a list of dts files for the specified architecture and emits appropriate compiled dtb files for use in customised deviceTree setups. +# + +dtc=/usr/bin/dtc +revision=`/usr/bin/uname -r` + +echo "Compiling against headers for $revision" + +if [ -d "$revision" ]; then + echo "Using existing build directory" +else + echo "Creating new build directory" + mkdir "$revision" +fi + +for file in `ls {*.dts,*.dtsi}`; do + echo "Processing $file to ${file##*/}" + cpp -I/usr/src/linux-headers-$revision/include/ -nostdinc -undef -x assembler-with-cpp $file > $revision/${file##*/} +done + +cd $revision +for file in `ls *.dts`; do + out=${file/.dts/.dtb} + echo "Compiling: $revision/$file > $revision/$out" + $dtc $file > $out +done