$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)
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
}
if export_partdevice partdev 1; then
mkdir -p /boot
[ -f /boot/kernel.img ] || mount -t vfat -o rw,noatime "/dev/$partdev" /boot
- cp -af "$CONF_TAR" /boot/
+ cp -af "$CONF_TAR" "/boot/$BACKUP_FILE"
tar -C / -zxvf "$CONF_TAR" boot/config.txt
sync
unmount /boot
apalis_copy_config() {
apalis_mount_boot
- cp -af "$CONF_TAR" /boot/
+ cp -af "$CONF_TAR" "/boot/$BACKUP_FILE"
sync
umount /boot
}
mkdir /tmp/new_root
mount -t ext4 $loopdev /tmp/new_root && {
echo "Saving config to rootfs_data at position ${offset}."
- cp -v "$CONF_TAR" /tmp/new_root/
+ cp -v "$CONF_TAR" "/tmp/new_root/$BACKUP_FILE"
umount /tmp/new_root
}
platform_copy_config_emmc() {
mkdir -p /recovery
mount -o rw,noatime /dev/mmcblk0p1 /recovery
- cp -af "$CONF_TAR" /recovery/
+ cp -af "$CONF_TAR" "/recovery/$BACKUP_FILE"
sync
umount /recovery
}
}
platform_copy_config_linksys() {
- cp -f "$CONF_TAR" /tmp/syscfg/
+ cp -f "$CONF_TAR" "/tmp/syscfg/$BACKUP_FILE"
sync
}
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
case "$(board_name)" in
erlite)
mount -t vfat /dev/sda1 /mnt
- cp -af "$CONF_TAR" /mnt/
+ cp -af "$CONF_TAR" "/mnt/$BACKUP_FILE"
umount /mnt
;;
esac
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
}
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
}
if export_partdevice partdev 1; then
mount -o rw,noatime "/dev/$partdev" /mnt
- cp -af "$CONF_TAR" /mnt/
+ cp -af "$CONF_TAR" "/mnt/$BACKUP_FILE"
umount /mnt
fi
}
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
}