octeon: only copy sysupgrade file if present
authorJohn Crispin <john@phrozen.org>
Wed, 15 Feb 2017 05:36:21 +0000 (06:36 +0100)
committerJohn Crispin <john@phrozen.org>
Wed, 15 Feb 2017 08:37:15 +0000 (09:37 +0100)
this caused

'mv: can't rename '/mnt/sysupgrade.tgz': No such file or directory'

when running sysupgrade -n

Signed-off-by: John Crispin <john@phrozen.org>
target/linux/octeon/base-files/lib/preinit/79_move_config

index 669999e2e37698ff0823f2e4e6f96e795ebf8720..4ab321b690d667a36897147e78f0aca81e07d6ea 100644 (file)
@@ -5,7 +5,7 @@ move_config() {
        case "$(cat /tmp/sysinfo/board_name)" in
                erlite)
                        mount -t vfat /dev/sda1 /mnt
-                       mv -f /mnt/sysupgrade.tgz /
+                       [ -f /mnt/sysupgrade.tgz ] && mv -f /mnt/sysupgrade.tgz /
                        umount /mnt
                        ;;
        esac