From 34dd96b5d9e567f87a7623d7ea4a24ef6af954d3 Mon Sep 17 00:00:00 2001 From: Paul Whalen Date: Dec 19 2019 21:56:09 +0000 Subject: Add check to update-uboot to ensure uboot files exist before writing (issue#45). --- diff --git a/update-uboot b/update-uboot index e56b014..088a097 100755 --- a/update-uboot +++ b/update-uboot @@ -114,13 +114,21 @@ if [[ $KOJI_TAG != '' ]]; then popd &> /dev/null fi fi -# determine uboot and write to disk -if [ "$TARGET" = "" ]; then - echo "= No U-boot will be written." - TARGET="Mystery Board" +# determine uboot and write to disk +if [ "$TARGET" != "" ]; then + PREFIX=/tmp/root + if [ "$TARGET" = "rpi2" ] || [ "$TARGET" = "rpi3" ] || [ "$TARGET" = "olpc_xo175" ]; then + . "${BOARDDIR}/${TARGET}" + elif [ -d "${PREFIX}/usr/share/uboot/${TARGET}" ]; then + . "${BOARDDIR}/${TARGET}" + else + echo "= No U-Boot files found for $TARGET." + fi else - . "${DIR}/${BOARDDIR}/${TARGET}" + echo "= No U-boot will be written." + TARGET="Mystery Board" fi + # reboot after writing if [ "REBOOT" = "1" ]; then echo "= Complete, rebooting.."