treewide: when copying a backup file always specify dest name

$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>
This commit is contained in:
Rafał Miłecki
2019-09-04 16:57:40 +02:00
parent bf39047872
commit 62dbe361a1
13 changed files with 13 additions and 13 deletions

View File

@@ -93,6 +93,6 @@ platform_do_upgrade_linksys() {
}
platform_copy_config_linksys() {
cp -f "$CONF_TAR" /tmp/syscfg/
cp -f "$CONF_TAR" "/tmp/syscfg/$BACKUP_FILE"
sync
}

View File

@@ -106,7 +106,7 @@ platform_copy_config_sdcard() {
if export_partdevice partdev 1; then
mkdir -p /boot
[ -f /boot/kernel.img ] || mount -o rw,noatime /dev/$partdev /boot
cp -af "$CONF_TAR" /boot/
cp -af "$CONF_TAR" "/boot/$BACKUP_FILE"
sync
umount /boot
fi

View File

@@ -150,7 +150,7 @@ platform_do_upgrade_uDPU() {
platform_copy_config_uDPU() {
# Config is saved on the /misc partition and copied on the rootfs after the reboot
if [ -f "$CONF_TAR" ]; then
cp -f "$CONF_TAR" /misc
cp -f "$CONF_TAR" "/misc/$BACKUP_FILE"
sync
fi
}