Fresh pull from upstream
[librecmc/librecmc.git] / target / linux / x86 / base-files / lib / preinit / 79_move_config
index 5ac81cb90d1c15782a9c4f271720cfa66d6d03a9..143ca5147b5693a5b8068dc10eb71b5066777160 100644 (file)
@@ -4,12 +4,15 @@
 move_config() {
        local partdev
 
-       . /lib/upgrade/platform.sh
+       . /lib/upgrade/common.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 export_bootdevice && export_partdevice partdev 1; then
+               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
 }