projects/Amlogic: fix update script when no *.dtb in /flash

If there is no file matching /flash/*.dtb wildcard, the loop will proceed
with all_dtb="/flash/*.dtb", causing erratic behaviour in next script
steps. Fix this by checking if  exists before proceeding.
This commit is contained in:
kszaq 2018-02-13 22:31:58 +01:00
parent 760c839f1f
commit 695d78e4aa

View File

@ -75,12 +75,14 @@ for arg in $(cat /proc/cmdline); do
esac esac
fi fi
for all_dtb in /flash/*.dtb /flash/DTB; do for all_dtb in /flash/*.dtb ; do
dtb=$(basename $all_dtb) if [ -f $all_dtb ] ; then
if [ -f $SYSTEM_ROOT/usr/share/bootloader/$dtb ]; then dtb=$(basename $all_dtb)
echo "*** updating Device Tree Blob: $dtb ..." if [ -f $SYSTEM_ROOT/usr/share/bootloader/$dtb ]; then
mount -o rw,remount $BOOT_ROOT echo "*** updating Device Tree Blob: $dtb ..."
cp -p $SYSTEM_ROOT/usr/share/bootloader/$dtb $BOOT_ROOT mount -o rw,remount $BOOT_ROOT
cp -p $SYSTEM_ROOT/usr/share/bootloader/$dtb $BOOT_ROOT
fi
fi fi
done done
;; ;;