Created
November 6, 2019 17:51
-
-
Save evadot/962fcd8f3df0627aefb45b4243699ffd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
REPO=https://git.kernel.org/pub/scm/linux/kernel/git/devicetree/devicetree-rebasing.git/ | |
usage() { | |
cat <<EOF | |
Usage: `basename $0` dts arch outputdir | |
EOF | |
exit 1 | |
} | |
if [ $# -ne 3 ]; then | |
usage | |
fi | |
tmp=$(mktemp -d -t dts) | |
cd ${tmp} | |
echo $tmp | |
git clone --depth=1 https://git.kernel.org/pub/scm/linux/kernel/git/devicetree/devicetree-rebasing.git/ | |
if [ ! -d devicetree-rebasing/src/$2 ]; then | |
echo "No such arch $2" | |
rm -rf ${tmp} | |
exit 1 | |
fi | |
if [ ! -f devicetree-rebasing/src/$2/$1 ]; then | |
echo "No such dts $1" | |
rm -rf ${tmp} | |
exit 1 | |
fi | |
dtb=$3/$(basename "$1" .dts).dtb | |
subdir=$(dirname "$1") | |
cpp -P -x assembler-with-cpp -I "devicetree-rebasing/include" -I "devicetree-rebasing/src/$2/${subdir}/" \ | |
-include "devicetree-rebasing/src/$2/$1" /dev/null | dtc -@ -O dtb -o "$dtb" -b 0 -p 1024 -i "devicetree-rebasing/src/$2/${subdir}/" | |
rm -rf ${tmp} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment