aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/x86/base-files
diff options
context:
space:
mode:
authorYousong Zhou <yszhou4tech@gmail.com>2017-01-01 01:06:29 +0800
committerFelix Fietkau <nbd@nbd.name>2017-01-05 11:09:13 +0100
commitfa37bdc05a3e8ebab7de293d059959b2efc99581 (patch)
tree1f17598a427d004987f001a50a7bedd45e333a1e /target/linux/x86/base-files
parent5f9e36712799e7737695384e3c82278af3ddf368 (diff)
downloadupstream-fa37bdc05a3e8ebab7de293d059959b2efc99581.tar.gz
upstream-fa37bdc05a3e8ebab7de293d059959b2efc99581.tar.bz2
upstream-fa37bdc05a3e8ebab7de293d059959b2efc99581.zip
x86: move sysupgrade.tgz only if it exists
To squash error messages at boot time mv: can't rename '/mnt/sysupgrade.tgz': No such file or directory Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
Diffstat (limited to 'target/linux/x86/base-files')
-rw-r--r--target/linux/x86/base-files/lib/preinit/79_move_config9
1 files changed, 6 insertions, 3 deletions
diff --git a/target/linux/x86/base-files/lib/preinit/79_move_config b/target/linux/x86/base-files/lib/preinit/79_move_config
index 5ac81cb90d..37954f0236 100644
--- a/target/linux/x86/base-files/lib/preinit/79_move_config
+++ b/target/linux/x86/base-files/lib/preinit/79_move_config
@@ -7,9 +7,12 @@ move_config() {
. /lib/upgrade/platform.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 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
}