aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/mediatek
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2019-09-04 16:57:39 +0200
committerRafał Miłecki <rafal@milecki.pl>2019-09-12 13:25:27 +0200
commit37caec2d5e01b907a86969aa1526a6ec3812b511 (patch)
treed93932477cb100306812e6fcad374e0c3f16e440 /target/linux/mediatek
parentf54bc3985a2fbc30256d9aee8ea3b60b8aee593a (diff)
downloadupstream-37caec2d5e01b907a86969aa1526a6ec3812b511.tar.gz
upstream-37caec2d5e01b907a86969aa1526a6ec3812b511.tar.bz2
upstream-37caec2d5e01b907a86969aa1526a6ec3812b511.zip
treewide: don't hardcode "sysupgrade.tgz" file name
1) Add BACKUP_FILE and use it when copying an archive to be restored after sysupgrade (on the next preinit). 2) Use CONF_TAR for copying backup prepared by the /sbin/sysupgrade Signed-off-by: Rafał Miłecki <rafal@milecki.pl> (cherry picked from commit bf390478727ac5f4f9d6fb684de48b8150bcec67)
Diffstat (limited to 'target/linux/mediatek')
-rw-r--r--target/linux/mediatek/base-files/lib/preinit/79_move_config4
1 files changed, 3 insertions, 1 deletions
diff --git a/target/linux/mediatek/base-files/lib/preinit/79_move_config b/target/linux/mediatek/base-files/lib/preinit/79_move_config
index e8e62883dc..617336583e 100644
--- a/target/linux/mediatek/base-files/lib/preinit/79_move_config
+++ b/target/linux/mediatek/base-files/lib/preinit/79_move_config
@@ -1,6 +1,8 @@
#!/bin/sh
# Copyright (C) 2015 OpenWrt.org
+. /lib/upgrade/common.sh
+
RECOVERY_PART=/dev/mmcblk0p1
move_config() {
@@ -11,7 +13,7 @@ move_config() {
insmod vfat
mkdir -p /recovery
mount -o rw,noatime $RECOVERY_PART /recovery
- [ -f /recovery/sysupgrade.tgz ] && mv -f /recovery/sysupgrade.tgz /
+ [ -f "/recovery/$BACKUP_FILE" ] && mv -f "/recovery/$BACKUP_FILE" /
umount /recovery
fi
}