base-files: fwtool: Fix wrong checksum on combined-image with metadata
authorPetr Štetiar <ynezz@true.cz>
Fri, 9 Nov 2018 11:27:12 +0000 (12:27 +0100)
committerJo-Philipp Wich <jo@mein.io>
Tue, 18 Dec 2018 16:48:15 +0000 (17:48 +0100)
If I create following image:

define Device/engenius-m36
  IMAGE/sysupgrade.bin := combined-image | append-metadata
endef

Sysupgrade then errors out:

  Invalid image. Contents do not match checksum (image:cd285595eaf297370404ae0e2815ec1a calculated:2cf9a2286fb6b01af3ea189128017d44)
  Image check 'platform_check_image' failed.

By removing the metadata from the image I get combined-image checksum
working again and sysupgrade works.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
(backported from 41770add03ad77a0ce41ed424ad050238f7d9272)

package/base-files/files/lib/upgrade/fwtool.sh

index aa2ac79d13790200163c284e04d961d185b21463..63c27cf5d08aef01f1adee9caa204ae635e8be53 100644 (file)
@@ -3,7 +3,7 @@ fwtool_check_image() {
 
        . /usr/share/libubox/jshn.sh
 
-       if ! fwtool -q -i /tmp/sysupgrade.meta "$1"; then
+       if ! fwtool -q -t -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"