To squash error messages at boot time
mv: can't rename '/mnt/sysupgrade.tgz': No such file or directory
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
. /lib/upgrade/platform.sh
if platform_export_bootdevice && platform_export_partdevice partdev 1; then
- mount -t ext4 -o rw,noatime "/dev/$partdev" /mnt
- mv -f /mnt/sysupgrade.tgz /
- umount /mnt
+ if mount -t ext4 -o rw,noatime "/dev/$partdev" /mnt; then
+ if [ -f /mnt/sysupgrade.tgz ]; then
+ mv -f /mnt/sysupgrade.tgz /
+ fi
+ umount /mnt
+ fi
fi
}