Revert "base-files: fwtool: Fix wrong checksum on combined-image with metadata"
authorJo-Philipp Wich <jo@mein.io>
Sun, 2 Dec 2018 15:05:40 +0000 (16:05 +0100)
committerJo-Philipp Wich <jo@mein.io>
Sun, 2 Dec 2018 15:05:44 +0000 (16:05 +0100)
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 <jo@mein.io>
package/base-files/files/lib/upgrade/fwtool.sh

index e0e5c96c89ba91cdd17f0a928d67099ac226909e..3f28fccd904dc0ae1019ad31ad11b5a1c220b905 100644 (file)
@@ -28,7 +28,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"