Created
September 23, 2019 12:19
-
-
Save giuliomoro/1b8fb3bdba1adb48fa004b606fa94f1a to your computer and use it in GitHub Desktop.
update uboot (locally or remotely) on a single-partition SD card with BeagleBoard image.
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/bash -ex | |
MLO=MLO | |
IMG=u-boot.img | |
if [ ! "x${SSH_DEST}" = "x" ]; then | |
SSH_CMD="ssh -tt $SSH_DEST" | |
scp $MLO ${SSH_DEST}:MLO | |
scp $IMG ${SSH_DEST}:uboot.img | |
MLO=MLO | |
IMG=uboot.img | |
else | |
SSH_CMD="bash -c" | |
fi | |
if [ ! "x${DISK}" = "x" ] ; then | |
${SSH_CMD} "[ -e \"${DISK}\" ] &&\ | |
sudo dd if=${MLO} of=${DISK} count=2 seek=1 bs=128k &&\ | |
sudo dd if=${IMG} of=${DISK} count=4 seek=1 bs=384k &&\ | |
sync &&\ | |
sudo reboot ||\ | |
echo Error, maybe DISK=${DISK} does not exist?" | |
else | |
echo Error, on DISK= specified | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment