base-files: sysupgrade: exit if the firmware download failed
authorPetr Štetiar <ynezz@true.cz>
Tue, 31 Dec 2019 09:34:29 +0000 (10:34 +0100)
committerPetr Štetiar <ynezz@true.cz>
Sun, 5 Jan 2020 16:50:10 +0000 (17:50 +0100)
Sysupgrade process shouldn't continue if the firmware image couldn't be
downloaded.

Ref: http://lists.infradead.org/pipermail/openwrt-devel/2019-December/020940.html
Reported-by: Petr Novák <petrn@me.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit cf3da66d2ce11a30ae2993b56276ade10c9bddb9)

package/base-files/Makefile
package/base-files/files/sbin/sysupgrade

index 3602cc003feb242e1a3e60461d2174775e03a7c4..c30694cfdd70dfcb95fc9e8cc0ebbf77c92236a4 100644 (file)
@@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/version.mk
 include $(INCLUDE_DIR)/feeds.mk
 
 PKG_NAME:=base-files
-PKG_RELEASE:=204.1
+PKG_RELEASE:=204.2
 PKG_FLAGS:=nonshared
 
 PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
index 935d08048e81c8c231301ac20647d340f102f930..6c518b780eddd973966537b50d8f7c82539bb1e1 100755 (executable)
@@ -294,7 +294,7 @@ type platform_check_image >/dev/null 2>/dev/null || {
 case "$IMAGE" in
        http://*|\
        https://*)
-               wget -O/tmp/sysupgrade.img "$IMAGE"
+               wget -O/tmp/sysupgrade.img "$IMAGE" || exit 1
                IMAGE=/tmp/sysupgrade.img
                ;;
 esac