~/paste/44738
~/paste/44738
~/paste/44738

  1. From 143ddb6dc8bd7738400fd488d4925acad6167130 Mon Sep 17 00:00:00 2001
  2. From: Mirko Vogt <mirko-openwrt@nanl.de>
  3. Date: Wed, 10 Jul 2019 23:43:21 +0000
  4. Subject: [PATCH] sysupgrade: abort if download / copy of sysupgrade image
  5.  fails
  6.  
  7. Before, sysupgrade attempted to initiate an upgrade, even though the
  8. image download failed and/or was incomplete.
  9.  
  10. Signed-off-by: Mirko Vogt <mirko-openwrt@nanl.de>
  11. ---
  12. package/base-files/files/sbin/sysupgrade | 4 ++--
  13.  1 file changed, 2 insertions(+), 2 deletions(-)
  14.  
  15. diff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade
  16. index 54d7a64b48..ffe28b5386 100755
  17. --- a/package/base-files/files/sbin/sysupgrade
  18. +++ b/package/base-files/files/sbin/sysupgrade
  19. @@ -296,7 +296,7 @@ type platform_check_image >/dev/null 2>/dev/null || {
  20.  case "$IMAGE" in
  21.         http://*|\
  22.         https://*)
  23. -               wget -O/tmp/sysupgrade.img "$IMAGE"
  24. +               wget -O/tmp/sysupgrade.img "$IMAGE" || exit $?
  25.                 IMAGE=/tmp/sysupgrade.img
  26.                 ;;
  27.  esac
  28. @@ -311,7 +311,7 @@ case "$IMAGE" in
  29.         /tmp/*) ;;
  30.         *)
  31.                 v "Image not in /tmp, copying..."
  32. -               cp -f "$IMAGE" /tmp/sysupgrade.img
  33. +               cp -f "$IMAGE" /tmp/sysupgrade.img || exit $?
  34.                 IMAGE=/tmp/sysupgrade.img
  35.                 ;;
  36.  esac
  37. --
  38. 2.20.1
Language: diff
Posted by Anonymous at 10 Jul 2019, 11:46:08 UTC