0094-x86-move-sysupgrade.tgz-only-if-it-exists.patch 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. From: Yousong Zhou <yszhou4tech@gmail.com>
  2. Date: Sun, 1 Jan 2017 01:06:29 +0800
  3. Subject: x86: move sysupgrade.tgz only if it exists
  4. To squash error messages at boot time
  5. mv: can't rename '/mnt/sysupgrade.tgz': No such file or directory
  6. Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
  7. Backport of LEDE fa37bdc05a3e8ebab7de293d059959b2efc99581
  8. diff --git a/target/linux/x86/base-files/lib/preinit/79_move_config b/target/linux/x86/base-files/lib/preinit/79_move_config
  9. index 5ac81cb90d1c15782a9c4f271720cfa66d6d03a9..37954f0236faafca657a05a3c1efc7df2e162bfc 100644
  10. --- a/target/linux/x86/base-files/lib/preinit/79_move_config
  11. +++ b/target/linux/x86/base-files/lib/preinit/79_move_config
  12. @@ -7,9 +7,12 @@ move_config() {
  13. . /lib/upgrade/platform.sh
  14. if platform_export_bootdevice && platform_export_partdevice partdev 1; then
  15. - mount -t ext4 -o rw,noatime "/dev/$partdev" /mnt
  16. - mv -f /mnt/sysupgrade.tgz /
  17. - umount /mnt
  18. + if mount -t ext4 -o rw,noatime "/dev/$partdev" /mnt; then
  19. + if [ -f /mnt/sysupgrade.tgz ]; then
  20. + mv -f /mnt/sysupgrade.tgz /
  21. + fi
  22. + umount /mnt
  23. + fi
  24. fi
  25. }