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
fi
for all_dtb in /flash/*.dtb /flash/DTB; do
dtb=$(basename $all_dtb)
if [ -f $SYSTEM_ROOT/usr/share/bootloader/$dtb ]; then
echo "*** updating Device Tree Blob: $dtb ..."
mount -o rw,remount $BOOT_ROOT
cp -p $SYSTEM_ROOT/usr/share/bootloader/$dtb $BOOT_ROOT
for all_dtb in /flash/*.dtb ; do
if [ -f $all_dtb ] ; then
dtb=$(basename $all_dtb)
if [ -f $SYSTEM_ROOT/usr/share/bootloader/$dtb ]; then
echo "*** updating Device Tree Blob: $dtb ..."
mount -o rw,remount $BOOT_ROOT
cp -p $SYSTEM_ROOT/usr/share/bootloader/$dtb $BOOT_ROOT
fi
fi
done
;;