brcm47xx: extend firmware validation
authorRafał Miłecki <rafal@milecki.pl>
Wed, 4 Sep 2019 04:35:31 +0000 (06:35 +0200)
committerRafał Miłecki <rafal@milecki.pl>
Wed, 4 Sep 2019 04:37:17 +0000 (06:37 +0200)
commite68c1cebd1d87ce60f0646688e437e83081e2322
treeb6ca4bac834e68494734ac942d84c35a0e0cfdcb
parent5287ac2dfbd0393e23e35e415ddf37f42df9b58e
brcm47xx: extend firmware validation

This provides TRX validation result, so final JSON may look like:
{
"tests": {
"fwtool_signature": true,
"fwtool_device_match": true,
"trx_valid": true
},
"valid": true,
"forceable": true
}

It also prevents users from installing broken firmware files, e.g.:

root@OpenWrt:/# sysupgrade -F -n /tmp/TZ
Image metadata not found
Invalid image type. Please use firmware specific for this device.
Image check failed but --force given - will update anyway!
Commencing upgrade. Closing all shell sessions.
Firmware image is broken and cannot be installed

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
target/linux/brcm47xx/base-files/lib/upgrade/platform.sh