Skip to content

Commit

Permalink
Add dtedit command to edit currently booted DT
Browse files Browse the repository at this point in the history
  • Loading branch information
ayufan committed Jul 2, 2018
1 parent 9f65cc3 commit 0807f0c
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions package/root/usr/local/sbin/dtedit
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

if [[ $# -ne 0 ]] && [[ $# -ne 1 ]]; then
echo "usage: $0 [kernel-version]"
exit 1
fi

VERSION=${VERSION:-$(uname -r)}

set -xe
pushd /boot

if [[ ! -e "dts-${VERSION}.tmp" ]]; then
dtc "dtb-${VERSION}" > "dts-${VERSION}.tmp"
mv "dts-${VERSION}.tmp" "dts-${VERSION}"
fi

editor "dts-${VERSION}"

dtc "dts-${VERSION}" > "dtb-${VERSION}.new"
mv "dtb-${VERSION}.new" "dtb-${VERSION}"
echo Done.

0 comments on commit 0807f0c

Please sign in to comment.