new build script

This commit is contained in:
Owen 2024-08-09 16:30:41 +00:00
parent 1685c86407
commit 555f41b93d
2 changed files with 27 additions and 5 deletions

View File

@ -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

27
device-tree/make_dtb.sh Executable file
View File

@ -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