Those got fixed just a short while ago (at least for the platforms that I test, ath79, mediatek, bcm53xx and x86).
Are you still seeing the same sysupgrade --test
behavior, silently terminating? I may have found some insight into the issue. If you can still reproduce, I've got some ideas about getting to the bottom of it. https://github.com/efahl/owut/issues/16#issuecomment-2258419156
I am still unable to test it again, Owut is still giving me the 500 error and I still can`t download any new firmwares.
owut
was released with a new --rev-code
option in version 2024.07.31 (should be in the package feeds shortly). Normally, you let standard full-firmware upgrades keep your packages up-to-date, but in this case you may want to manually upgrade owut
specifically (in order to be able to actually do that full-firmware upgrade).
$ opkg update
..
$ opkg info owut
Package: owut
Version: 2024.07.31~e329cb9b-r1 <<<--- if you see this (or later)
...
$ opkg upgrade owut <<<--- then you can do this
...
Why do this?
An "incorrect" revision code (or if you prefer, version_code
) is the root cause issue on a lot of failed upgrade attempts. The scare quotes are to emphasize that it's often the case that you don't really care what specific kernel build you are getting (sometimes you do!), as long as it's new enough to contain patches or new packages of interest.
The symptom is a build request that terminates early and shows the reason to be:
Progress 2 ( 22s) -----------------------------
Status: 500
Detail: Error: Received incorrect version r27055-e6fec638d2 (requested r27065-ca4469045f)
This indicates that the ASU server and the ImageBuilder are out of sync. If that "received" version number is acceptable to you, then you can usually specify a --rev-code
manually and things will work just fine ("fine" in this context means "a valid, self-consistent, working firmware with the version numbers as shown in the manifest").
Copy the received version code from the error message onto the command line thusly:
$ owut download --rev-code r27055-e6fec638d2
...
Build: Requesting version r27055-e6fec638d2 (kernel 6.6.43)
Requesting build ----------------------
Hash: blahblah
Status: 202
Detail: queued - 0 ahead of you
...
Progress 17 ( 187s) -----------------------------
Status: 200
Detail: done
Build completed in 188 seconds.
version_number = SNAPSHOT
version_code = r27055-e6fec638d2 (requested r27055-e6fec638d2)
...
$ vi /tmp/firmware-manifest.json
... check the package versions or whatever
... if acceptable:
$ owut install
Notes:
- The
--rev-code
value you supply is checked for syntax, but it is impossible to check it for actual validity. Make sure you copy or type it correctly, a mismatch will result in another failed build attempt. - The value
none
as inowut upgrade --rev-code none
is allowed, and it removes theversion_code
from the request altogether. This may (or may not!) get you through the build, it's a last ditch option, try using real rev codes first.
Hi!
First thing, thank you for the upgrade on OWUT, just managed to download the new version using the --rev-code option!
Here is the long waited response to the --test command! still ending with the empty response...
sysupgrade --test /tmp/firmware.bin
+ . /lib/functions.sh
+ N='
'
+ _C=0
+ NO_EXPORT=1
+ LOAD_STATE=1
+ LIST_SEP=' '
+ reset_cb
+ '[' -z ]
+ '[' -f /lib/config/uci.sh ]
+ . /lib/config/uci.sh
+ CONFIG_APPEND=
+ . /lib/functions/system.sh
+ . /lib/functions.sh
+ N='
'
+ _C=0
+ NO_EXPORT=1
+ LOAD_STATE=1
+ LIST_SEP=' '
+ reset_cb
+ '[' -z ]
+ '[' -f /lib/config/uci.sh ]
+ . /lib/config/uci.sh
+ CONFIG_APPEND=
+ . /usr/share/libubox/jshn.sh
+ . /usr/share/libubox/jshn.sh
+ CONF_TAR=/tmp/sysupgrade.tgz
+ ETCBACKUP_DIR=/etc/backup
+ INSTALLED_PACKAGES=/etc/backup/installed_packages.txt
+ COMMAND=/lib/upgrade/do_stage2
+ SAVE_OVERLAY=0
+ SAVE_OVERLAY_PATH=
+ SAVE_PARTITIONS=1
+ SAVE_INSTALLED_PKGS=0
+ SKIP_UNCHANGED=0
+ CONF_IMAGE=
+ CONF_BACKUP_LIST=0
+ CONF_BACKUP=
+ CONF_RESTORE=
+ NEED_IMAGE=
+ HELP=0
+ TEST=0
+ export 'MTD_ARGS='
+ export 'MTD_CONFIG_ARGS='
+ export 'INTERACTIVE=0'
+ export 'VERBOSE=1'
+ export 'SAVE_CONFIG=1'
+ export 'IGNORE_MINOR_COMPAT=0'
+ export 'FORCE=0'
+ export 'CONFFILES=/tmp/sysupgrade.conffiles'
+ '[' -n --test ]
+ TEST=1
+ shift
+ '[' -n /tmp/firmware.bin ]
+ break
+ IMAGE=/tmp/firmware.bin
+ '[' 0 -gt 0 ]
+ '[' -z /tmp/firmware.bin -a -z -a 0 -eq 0 ]
+ '[' -n /tmp/firmware.bin -a -n ]
+ '[' '=' - ]
+ '[' 0 '=' 1 ]
+ sysupgrade_init_conffiles=build_list_of_backup_config_files
+ find_filter=
+ '[' 0 '=' 1 ]
+ include /lib/upgrade
+ local file
+ ls /lib/upgrade/common.sh /lib/upgrade/emmc.sh /lib/upgrade/fit.sh /lib/upgrade/fwtool.sh /lib/upgrade/luci_statistics-add-conffiles.sh /lib/upgrade/nand.sh /lib/upgrade/platform.sh /lib/upgrade/tar.sh
+ . /lib/upgrade/common.sh
+ RAM_ROOT=/tmp/root
+ export 'BACKUP_FILE=sysupgrade.tgz'
+ '[' -x /usr/bin/ldd ]
+ . /lib/upgrade/emmc.sh
+ . /lib/functions.sh
+ N='
'
+ _C=0
+ NO_EXPORT=1
+ LOAD_STATE=1
+ LIST_SEP=' '
+ reset_cb
+ '[' -z ]
+ '[' -f /lib/config/uci.sh ]
+ . /lib/config/uci.sh
+ CONFIG_APPEND=
+ . /lib/upgrade/fit.sh
+ . /lib/upgrade/fwtool.sh
+ . /lib/upgrade/luci_statistics-add-conffiles.sh
+ sysupgrade_init_conffiles='build_list_of_backup_config_files add_luci_statistics_conffiles'
+ . /lib/upgrade/nand.sh
+ . /lib/functions.sh
+ N='
'
+ _C=0
+ NO_EXPORT=1
+ LOAD_STATE=1
+ LIST_SEP=' '
+ reset_cb
+ '[' -z ]
+ '[' -f /lib/config/uci.sh ]
+ . /lib/config/uci.sh
+ CONFIG_APPEND=
+ CI_KERNPART=kernel
+ CI_UBIPART=ubi
+ CI_ROOTPART=rootfs
+ . /lib/upgrade/platform.sh
+ REQUIRE_IMAGE_METADATA=1
+ RAMFS_COPY_BIN=fitblk
+ PART_NAME=firmware
+ . /lib/upgrade/tar.sh
+ '[' 0 -eq 1 ]
+ '[' -n ]
+ '[' -n ]
+ type platform_check_image
+ readlink -f /tmp/firmware.bin
+ IMAGE=/tmp/firmware.bin
+ /usr/libexec/validate_firmware_image /tmp/firmware.bin
+ json_load '{
"tests": {
"fwtool_signature": true,
"fwtool_device_match": true
},
"valid": true,
"forceable": true,
"allow_backup": true
}'
+ jshn -r '{
"tests": {
"fwtool_signature": true,
"fwtool_device_match": true
},
"valid": true,
"forceable": true,
"allow_backup": true
}'
+ eval 'json_init;
json_add_object '"'"'tests'"'"';
json_add_boolean '"'"'fwtool_signature'"'"' 1;
json_add_boolean '"'"'fwtool_device_match'"'"' 1;
json_close_object;
json_add_boolean '"'"'valid'"'"' 1;
json_add_boolean '"'"'forceable'"'"' 1;
json_add_boolean '"'"'allow_backup'"'"' 1;'
+ json_init
+ json_cleanup
+ local unset tmp
+ _json_get_var unset JSON_UNSET
+ eval 'unset="$JSON_UNSET"'
+ unset=
+ unset U_J_V K_J_V S_J_V T_J_V N_J_V J_V
+ unset JSON_SEQ JSON_CUR JSON_UNSET
+ export -n 'JSON_SEQ=0'
+ export -- 'JSON_CUR=J_V' 'K_J_V='
+ json_add_object tests
+ _json_add_table tests object T
+ local cur seq
+ _json_get_var cur JSON_CUR
+ eval 'cur="$JSON_CUR"'
+ cur=J_V
+ _json_inc JSON_SEQ seq
+ let 'JSON_SEQ += 1' 'seq = JSON_SEQ'
+ local 'table=J_T1'
+ _json_set_var U_J_T1 J_V
+ local '___val=J_V'
+ eval 'U_J_T1="$___val"'
+ U_J_T1=J_V
+ export -- 'K_J_T1='
+ unset S_J_T1
+ _json_set_var JSON_CUR J_T1
+ local '___val=J_T1'
+ eval 'JSON_CUR="$___val"'
+ JSON_CUR=J_T1
+ _jshn_append JSON_UNSET J_T1
+ local '_a_value=J_T1'
+ eval 'JSON_UNSET="${JSON_UNSET} $_a_value"'
+ JSON_UNSET=' J_T1'
+ _json_add_generic object tests J_T1 J_V
+ local var
+ '[' J_V '=' J_A ]
+ var=tests
+ '[[' tests '==' tests ]]
+ export -- 'J_V_tests=J_T1' 'T_J_V_tests=object'
+ _jshn_append JSON_UNSET J_V_tests
+ local '_a_value=J_V_tests'
+ eval 'JSON_UNSET="${JSON_UNSET} $_a_value"'
+ JSON_UNSET=' J_T1 J_V_tests'
+ _jshn_append K_J_V tests
+ local '_a_value=tests'
+ eval 'K_J_V="${K_J_V} $_a_value"'
+ K_J_V=' tests'
+ json_add_boolean fwtool_signature 1
+ local cur
+ _json_get_var cur JSON_CUR
+ eval 'cur="$JSON_CUR"'
+ cur=J_T1
+ _json_add_generic boolean fwtool_signature 1 J_T1
+ local var
+ '[' J_T '=' J_A ]
+ var=fwtool_signature
+ '[[' fwtool_signature '==' fwtool_signature ]]
+ export -- 'J_T1_fwtool_signature=1' 'T_J_T1_fwtool_signature=boolean'
+ _jshn_append JSON_UNSET J_T1_fwtool_signature
+ local '_a_value=J_T1_fwtool_signature'
+ eval 'JSON_UNSET="${JSON_UNSET} $_a_value"'
+ JSON_UNSET=' J_T1 J_V_tests J_T1_fwtool_signature'
+ _jshn_append K_J_T1 fwtool_signature
+ local '_a_value=fwtool_signature'
+ eval 'K_J_T1="${K_J_T1} $_a_value"'
+ K_J_T1=' fwtool_signature'
+ json_add_boolean fwtool_device_match 1
+ local cur
+ _json_get_var cur JSON_CUR
+ eval 'cur="$JSON_CUR"'
+ cur=J_T1
+ _json_add_generic boolean fwtool_device_match 1 J_T1
+ local var
+ '[' J_T '=' J_A ]
+ var=fwtool_device_match
+ '[[' fwtool_device_match '==' fwtool_device_match ]]
+ export -- 'J_T1_fwtool_device_match=1' 'T_J_T1_fwtool_device_match=boolean'
+ _jshn_append JSON_UNSET J_T1_fwtool_device_match
+ local '_a_value=J_T1_fwtool_device_match'
+ eval 'JSON_UNSET="${JSON_UNSET} $_a_value"'
+ JSON_UNSET=' J_T1 J_V_tests J_T1_fwtool_signature J_T1_fwtool_device_match'
+ _jshn_append K_J_T1 fwtool_device_match
+ local '_a_value=fwtool_device_match'
+ eval 'K_J_T1="${K_J_T1} $_a_value"'
+ K_J_T1=' fwtool_signature fwtool_device_match'
+ json_close_object
+ _json_close_table
+ local _s_cur
+ _json_get_var _s_cur JSON_CUR
+ eval '_s_cur="$JSON_CUR"'
+ _s_cur=J_T1
+ _json_get_var JSON_CUR U_J_T1
+ eval 'JSON_CUR="$U_J_T1"'
+ JSON_CUR=J_V
+ json_add_boolean valid 1
+ local cur
+ _json_get_var cur JSON_CUR
+ eval 'cur="$JSON_CUR"'
+ cur=J_V
+ _json_add_generic boolean valid 1 J_V
+ local var
+ '[' J_V '=' J_A ]
+ var=valid
+ '[[' valid '==' valid ]]
+ export -- 'J_V_valid=1' 'T_J_V_valid=boolean'
+ _jshn_append JSON_UNSET J_V_valid
+ local '_a_value=J_V_valid'
+ eval 'JSON_UNSET="${JSON_UNSET} $_a_value"'
+ JSON_UNSET=' J_T1 J_V_tests J_T1_fwtool_signature J_T1_fwtool_device_match J_V_valid'
+ _jshn_append K_J_V valid
+ local '_a_value=valid'
+ eval 'K_J_V="${K_J_V} $_a_value"'
+ K_J_V=' tests valid'
+ json_add_boolean forceable 1
+ local cur
+ _json_get_var cur JSON_CUR
+ eval 'cur="$JSON_CUR"'
+ cur=J_V
+ _json_add_generic boolean forceable 1 J_V
+ local var
+ '[' J_V '=' J_A ]
+ var=forceable
+ '[[' forceable '==' forceable ]]
+ export -- 'J_V_forceable=1' 'T_J_V_forceable=boolean'
+ _jshn_append JSON_UNSET J_V_forceable
+ local '_a_value=J_V_forceable'
+ eval 'JSON_UNSET="${JSON_UNSET} $_a_value"'
+ JSON_UNSET=' J_T1 J_V_tests J_T1_fwtool_signature J_T1_fwtool_device_match J_V_valid J_V_forceable'
+ _jshn_append K_J_V forceable
+ local '_a_value=forceable'
+ eval 'K_J_V="${K_J_V} $_a_value"'
+ K_J_V=' tests valid forceable'
+ json_add_boolean allow_backup 1
+ local cur
+ _json_get_var cur JSON_CUR
+ eval 'cur="$JSON_CUR"'
+ cur=J_V
+ _json_add_generic boolean allow_backup 1 J_V
+ local var
+ '[' J_V '=' J_A ]
+ var=allow_backup
+ '[[' allow_backup '==' allow_backup ]]
+ export -- 'J_V_allow_backup=1' 'T_J_V_allow_backup=boolean'
+ _jshn_append JSON_UNSET J_V_allow_backup
+ local '_a_value=J_V_allow_backup'
+ eval 'JSON_UNSET="${JSON_UNSET} $_a_value"'
+ JSON_UNSET=' J_T1 J_V_tests J_T1_fwtool_signature J_T1_fwtool_device_match J_V_valid J_V_forceable J_V_allow_backup'
+ _jshn_append K_J_V allow_backup
+ local '_a_value=allow_backup'
+ eval 'K_J_V="${K_J_V} $_a_value"'
+ K_J_V=' tests valid forceable allow_backup'
+ json_get_var valid valid
+ local '__dest=valid'
+ local __cur
+ _json_get_var __cur JSON_CUR
+ eval '__cur="$JSON_CUR"'
+ __cur=J_V
+ local '__var=J_V_valid'
+ eval 'export -- "valid=${J_V_valid:-}"; [ -n "${J_V_valid+x}${3+x}" ]'
+ export -- 'valid=1'
+ '[' -n x ]
+ '[' 1 -eq 0 ]
+ '[' -n ]
+ ask_bool 1 'Keep config files over reflash'
+ local 'default=1'
+ shift
+ local 'answer=1'
+ '[' 0 -eq 1 ]
+ '[' 1 -gt 0 ]
+ '[' 1 -eq 1 ]
+ export 'SAVE_CONFIG=1'
+ '[' 1 -eq 1 ]
+ exit 0
root@AX3000T_Router:/tmp#
Thanks!
I believe sysupgrade is dying somewhere in the create_backup_archive
function. There are some reports of similar behavior being caused by it running the init.d
scripts to get the service enabled/disabled state (https://github.com/openwrt/openwrt/issues/15994#issuecomment-2253524526). Looks like it might just be crashing silently right here, but it might be something else.
What do you see if you run this command line?
VERBOSE=1 /usr/libexec/validate_firmware_image junk ; echo $?
My (invalid) "junk" file gives
$ VERBOSE=1 /usr/libexec/validate_firmware_image junk ; echo $?
Sun Aug 4 13:22:06 PDT 2024 upgrade: Image metadata not present
Sun Aug 4 13:22:06 PDT 2024 upgrade: Invalid image type
{
"tests": {
"fwtool_signature": true,
"fwtool_device_match": true
},
"valid": false,
"forceable": true,
"allow_backup": true
}
0
Ok, also try it with /tmp/firmware.bin
(i.e., a valid firmware file)...
$ VERBOSE=1 /usr/libexec/validate_firmware_image /tmp/firmware.bin ; echo $?
Sun Aug 4 13:25:27 PDT 2024 upgrade: Image metadata not present
Sun Aug 4 13:25:27 PDT 2024 upgrade: Reading partition table from bootdisk...
Sun Aug 4 13:25:27 PDT 2024 upgrade: Extract boot sector from the image
Sun Aug 4 13:25:27 PDT 2024 upgrade: Reading partition table from image...
{
"tests": {
"fwtool_signature": true,
"fwtool_device_match": true
},
"valid": true,
"forceable": true,
"allow_backup": true
}
0
Sure!
If you need I can list my init.d scripts, but nothing out of the ordinary (nor did I customize anything):
root@AX3000T_Router:/etc/init.d# ls
adblock collectd done gpio_switch luci_statistics odhcpd rpcd sysfixtime ucitrack urandom_seed
boot cron dropbear led network packet_steering sqm sysntpd uhttpd urngd
bootcount dnsmasq firewall log nlbwmon radius sysctl system umount wpad
Here are the outputs for the validation command:
root@AX3000T_Router:~# VERBOSE=1 /usr/libexec/validate_firmware_image junk ; ech
o $?
Sun Aug 4 18:00:31 -03 2024 upgrade: Image metadata not present
Sun Aug 4 18:00:31 -03 2024 upgrade: Use sysupgrade -F to override this check when downgrading or flashing to vendor firmware
invalid sysupgrade file
{
"tests": {
"fwtool_signature": true,
"fwtool_device_match": false
},
"valid": false,
"forceable": true,
"allow_backup": true
}
0
As for the second one (the last firmware I downloaded):
root@AX3000T_Router:~# VERBOSE=1 /usr/libexec/validate_firmware_image /tmp/firmware.bin ; echo $?
{
"tests": {
"fwtool_signature": true,
"fwtool_device_match": true
},
"valid": true,
"forceable": true,
"allow_backup": true
}
0
Oho! That last one without any output looks like the culprit. There should the standard output messages about the checks, due to the VERBOSE
.
Could you do one more? The last 20 lines or so from this should be pretty enlightening.
VERBOSE=1 sh -vx /usr/libexec/validate_firmware_image /tmp/firmware.bin
No problem at all!
Here are the last lines of this last command (i started were I thought it might be relevant, let me know if you think the full log may bring more light to the issue):
+ fwtool -q -i /tmp/sysupgrade.meta /tmp/firmware.bin
+ cat /tmp/sysupgrade.meta
+ json_load '{ "metadata_version": "1.1", "compat_version": "1.0", "supported_devices":["xiaomi,mi-router-ax3000t-ubootmod"], "version": { "dist": "OpenWrt", "version": "SNAPSHOT", "revision": "r27052-4e6212e62f", "target": "mediatek/filogic", "board": "xiaomi_mi-router-ax3000t-ubootmod" } }'
+ jshn -r '{ "metadata_version": "1.1", "compat_version": "1.0", "supported_devices":["xiaomi,mi-router-ax3000t-ubootmod"], "version": { "dist": "OpenWrt", "version": "SNAPSHOT", "revision": "r27052-4e6212e62f", "target": "mediatek/filogic", "board": "xiaomi_mi-router-ax3000t-ubootmod" } }'
+ eval 'json_init;
json_add_string '"'"'metadata_version'"'"' '"'"'1.1'"'"';
json_add_string '"'"'compat_version'"'"' '"'"'1.0'"'"';
json_add_array '"'"'supported_devices'"'"';
json_add_string '"'"'0'"'"' '"'"'xiaomi,mi-router-ax3000t-ubootmod'"'"';
json_close_array;
json_add_object '"'"'version'"'"';
json_add_string '"'"'dist'"'"' '"'"'OpenWrt'"'"';
json_add_string '"'"'version'"'"' '"'"'SNAPSHOT'"'"';
json_add_string '"'"'revision'"'"' '"'"'r27052-4e6212e62f'"'"';
json_add_string '"'"'target'"'"' '"'"'mediatek/filogic'"'"';
json_add_string '"'"'board'"'"' '"'"'xiaomi_mi-router-ax3000t-ubootmod'"'"';
json_close_object;'
+ json_init
+ json_cleanup
+ local unset tmp
+ _json_get_var unset JSON_UNSET
+ eval 'unset="$JSON_UNSET"'
+ unset=
+ unset U_J_V K_J_V S_J_V T_J_V N_J_V J_V
+ unset JSON_SEQ JSON_CUR JSON_UNSET
+ export -n 'JSON_SEQ=0'
+ export -- 'JSON_CUR=J_V' 'K_J_V='
+ json_add_string metadata_version 1.1
+ local cur
+ _json_get_var cur JSON_CUR
+ eval 'cur="$JSON_CUR"'
+ cur=J_V
+ _json_add_generic string metadata_version 1.1 J_V
+ local var
+ '[' J_V '=' J_A ]
+ var=metadata_version
+ '[[' metadata_version '==' metadata_version ]]
+ export -- 'J_V_metadata_version=1.1' 'T_J_V_metadata_version=string'
+ _jshn_append JSON_UNSET J_V_metadata_version
+ local '_a_value=J_V_metadata_version'
+ eval 'JSON_UNSET="${JSON_UNSET} $_a_value"'
+ JSON_UNSET=' J_V_metadata_version'
+ _jshn_append K_J_V metadata_version
+ local '_a_value=metadata_version'
+ eval 'K_J_V="${K_J_V} $_a_value"'
+ K_J_V=' metadata_version'
+ json_add_string compat_version 1.0
+ local cur
+ _json_get_var cur JSON_CUR
+ eval 'cur="$JSON_CUR"'
+ cur=J_V
+ _json_add_generic string compat_version 1.0 J_V
+ local var
+ '[' J_V '=' J_A ]
+ var=compat_version
+ '[[' compat_version '==' compat_version ]]
+ export -- 'J_V_compat_version=1.0' 'T_J_V_compat_version=string'
+ _jshn_append JSON_UNSET J_V_compat_version
+ local '_a_value=J_V_compat_version'
+ eval 'JSON_UNSET="${JSON_UNSET} $_a_value"'
+ JSON_UNSET=' J_V_metadata_version J_V_compat_version'
+ _jshn_append K_J_V compat_version
+ local '_a_value=compat_version'
+ eval 'K_J_V="${K_J_V} $_a_value"'
+ K_J_V=' metadata_version compat_version'
+ json_add_array supported_devices
+ _json_add_table supported_devices array A
+ local cur seq
+ _json_get_var cur JSON_CUR
+ eval 'cur="$JSON_CUR"'
+ cur=J_V
+ _json_inc JSON_SEQ seq
+ let 'JSON_SEQ += 1' 'seq = JSON_SEQ'
+ local 'table=J_A1'
+ _json_set_var U_J_A1 J_V
+ local '___val=J_V'
+ eval 'U_J_A1="$___val"'
+ U_J_A1=J_V
+ export -- 'K_J_A1='
+ unset S_J_A1
+ _json_set_var JSON_CUR J_A1
+ local '___val=J_A1'
+ eval 'JSON_CUR="$___val"'
+ JSON_CUR=J_A1
+ _jshn_append JSON_UNSET J_A1
+ local '_a_value=J_A1'
+ eval 'JSON_UNSET="${JSON_UNSET} $_a_value"'
+ JSON_UNSET=' J_V_metadata_version J_V_compat_version J_A1'
+ _json_add_generic array supported_devices J_A1 J_V
+ local var
+ '[' J_V '=' J_A ]
+ var=supported_devices
+ '[[' supported_devices '==' supported_devices ]]
+ export -- 'J_V_supported_devices=J_A1' 'T_J_V_supported_devices=array'
+ _jshn_append JSON_UNSET J_V_supported_devices
+ local '_a_value=J_V_supported_devices'
+ eval 'JSON_UNSET="${JSON_UNSET} $_a_value"'
+ JSON_UNSET=' J_V_metadata_version J_V_compat_version J_A1 J_V_supported_devices'
+ _jshn_append K_J_V supported_devices
+ local '_a_value=supported_devices'
+ eval 'K_J_V="${K_J_V} $_a_value"'
+ K_J_V=' metadata_version compat_version supported_devices'
+ json_add_string 0 xiaomi,mi-router-ax3000t-ubootmod
+ local cur
+ _json_get_var cur JSON_CUR
+ eval 'cur="$JSON_CUR"'
+ cur=J_A1
+ _json_add_generic string 0 xiaomi,mi-router-ax3000t-ubootmod J_A1
+ local var
+ '[' J_A '=' J_A ]
+ _json_inc S_J_A1 var
+ let 'S_J_A1 += 1' 'var = S_J_A1'
+ export -- 'J_A1_1=xiaomi,mi-router-ax3000t-ubootmod' 'T_J_A1_1=string'
+ _jshn_append JSON_UNSET J_A1_1
+ local '_a_value=J_A1_1'
+ eval 'JSON_UNSET="${JSON_UNSET} $_a_value"'
+ JSON_UNSET=' J_V_metadata_version J_V_compat_version J_A1 J_V_supported_devices J_A1_1'
+ _jshn_append K_J_A1 1
+ local '_a_value=1'
+ eval 'K_J_A1="${K_J_A1} $_a_value"'
+ K_J_A1=' 1'
+ json_close_array
+ _json_close_table
+ local _s_cur
+ _json_get_var _s_cur JSON_CUR
+ eval '_s_cur="$JSON_CUR"'
+ _s_cur=J_A1
+ _json_get_var JSON_CUR U_J_A1
+ eval 'JSON_CUR="$U_J_A1"'
+ JSON_CUR=J_V
+ json_add_object version
+ _json_add_table version object T
+ local cur seq
+ _json_get_var cur JSON_CUR
+ eval 'cur="$JSON_CUR"'
+ cur=J_V
+ _json_inc JSON_SEQ seq
+ let 'JSON_SEQ += 1' 'seq = JSON_SEQ'
+ local 'table=J_T2'
+ _json_set_var U_J_T2 J_V
+ local '___val=J_V'
+ eval 'U_J_T2="$___val"'
+ U_J_T2=J_V
+ export -- 'K_J_T2='
+ unset S_J_T2
+ _json_set_var JSON_CUR J_T2
+ local '___val=J_T2'
+ eval 'JSON_CUR="$___val"'
+ JSON_CUR=J_T2
+ _jshn_append JSON_UNSET J_T2
+ local '_a_value=J_T2'
+ eval 'JSON_UNSET="${JSON_UNSET} $_a_value"'
+ JSON_UNSET=' J_V_metadata_version J_V_compat_version J_A1 J_V_supported_devices J_A1_1 J_T2'
+ _json_add_generic object version J_T2 J_V
+ local var
+ '[' J_V '=' J_A ]
+ var=version
+ '[[' version '==' version ]]
+ export -- 'J_V_version=J_T2' 'T_J_V_version=object'
+ _jshn_append JSON_UNSET J_V_version
+ local '_a_value=J_V_version'
+ eval 'JSON_UNSET="${JSON_UNSET} $_a_value"'
+ JSON_UNSET=' J_V_metadata_version J_V_compat_version J_A1 J_V_supported_devices J_A1_1 J_T2 J_V_version'
+ _jshn_append K_J_V version
+ local '_a_value=version'
+ eval 'K_J_V="${K_J_V} $_a_value"'
+ K_J_V=' metadata_version compat_version supported_devices version'
+ json_add_string dist OpenWrt
+ local cur
+ _json_get_var cur JSON_CUR
+ eval 'cur="$JSON_CUR"'
+ cur=J_T2
+ _json_add_generic string dist OpenWrt J_T2
+ local var
+ '[' J_T '=' J_A ]
+ var=dist
+ '[[' dist '==' dist ]]
+ export -- 'J_T2_dist=OpenWrt' 'T_J_T2_dist=string'
+ _jshn_append JSON_UNSET J_T2_dist
+ local '_a_value=J_T2_dist'
+ eval 'JSON_UNSET="${JSON_UNSET} $_a_value"'
+ JSON_UNSET=' J_V_metadata_version J_V_compat_version J_A1 J_V_supported_devices J_A1_1 J_T2 J_V_version J_T2_dist'
+ _jshn_append K_J_T2 dist
+ local '_a_value=dist'
+ eval 'K_J_T2="${K_J_T2} $_a_value"'
+ K_J_T2=' dist'
+ json_add_string version SNAPSHOT
+ local cur
+ _json_get_var cur JSON_CUR
+ eval 'cur="$JSON_CUR"'
+ cur=J_T2
+ _json_add_generic string version SNAPSHOT J_T2
+ local var
+ '[' J_T '=' J_A ]
+ var=version
+ '[[' version '==' version ]]
+ export -- 'J_T2_version=SNAPSHOT' 'T_J_T2_version=string'
+ _jshn_append JSON_UNSET J_T2_version
+ local '_a_value=J_T2_version'
+ eval 'JSON_UNSET="${JSON_UNSET} $_a_value"'
+ JSON_UNSET=' J_V_metadata_version J_V_compat_version J_A1 J_V_supported_devices J_A1_1 J_T2 J_V_version J_T2_dist J_T2_version'
+ _jshn_append K_J_T2 version
+ local '_a_value=version'
+ eval 'K_J_T2="${K_J_T2} $_a_value"'
+ K_J_T2=' dist version'
+ json_add_string revision r27052-4e6212e62f
+ local cur
+ _json_get_var cur JSON_CUR
+ eval 'cur="$JSON_CUR"'
+ cur=J_T2
+ _json_add_generic string revision r27052-4e6212e62f J_T2
+ local var
+ '[' J_T '=' J_A ]
+ var=revision
+ '[[' revision '==' revision ]]
+ export -- 'J_T2_revision=r27052-4e6212e62f' 'T_J_T2_revision=string'
+ _jshn_append JSON_UNSET J_T2_revision
+ local '_a_value=J_T2_revision'
+ eval 'JSON_UNSET="${JSON_UNSET} $_a_value"'
+ JSON_UNSET=' J_V_metadata_version J_V_compat_version J_A1 J_V_supported_devices J_A1_1 J_T2 J_V_version J_T2_dist J_T2_version J_T2_revision'
+ _jshn_append K_J_T2 revision
+ local '_a_value=revision'
+ eval 'K_J_T2="${K_J_T2} $_a_value"'
+ K_J_T2=' dist version revision'
+ json_add_string target mediatek/filogic
+ local cur
+ _json_get_var cur JSON_CUR
+ eval 'cur="$JSON_CUR"'
+ cur=J_T2
+ _json_add_generic string target mediatek/filogic J_T2
+ local var
+ '[' J_T '=' J_A ]
+ var=target
+ '[[' target '==' target ]]
+ export -- 'J_T2_target=mediatek/filogic' 'T_J_T2_target=string'
+ _jshn_append JSON_UNSET J_T2_target
+ local '_a_value=J_T2_target'
+ eval 'JSON_UNSET="${JSON_UNSET} $_a_value"'
+ JSON_UNSET=' J_V_metadata_version J_V_compat_version J_A1 J_V_supported_devices J_A1_1 J_T2 J_V_version J_T2_dist J_T2_version J_T2_revision J_T2_target'
+ _jshn_append K_J_T2 target
+ local '_a_value=target'
+ eval 'K_J_T2="${K_J_T2} $_a_value"'
+ K_J_T2=' dist version revision target'
+ json_add_string board xiaomi_mi-router-ax3000t-ubootmod
+ local cur
+ _json_get_var cur JSON_CUR
+ eval 'cur="$JSON_CUR"'
+ cur=J_T2
+ _json_add_generic string board xiaomi_mi-router-ax3000t-ubootmod J_T2
+ local var
+ '[' J_T '=' J_A ]
+ var=board
+ '[[' board '==' board ]]
+ export -- 'J_T2_board=xiaomi_mi-router-ax3000t-ubootmod' 'T_J_T2_board=string'
+ _jshn_append JSON_UNSET J_T2_board
+ local '_a_value=J_T2_board'
+ eval 'JSON_UNSET="${JSON_UNSET} $_a_value"'
+ JSON_UNSET=' J_V_metadata_version J_V_compat_version J_A1 J_V_supported_devices J_A1_1 J_T2 J_V_version J_T2_dist J_T2_version J_T2_revision J_T2_target J_T2_board'
+ _jshn_append K_J_T2 board
+ local '_a_value=board'
+ eval 'K_J_T2="${K_J_T2} $_a_value"'
+ K_J_T2=' dist version revision target board'
+ json_close_object
+ _json_close_table
+ local _s_cur
+ _json_get_var _s_cur JSON_CUR
+ eval '_s_cur="$JSON_CUR"'
+ _s_cur=J_T2
+ _json_get_var JSON_CUR U_J_T2
+ eval 'JSON_CUR="$U_J_T2"'
+ JSON_CUR=J_V
+ cat /tmp/sysinfo/board_name
+ device=xiaomi,mi-router-ax3000t-ubootmod
+ uci -q get 'system.@system[0].compat_version'
+ devicecompat=1.0
+ '[' -n 1.0 ]
+ json_get_var imagecompat compat_version
+ local '__dest=imagecompat'
+ local __cur
+ _json_get_var __cur JSON_CUR
+ eval '__cur="$JSON_CUR"'
+ __cur=J_V
+ local '__var=J_V_compat_version'
+ eval 'export -- "imagecompat=${J_V_compat_version:-}"; [ -n "${J_V_compat_version+x}${3+x}" ]'
+ export -- 'imagecompat=1.0'
+ '[' -n x ]
+ json_get_var compatmessage compat_message
+ local '__dest=compatmessage'
+ local __cur
+ _json_get_var __cur JSON_CUR
+ eval '__cur="$JSON_CUR"'
+ __cur=J_V
+ local '__var=J_V_compat_message'
+ eval 'export -- "compatmessage=${J_V_compat_message:-}"; [ -n "${J_V_compat_message+x}${3+x}" ]'
+ export -- 'compatmessage='
+ '[' -n ]
+ '[' -n 1.0 ]
+ local 'supported=supported_devices'
+ '[' 1.0 '!=' 1.0 ]
+ json_select supported_devices
+ local 'target=supported_devices'
+ local type
+ local cur
+ '[' -z supported_devices ]
+ '[[' supported_devices '==' .. ]]
+ json_get_type type supported_devices
+ local '__dest=type'
+ local __cur
+ _json_get_var __cur JSON_CUR
+ eval '__cur="$JSON_CUR"'
+ __cur=J_V
+ local '__var=T_J_V_supported_devices'
+ eval 'export -- "type=${T_J_V_supported_devices}"; [ -n "${T_J_V_supported_devices+x}" ]'
+ export -- 'type=array'
+ '[' -n x ]
+ json_get_var cur supported_devices
+ local '__dest=cur'
+ local __cur
+ _json_get_var __cur JSON_CUR
+ eval '__cur="$JSON_CUR"'
+ __cur=J_V
+ local '__var=J_V_supported_devices'
+ eval 'export -- "cur=${J_V_supported_devices:-}"; [ -n "${J_V_supported_devices+x}${3+x}" ]'
+ export -- 'cur=J_A1'
+ '[' -n x ]
+ _json_set_var JSON_CUR J_A1
+ local '___val=J_A1'
+ eval 'JSON_CUR="$___val"'
+ JSON_CUR=J_A1
+ json_get_keys dev_keys
+ local '__dest=dev_keys'
+ local _tbl_cur
+ '[' -n ]
+ _json_get_var _tbl_cur JSON_CUR
+ eval '_tbl_cur="$JSON_CUR"'
+ _tbl_cur=J_A1
+ local '__var=K_J_A1'
+ eval 'export -- "dev_keys=${K_J_A1}"; [ -n "${K_J_A1+x}" ]'
+ export -- 'dev_keys= 1'
+ '[' -n x ]
+ json_get_var dev 1
+ local '__dest=dev'
+ local __cur
+ _json_get_var __cur JSON_CUR
+ eval '__cur="$JSON_CUR"'
+ __cur=J_A1
+ local '__var=J_A1_1'
+ eval 'export -- "dev=${J_A1_1:-}"; [ -n "${J_A1_1+x}${3+x}" ]'
+ export -- 'dev=xiaomi,mi-router-ax3000t-ubootmod'
+ '[' -n x ]
+ '[' xiaomi,mi-router-ax3000t-ubootmod '=' xiaomi,mi-router-ax3000t-ubootmod ]
+ '[' 1 '!=' 1 ]
+ '[' 1.0 '!=' 1.0 ]
+ return 0
FWTOOL_DEVICE_MATCH=$?
+ FWTOOL_DEVICE_MATCH=0
[ "$FWTOOL_DEVICE_MATCH" -ne 0 ] && notify_firmware_invalid
+ '[' 0 -ne 0 ]
json_set_namespace validate_firmware_image old_ns
+ json_set_namespace validate_firmware_image old_ns
+ local '_new=validate_firmware_image'
+ local '_old=old_ns'
+ '[' -n old_ns ]
+ _set_var old_ns
+ local '__val='
+ eval 'old_ns="$__val"'
+ old_ns=
+ JSON_PREFIX=validate_firmware_image
json_init
+ json_init
+ json_cleanup
+ local unset tmp
+ _json_get_var unset JSON_UNSET
+ eval 'unset="$validate_firmware_imageJSON_UNSET"'
+ unset=
+ unset validate_firmware_imageU_J_V validate_firmware_imageK_J_V validate_firmware_imageS_J_V validate_firmware_imageT_J_V validate_firmware_imageN_J_V validate_firmware_imageJ_V
+ unset validate_firmware_imageJSON_SEQ validate_firmware_imageJSON_CUR validate_firmware_imageJSON_UNSET
+ export -n 'validate_firmware_imageJSON_SEQ=0'
+ export -- 'validate_firmware_imageJSON_CUR=J_V' 'validate_firmware_imageK_J_V='
json_add_object "tests"
+ json_add_object tests
+ _json_add_table tests object T
+ local cur seq
+ _json_get_var cur JSON_CUR
+ eval 'cur="$validate_firmware_imageJSON_CUR"'
+ cur=J_V
+ _json_inc JSON_SEQ seq
+ let 'validate_firmware_imageJSON_SEQ += 1' 'seq = validate_firmware_imageJSON_SEQ'
+ local 'table=J_T1'
+ _json_set_var U_J_T1 J_V
+ local '___val=J_V'
+ eval 'validate_firmware_imageU_J_T1="$___val"'
+ validate_firmware_imageU_J_T1=J_V
+ export -- 'validate_firmware_imageK_J_T1='
+ unset validate_firmware_imageS_J_T1
+ _json_set_var JSON_CUR J_T1
+ local '___val=J_T1'
+ eval 'validate_firmware_imageJSON_CUR="$___val"'
+ validate_firmware_imageJSON_CUR=J_T1
+ _jshn_append JSON_UNSET J_T1
+ local '_a_value=J_T1'
+ eval 'validate_firmware_imageJSON_UNSET="${validate_firmware_imageJSON_UNSET} $_a_value"'
+ validate_firmware_imageJSON_UNSET=' J_T1'
+ _json_add_generic object tests J_T1 J_V
+ local var
+ '[' J_V '=' J_A ]
+ var=tests
+ '[[' tests '==' tests ]]
+ export -- 'validate_firmware_imageJ_V_tests=J_T1' 'validate_firmware_imageT_J_V_tests=object'
+ _jshn_append JSON_UNSET J_V_tests
+ local '_a_value=J_V_tests'
+ eval 'validate_firmware_imageJSON_UNSET="${validate_firmware_imageJSON_UNSET} $_a_value"'
+ validate_firmware_imageJSON_UNSET=' J_T1 J_V_tests'
+ _jshn_append K_J_V tests
+ local '_a_value=tests'
+ eval 'validate_firmware_imageK_J_V="${validate_firmware_imageK_J_V} $_a_value"'
+ validate_firmware_imageK_J_V=' tests'
json_add_boolean fwtool_signature "$(err_to_bool $FWTOOL_SIGNATURE)"
+ err_to_bool 0
+ '[' 0 -ne 0 ]
+ echo 1
+ json_add_boolean fwtool_signature 1
+ local cur
+ _json_get_var cur JSON_CUR
+ eval 'cur="$validate_firmware_imageJSON_CUR"'
+ cur=J_T1
+ _json_add_generic boolean fwtool_signature 1 J_T1
+ local var
+ '[' J_T '=' J_A ]
+ var=fwtool_signature
+ '[[' fwtool_signature '==' fwtool_signature ]]
+ export -- 'validate_firmware_imageJ_T1_fwtool_signature=1' 'validate_firmware_imageT_J_T1_fwtool_signature=boolean'
+ _jshn_append JSON_UNSET J_T1_fwtool_signature
+ local '_a_value=J_T1_fwtool_signature'
+ eval 'validate_firmware_imageJSON_UNSET="${validate_firmware_imageJSON_UNSET} $_a_value"'
+ validate_firmware_imageJSON_UNSET=' J_T1 J_V_tests J_T1_fwtool_signature'
+ _jshn_append K_J_T1 fwtool_signature
+ local '_a_value=fwtool_signature'
+ eval 'validate_firmware_imageK_J_T1="${validate_firmware_imageK_J_T1} $_a_value"'
+ validate_firmware_imageK_J_T1=' fwtool_signature'
json_add_boolean fwtool_device_match "$(err_to_bool $FWTOOL_DEVICE_MATCH)"
+ err_to_bool 0
+ '[' 0 -ne 0 ]
+ echo 1
+ json_add_boolean fwtool_device_match 1
+ local cur
+ _json_get_var cur JSON_CUR
+ eval 'cur="$validate_firmware_imageJSON_CUR"'
+ cur=J_T1
+ _json_add_generic boolean fwtool_device_match 1 J_T1
+ local var
+ '[' J_T '=' J_A ]
+ var=fwtool_device_match
+ '[[' fwtool_device_match '==' fwtool_device_match ]]
+ export -- 'validate_firmware_imageJ_T1_fwtool_device_match=1' 'validate_firmware_imageT_J_T1_fwtool_device_match=boolean'
+ _jshn_append JSON_UNSET J_T1_fwtool_device_match
+ local '_a_value=J_T1_fwtool_device_match'
+ eval 'validate_firmware_imageJSON_UNSET="${validate_firmware_imageJSON_UNSET} $_a_value"'
+ validate_firmware_imageJSON_UNSET=' J_T1 J_V_tests J_T1_fwtool_signature J_T1_fwtool_device_match'
+ _jshn_append K_J_T1 fwtool_device_match
+ local '_a_value=fwtool_device_match'
+ eval 'validate_firmware_imageK_J_T1="${validate_firmware_imageK_J_T1} $_a_value"'
+ validate_firmware_imageK_J_T1=' fwtool_signature fwtool_device_match'
# Call platform_check_image() here so it can add its test
# results and still mark image properly.
json_set_namespace $old_ns
+ json_set_namespace
+ local '_new='
+ local '_old='
+ '[' -n ]
+ JSON_PREFIX=
platform_check_image "$1" >&2 || notify_firmware_invalid
+ platform_check_image /tmp/firmware.bin
+ board_name
+ '[' -e /tmp/sysinfo/board_name ]
+ cat /tmp/sysinfo/board_name
+ local 'board=xiaomi,mi-router-ax3000t-ubootmod'
+ get_magic_long /tmp/firmware.bin
+ local 'magic=d00dfeed'
+ '[' 1 -gt 1 ]
+ nand_do_platform_check xiaomi,mi-router-ax3000t-ubootmod /tmp/firmware.bin
+ local 'board_name=xiaomi,mi-router-ax3000t-ubootmod'
+ local 'file=/tmp/firmware.bin'
+ identify_if_gzip /tmp/firmware.bin
+ identify /tmp/firmware.bin cat
+ nand_get_magic_long /tmp/firmware.bin cat
+ identify_magic_long d00dfeed
+ local 'magic=d00dfeed'
+ echo fit
+ '[' fit '=' gzip ]
+ local 'cmd=cat'
+ identify /tmp/firmware.bin cat
+ nand_get_magic_long /tmp/firmware.bin cat
+ identify_magic_long d00dfeed
+ local 'magic=d00dfeed'
+ echo fit
+ local 'file_type=fit'
+ local 'control_length=0'
+ '[' 0 '=' 0 ]
+ control_length=0
+ '[' 0 '!=' 0 ]
+ nand_verify_if_gzip_file /tmp/firmware.bin cat
+ local 'file=/tmp/firmware.bin'
+ local 'cmd=cat'
+ '[' cat '=' zcat ]
+ '[' fit '!=' fit -a fit '!=' ubi -a fit '!=' ubifs ]
+ return 0
+ return 0
json_set_namespace validate_firmware_image old_ns
+ json_set_namespace validate_firmware_image old_ns
+ local '_new=validate_firmware_image'
+ local '_old=old_ns'
+ '[' -n old_ns ]
+ _set_var old_ns
+ local '__val='
+ eval 'old_ns="$__val"'
+ old_ns=
+ JSON_PREFIX=validate_firmware_image
json_close_object
+ json_close_object
+ _json_close_table
+ local _s_cur
+ _json_get_var _s_cur JSON_CUR
+ eval '_s_cur="$validate_firmware_imageJSON_CUR"'
+ _s_cur=J_T1
+ _json_get_var validate_firmware_imageJSON_CUR U_J_T1
+ eval 'validate_firmware_imageJSON_CUR="$validate_firmware_imageU_J_T1"'
+ validate_firmware_imageJSON_CUR=J_V
json_add_boolean valid "$VALID"
+ json_add_boolean valid 1
+ local cur
+ _json_get_var cur JSON_CUR
+ eval 'cur="$validate_firmware_imageJSON_CUR"'
+ cur=J_V
+ _json_add_generic boolean valid 1 J_V
+ local var
+ '[' J_V '=' J_A ]
+ var=valid
+ '[[' valid '==' valid ]]
+ export -- 'validate_firmware_imageJ_V_valid=1' 'validate_firmware_imageT_J_V_valid=boolean'
+ _jshn_append JSON_UNSET J_V_valid
+ local '_a_value=J_V_valid'
+ eval 'validate_firmware_imageJSON_UNSET="${validate_firmware_imageJSON_UNSET} $_a_value"'
+ validate_firmware_imageJSON_UNSET=' J_T1 J_V_tests J_T1_fwtool_signature J_T1_fwtool_device_match J_V_valid'
+ _jshn_append K_J_V valid
+ local '_a_value=valid'
+ eval 'validate_firmware_imageK_J_V="${validate_firmware_imageK_J_V} $_a_value"'
+ validate_firmware_imageK_J_V=' tests valid'
json_add_boolean forceable "$FORCEABLE"
+ json_add_boolean forceable 1
+ local cur
+ _json_get_var cur JSON_CUR
+ eval 'cur="$validate_firmware_imageJSON_CUR"'
+ cur=J_V
+ _json_add_generic boolean forceable 1 J_V
+ local var
+ '[' J_V '=' J_A ]
+ var=forceable
+ '[[' forceable '==' forceable ]]
+ export -- 'validate_firmware_imageJ_V_forceable=1' 'validate_firmware_imageT_J_V_forceable=boolean'
+ _jshn_append JSON_UNSET J_V_forceable
+ local '_a_value=J_V_forceable'
+ eval 'validate_firmware_imageJSON_UNSET="${validate_firmware_imageJSON_UNSET} $_a_value"'
+ validate_firmware_imageJSON_UNSET=' J_T1 J_V_tests J_T1_fwtool_signature J_T1_fwtool_device_match J_V_valid J_V_forceable'
+ _jshn_append K_J_V forceable
+ local '_a_value=forceable'
+ eval 'validate_firmware_imageK_J_V="${validate_firmware_imageK_J_V} $_a_value"'
+ validate_firmware_imageK_J_V=' tests valid forceable'
json_add_boolean allow_backup "$ALLOW_BACKUP"
+ json_add_boolean allow_backup 1
+ local cur
+ _json_get_var cur JSON_CUR
+ eval 'cur="$validate_firmware_imageJSON_CUR"'
+ cur=J_V
+ _json_add_generic boolean allow_backup 1 J_V
+ local var
+ '[' J_V '=' J_A ]
+ var=allow_backup
+ '[[' allow_backup '==' allow_backup ]]
+ export -- 'validate_firmware_imageJ_V_allow_backup=1' 'validate_firmware_imageT_J_V_allow_backup=boolean'
+ _jshn_append JSON_UNSET J_V_allow_backup
+ local '_a_value=J_V_allow_backup'
+ eval 'validate_firmware_imageJSON_UNSET="${validate_firmware_imageJSON_UNSET} $_a_value"'
+ validate_firmware_imageJSON_UNSET=' J_T1 J_V_tests J_T1_fwtool_signature J_T1_fwtool_device_match J_V_valid J_V_forceable J_V_allow_backup'
+ _jshn_append K_J_V allow_backup
+ local '_a_value=allow_backup'
+ eval 'validate_firmware_imageK_J_V="${validate_firmware_imageK_J_V} $_a_value"'
+ validate_firmware_imageK_J_V=' tests valid forceable allow_backup'
json_dump -i
+ json_dump -i
+ jshn -i -p validate_firmware_image -w
{
"tests": {
"fwtool_signature": true,
"fwtool_device_match": true
},
"valid": true,
"forceable": true,
"allow_backup": true
}
json_set_namespace $old_ns
+ json_set_namespace
+ local '_new='
+ local '_old='
+ '[' -n ]
+ JSON_PREFIX=
I'm stumped at this point, that all looks fine and looks like it's running to completion.
And I can confirm it indeed upgraded well! Used the new --rev-code for forcing the download:
Build completed in 2 seconds.
version_number = SNAPSHOT
version_code = r27052-4e6212e62f (requested r27052-4e6212e62f)
rootfs_size_mb = default
init-script = no-init-script
And then:
Image source: ---omited---
Image saved : /tmp/firmware.bin
Manifest : /tmp/firmware-manifest.json
Verifying : /tmp/firmware.bin (12227399 bytes) against /tmp/firmware.sha256sums
Saved sha256 matches
(null)
Checks complete, image is valid.
root@AX3000T_Router:~# owut install
Verifying : /tmp/firmware.bin (12227399 bytes) against /tmp/firmware.sha256sums
Saved sha256 matches
(null)
Checks complete, image is valid.
Installing /tmp/firmware.bin and rebooting...
root@AX3000T_Router:~#
And now for the funny thing:
BusyBox v1.36.1 (2024-08-03 15:27:05 UTC) built-in shell (ash)
_______ ________ __
| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
-----------------------------------------------------
OpenWrt SNAPSHOT, r27075-d8f64fe168
-----------------------------------------------------
root@AX3000T_Router:~#
It updated to the version it said it couldn`t download (error 500)... But it happened with no problems, my router is running well!
...
Yeah, that's what I'm seeing, too... Something busted hard on the ASU server.
Can confirm this as well -- I was just about to abandon the attempt since upgrading to the same version didn't seem like a very useful action, but saw this, upgraded anyway, and on reboot was greeted with OpenWrt SNAPSHOT, r27076-d604b2699b
even though ASU told me it had downloaded r27052-4e6212e62f
I tried owut download
just now and caught the following error.
Collected errors:
* opkg_download: Failed to download https://downloads.openwrt.org/snapshots/targets/mediatek/filogic/kmods/6.6.44-1-9908cd15c70057bce9095048adfcf521/kmod-crypto-lib-chacha20_6.6.44-r1_aarch64_cortex-a53.ipk, wget returned 4.
* opkg_download: Check your network settings and connectivity.
* opkg_install_pkg: Failed to download kmod-crypto-lib-chacha20. Perhaps you need to run 'opkg update'?
* opkg_install_cmd: Cannot install package luci-proto-wireguard.
make[2]: *** [Makefile:220: package_install] Error 255
make[1]: *** [Makefile:151: _call_image] Error 2
make: *** [Makefile:310: image] Error 2
ERROR: Build failed with status 500
The above errors are often due to the upgrade server lagging behind the
build server, first suggestion is to wait a while and try again.
However I am able to download kmod-crypto-lib-chacha20
.
root@OpenWrt:~# opkg download kmod-crypto-lib-chacha20
Downloading https://downloads.openwrt.org/snapshots/targets/mediatek/filogic/kmods/6.6.38-1-f492dffe00c0a7786964bab6d7e76015/kmod-crypto-lib-chacha20_6.6.38-r1_aarch64_cortex-a53.ipk
Downloaded kmod-crypto-lib-chacha20 as ./kmod-crypto-lib-chacha20_6.6.38-r1_aarch64_cortex-a53.ipk.
Collected errors:
* pkg_hash_check_unresolved: cannot find dependency kernel (= 6.6.44~9908cd15c70057bce9095048adfcf521-r1) for kmod-crypto-lib-chacha20
root@OpenWrt:~# ls -la
drwxr-x--- 1 root root 3488 Aug 10 16:56 .
drwxr-xr-x 1 root root 3488 Jan 1 1970 ..
-rw-r--r-- 1 root root 5975 Aug 10 16:56 kmod-crypto-lib-chacha20_6.6.38-r1_aarch64_cortex-a53.ipk
I have waited 1hr and tried again but still got the same error.
I've just been going through the same scenario, but substitute x86
for the platform and luci-app-adblock
for the package. Same error, same messages...
It looks like the imagebuilder on the ASU server can't see the package feeds or something, but that's just a guess at this point. I will keep investigating and let you know what I find.
EDIT
Yeah, must be the ASU server as I just did a test on the imagebuilder, which worked for me.
On the router, where the owut
build request failed, I grabbed the pertinent build command parameters:
$ jsonfilter -i /tmp/firmware-manifest.json -e '$.build_cmd'
[ "make", "image", "PROFILE=generic", "PACKAGES=-ca-bundle ...
On my main Linux workstation, replicate what ASU server does:
$ wget https://downloads.openwrt.org/snapshots/targets/x86/64/openwrt-imagebuilder-x86-64.Linux-x86_64.tar.zst
$ tar --zstd -x -f openwrt-imagebuilder-x86-64.Linux-x86_64.tar.zst
$ cd openwrt-imagebuilder-x86-64.Linux-x86_64/
$ make info
...
Current Revision: "r27107-44b6df3184" <<< as expected
...
# Then cut out stuff from that jsonfilter output on the router:
make image PROFILE=generic ROOTFS_PARTSIZE=512 PACKAGES="-ca-bundle -dnsmasq -e2fsprogs -firewall4 -fstools -kmod-dwmac-intel -kmod-nft-offload -libc -libgcc -libustream-mbedtls -netifd -nftables -opkg -uclient-fetch addrwatch base-files bind-dig blkid busybox collectd-mod-thermal conntrack diffutils dmidecode dnsmasq-full dropbear ethtool fdisk grub2 grub2-bios-setup grub2-efi htop iperf3 iputils-tracepath kmod-amazon-ena kmod-amd-xgbe kmod-bnx2 kmod-button-hotplug kmod-e1000 kmod-e1000e kmod-forcedeth kmod-fs-vfat kmod-hid kmod-hwmon-coretemp kmod-hwmon-drivetemp kmod-igb kmod-igc kmod-ixgbe kmod-nfnetlink-queue kmod-r8169 kmod-tg3 kmod-usb-hid logd losetup lsblk lscpu lsof luci luci-app-adblock luci-app-attendedsysupgrade luci-app-sqm luci-app-statistics luci-ssl luci-theme-openwrt-2020 mkf2fs mtd nmap odhcp6c odhcpd-ipv6only openssh-sftp-server parted partx-utils pciutils ppp ppp-mod-pppoe procd procd-seccomp procd-ujail resize2fs smartmontools ss strace tcpdump uci urandom-seed urngd usbutils vim-full"
... successful build ...
$ ll bin/targets/x86/64/
Permissions Size User Date Modified Name
drwxr-xr-x@ - efahlgren 2024-08-10 05:57 .
drwxr-xr-x@ - efahlgren 2024-08-10 05:54 ..
.rw-r--r--@ 28M efahlgren 2024-08-10 05:57 openwrt-x86-64-generic-ext4-combined-efi.img.gz
.rw-r--r--@ 28M efahlgren 2024-08-10 05:56 openwrt-x86-64-generic-ext4-combined.img.gz
.rw-r--r--@ 20M efahlgren 2024-08-10 05:56 openwrt-x86-64-generic-ext4-rootfs.img.gz
.rw-r--r--@ 7.0M efahlgren 2024-08-10 05:56 openwrt-x86-64-generic-kernel.bin
.rw-r--r--@ 20M efahlgren 2024-08-10 05:56 openwrt-x86-64-generic-rootfs.tar.gz
.rw-r--r--@ 24M efahlgren 2024-08-10 05:56 openwrt-x86-64-generic-squashfs-combined-efi.img.gz
.rw-r--r--@ 24M efahlgren 2024-08-10 05:56 openwrt-x86-64-generic-squashfs-combined.img.gz
.rw-r--r--@ 17M efahlgren 2024-08-10 05:56 openwrt-x86-64-generic-squashfs-rootfs.img.gz
.rw-r--r--@ 33k efahlgren 2024-08-10 05:57 openwrt-x86-64-generic.bom.cdx.json
.rw-r--r--@ 7.2k efahlgren 2024-08-10 05:57 openwrt-x86-64-generic.manifest
.rw-r--r--@ 2.5k efahlgren 2024-08-10 05:57 profiles.json
.rw-r--r--@ 1.2k efahlgren 2024-08-10 05:57 sha256sums
cc: @aparcar
It occurs to me that maybe this may be another CDN issue. Just like you, I can download the "missing" files just fine, but possibly the mirror that is being used by the sysupgrade.openwrt.org
server has a cache mismatch.
* opkg_download: Failed to download https://downloads.openwrt.org/snapshots/packages/x86_64/luci/luci-app-adblock_24.222.54969~257cfac_all.ipk, wget returned 4.
Ok, here's a workaround that might work (it's a variant of the Firmware Selector trick of putting a different uci-defaults value to in to create a different hash key for the image build).
$ echo "# $(date -Is)" | owut download --init-script -
... requests a build with an init-script containing "# 2024-08-..."
(The --init-script -
reads the script from stdin, which the echo provides.)
I ran this on my x86 build and it worked, bypassing the previously cached request that gave the "package download failed" error message.
I can confirm that this workaround works. Thank you very much!
Regarding this workaround, I could think of a feature request for a flag like --force-rebuild
that will append this init script automatically to force new image build. What do you think about it?
Yeah, I've thought about that, but I don't want to institutionalize a workaround for what is really a bug on the ASU server end, I'd rather continue working on fixing up the server and making it work for all clients.
Once we've got the server end cleaned up, then we can go through all the clients and update them to be consistent, and use best practices regarding versions, revisions, package lists (with or without versions?) and so on. It's ongoing and it may seem like it's not moving, but things are happening in the background.
Tested and working fine on my Mercusys mr90x