-
-
Save osamutake/cf9ec69d9cc5e8d552a57fe4646816ee to your computer and use it in GitHub Desktop.
Device Tree Overlay script
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 | |
OVERLAY=/sys/kernel/config/device-tree/overlays | |
if [ -z $1 ]; then | |
echo USAGE: sudo dto folder-name [file-name.dts] | |
exit 1 | |
fi | |
if [ -e $OVERLAY/$1 ]; then | |
rmdir $OVERLAY/$1 | |
if [ "$?" != "0" ]; then | |
echo "Unable to remove previous overlay folder." | |
exit 1 | |
fi | |
fi | |
if [ -z $2 ]; then | |
exit 0 | |
fi | |
mkdir -p $OVERLAY/$1 | |
if [ "$?" != "0" ]; then | |
echo "Unable to create overlay folder." | |
exit 1 | |
fi | |
dtc -O dtb $2 > $OVERLAY/$1/dtbo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment