[OpenWrt-Devel] Sysupgrade possibly broken in recent development snapshots: "message": "Firmware image couldn't be validated"

Petr Štetiar ynezz at true.cz
Tue Dec 31 08:49:25 EST 2019


Petr Novák <petrn at me.com> [2019-12-31 11:03:23]:

> root at OpenWrt:/tmp# sysupgrade -v openwrt-brcm2708-bcm2711-rpi-4-ext4-sysupgrade.img.gz
> Reading partition table from bootdisk...
> Reading partition table from image...

This output is from /sbin/sysupgrade calling /usr/libexec/validate_firmware_image:

> {
> 	"tests": {
> 		"fwtool_signature": true,
> 		"fwtool_device_match": true
> 	},
> 	"valid": true,
> 	"forceable": true,
> 	"allow_backup": true
> }
> Saving config files...

...snip...

> Commencing upgrade. Closing all shell sessions.

and here should be same output from procd calling
/usr/libexec/validate_firmware_image, but it is missing as probably procd
consumes the stderr output, so probably something like this is needed:

 diff --git a/package/base-files/files/usr/libexec/validate_firmware_image
 b/package/base-files/files/usr/libexec/validate_firmware_image
 index f85fb9e4b435..754d53b2edfe 100755
 --- a/package/base-files/files/usr/libexec/validate_firmware_image
 +++ b/package/base-files/files/usr/libexec/validate_firmware_image
 @@ -62,5 +62,6 @@ json_init
 	json_add_boolean valid "$VALID"
 	json_add_boolean forceable "$FORCEABLE"
 	json_add_boolean allow_backup "$ALLOW_BACKUP"
 +json_dump -i >> /tmp/vfi-json.log
  json_dump -i
  json_set_namespace $old_ns

and then run:

 $ ubus monitor &
 $ sysupgrade -v openwrt-brcm2708-bcm2711-rpi-4-ext4-sysupgrade.img.gz
 $ cat /tmp/vfi-json.log

-- ynezz

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list