Skip to content

Instantly share code, notes, and snippets.

@osamutake
Last active March 22, 2019 22:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save osamutake/cf9ec69d9cc5e8d552a57fe4646816ee to your computer and use it in GitHub Desktop.
Save osamutake/cf9ec69d9cc5e8d552a57fe4646816ee to your computer and use it in GitHub Desktop.
Device Tree Overlay script
#!/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