From 69399360423f2f77b61c0fe1faae8a9613c878d3 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sun, 2 Dec 2018 16:05:40 +0100 Subject: [PATCH] Revert "base-files: fwtool: Fix wrong checksum on combined-image with metadata" This reverts commit 41770add03ad77a0ce41ed424ad050238f7d9272. The fwtool_check_image() procedure is used by `sysupgrade --test` which must not alter the image under test in any way. Currently, when the LuCI ui or any other sysupgrade wrapper first invokes sysupgrade --test to verify the compatibility of the image and then calculates the sha256sum over it, the resulting checksum will differ from the original image since the test invocation will implicitely strip the metadata trailer. To properly fix the underlying issue, the combined image checksumming code must be modified to skip the metadata trailer. Signed-off-by: Jo-Philipp Wich (backported from 9808bd279927bcd2d3a78d19a55229b93bbbcf05) --- package/base-files/files/lib/upgrade/fwtool.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/base-files/files/lib/upgrade/fwtool.sh b/package/base-files/files/lib/upgrade/fwtool.sh index 63c27cf5d0..aa2ac79d13 100644 --- a/package/base-files/files/lib/upgrade/fwtool.sh +++ b/package/base-files/files/lib/upgrade/fwtool.sh @@ -3,7 +3,7 @@ fwtool_check_image() { . /usr/share/libubox/jshn.sh - if ! fwtool -q -t -i /tmp/sysupgrade.meta "$1"; then + if ! fwtool -q -i /tmp/sysupgrade.meta "$1"; then echo "Image metadata not found" [ "$REQUIRE_IMAGE_METADATA" = 1 -a "$FORCE" != 1 ] && { echo "Use sysupgrade -F to override this check when downgrading or flashing to vendor firmware" -- 2.30.2