x86: move sysupgrade.tgz only if it exists

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>
This commit is contained in:
Yousong Zhou 2017-01-01 01:06:29 +08:00 committed by Felix Fietkau
parent 5f9e367127
commit fa37bdc05a

View file

@ -7,10 +7,13 @@ move_config() {
. /lib/upgrade/platform.sh
if platform_export_bootdevice && platform_export_partdevice partdev 1; then
mount -t ext4 -o rw,noatime "/dev/$partdev" /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
}
boot_hook_add preinit_mount_root move_config