treewide: when copying a backup file always specify dest name
authorRafał Miłecki <rafal@milecki.pl>
Wed, 4 Sep 2019 14:57:40 +0000 (16:57 +0200)
committerRISCi_ATOM <bob@bobcall.me>
Fri, 13 Sep 2019 20:29:53 +0000 (16:29 -0400)
$CONF_TAR shouldn't be assumed to always point to the sysupgrade.tgz.
This change makes code more generic and allows refactoring $CONF_TAR.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 62dbe361a1b1ed1506bc0387bff55eddcb619e49)

target/linux/sunxi/base-files/lib/upgrade/platform.sh
target/linux/x86/base-files/lib/upgrade/platform.sh

index c8b0175fd58c56fadac29db3462e0e04df37274c..a5108c4c02269dd38fc7f416f3766bc91c4025fc 100644 (file)
@@ -30,7 +30,7 @@ platform_copy_config() {
 
        if export_partdevice partdev 1; then
                mount -t vfat -o rw,noatime "/dev/$partdev" /mnt
-               cp -af "$CONF_TAR" /mnt/
+               cp -af "$CONF_TAR" "/mnt/$BACKUP_FILE"
                umount /mnt
        fi
 }
index 162dbaf3aaaa00539851856b67e8e6b1a5eb8b08..855752b5d704401fd5a73534e89ada0c79495aa8 100644 (file)
@@ -39,7 +39,7 @@ platform_copy_config() {
 
        if export_partdevice partdev 1; then
                mount -t ext4 -o rw,noatime "/dev/$partdev" /mnt
-               cp -af "$CONF_TAR" /mnt/
+               cp -af "$CONF_TAR" "/mnt/$BACKUP_FILE"
                umount /mnt
        fi
 }