[source] x86: move sysupgrade.tgz only if it exists

LEDE Commits lede-commits at lists.infradead.org
Thu Jan 5 02:14:34 PST 2017


nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/fa37bdc05a3e8ebab7de293d059959b2efc99581

commit fa37bdc05a3e8ebab7de293d059959b2efc99581
Author: Yousong Zhou <yszhou4tech at gmail.com>
AuthorDate: Sun Jan 1 01:06:29 2017 +0800

    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 at gmail.com>
---
 target/linux/x86/base-files/lib/preinit/79_move_config | 9 ++++++---
 1 file 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 5ac81cb..37954f0 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
 }
 



More information about the lede-commits mailing list