[From nobody Thu Jun 25 05:55:36 2020
Received: from mr85p00im-ztdg06021701.me.com ([17.58.23.196])
 by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux))
 id 1imD7C-0008Aq-H0
 for openwrt-devel@lists.openwrt.org; Tue, 31 Dec 2019 08:43:00 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai;
 t=1577781776; bh=pq36zPS8+OPhapo2Hlrb2w2jin88G8n1RzUxpEMaGow=;
 h=Content-Type:Subject:From:Date:Message-Id:To;
 b=uNy1dyUvFcC1hagL7didsvTNGmoxpfeeikITObhW9fSlnNPXthPt+GJcKcUf8Q1oy
 c+T7sE7nZ7att2GlKcCVkQPEZ0PGAIbUAsYUnOlNWPSfoJSRxDZa3y6XJMou3TDkCk
 9AmE83KrFQwQfvxswaHwnb5TC/GN0Q7UvyFVPFy2OZt9zI4w53HVnttaIimn5Qq5rD
 DJjDHPCBFVS7sdO2fTXis3YrDy4tkBcS4EPAC45ldO1FuSDVr0MPSZQiG4NtU/dxyF
 tVrz+xf/hVxiqNeW2NVkP5pZI6cDiRNDk68oUJmUVU1ZrvPR/rQoFodK0RS1d4W5hu
 rXO5U8gfZKzFw==
Received: from mbp-2.lan (89-24-43-124.nat.epc.tmcz.cz [89.24.43.124])
 by mr85p00im-ztdg06021701.me.com (Postfix) with ESMTPSA id D0BCBA00B4A;
 Tue, 31 Dec 2019 08:42:55 +0000 (UTC)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.40.2.2.4\))
Subject: Re: [OpenWrt-Devel] Sysupgrade possibly broken in recent development
 snapshots: &quot;message&quot;: &quot;Firmware image couldn't be validated&quot;
From: =?utf-8?Q?Petr_Nov=C3=A1k?= &lt;petrn@me.com&gt;
In-Reply-To: &lt;20191230225631.GJ70184@meh.true.cz&gt;
Date: Tue, 31 Dec 2019 09:42:53 +0100
Cc: Hannu Nyman &lt;hannu.nyman@welho.com&gt;,
 openwrt-devel@lists.openwrt.org
Content-Transfer-Encoding: quoted-printable
Message-Id: &lt;D18390C9-BACD-441C-BC1F-41CD9B01634E@me.com&gt;
References: &lt;mailman.21094.1577616584.2486.openwrt-devel@lists.openwrt.org&gt;
 &lt;20191229222123.GH70184@meh.true.cz&gt; &lt;20191230190746.GI70184@meh.true.cz&gt;
 &lt;357266D6-1E26-4066-AFE5-746C2407B0DF@me.com&gt;
 &lt;20191230225631.GJ70184@meh.true.cz&gt;
To: =?utf-8?Q?Petr_=C5=A0tetiar?= &lt;ynezz@true.cz&gt;
X-Mailer: Apple Mail (2.3608.40.2.2.4)
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, ,
 definitions=2019-12-31_02:, , signatures=0
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0
 malwarescore=0
 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 mlxscore=0
 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx
 scancount=1 engine=8.0.1-1908290000 definitions=main-1912310073
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 
X-CRM114-CacheID: sfid-20191231_004258_589892_07A077AC 
X-CRM114-Status: UNSURE (   9.64  )
X-CRM114-Notice: Please train this message.
X-Spam-Score: -0.9 (/)
X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary:
 Content analysis details:   (-0.9 points)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at https://www.dnswl.org/,
 low trust [17.58.23.196 listed in list.dnswl.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (petrn[at]me.com)
 -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
 -0.1 DKIM_VALID_AU          Message has a valid DKIM or DK signature from
 author's domain
 -0.1 DKIM_VALID_EF          Message has a valid DKIM or DK signature from
 envelope-from domain
 0.1 DKIM_SIGNED            Message has a DKIM or DK signature, not necessarily
 valid

here is the output from the sysupgrade with the additional change and =
ubus monitor as suggested. This is tested with the development snapshot =
from the 30th of December: r11832-c48b571ad7


root@OpenWrt:~# sysupgrade -v =
https://downloads.openwrt.org/snapshots/targets/brcm2708/bcm2711/openwrt-b=
rcm2708-bcm2711-rpi-4-ext4-sysupgrade.img.gz
wget: SSL support not available, please install one of the =
libustream-.*[ssl|tls] packages as well as the ca-bundle and =
ca-certificates packages.
Image metadata not found
Use sysupgrade -F to override this check when downgrading or flashing to =
vendor firmware
Reading partition table from bootdisk...
Reading partition table from image...
Invalid partition table on /tmp/image.bs
Failed to parse message data
sh: out of range
Saving config files...
boot/config.txt
etc/config/dhcp
etc/config/dropbear
etc/config/firewall
etc/config/network
etc/config/system
etc/config/wireless
etc/dropbear/dropbear_rsa_host_key
etc/group
etc/hosts
etc/inittab
etc/opkg/keys/0b26f36ae0f4106d
etc/opkg/keys/1035ac73cc4e59e3
etc/opkg/keys/5151f69420c3f508
etc/opkg/keys/72a57f2191b211e0
etc/opkg/keys/792d9d9b39f180dc
etc/opkg/keys/9ef4694208102c43
etc/opkg/keys/b2d571e0880ff617
etc/opkg/keys/b5043e70f9a75cde
etc/opkg/keys/c10b9afab19ee428
etc/opkg/keys/dace9d4df16896bf
etc/opkg/keys/dd6de0d06bbd3d85
etc/opkg/keys/f94b9dd6febac963
etc/passwd
etc/profile
etc/rc.local
etc/shadow
etc/shells
etc/sysctl.conf
Commencing upgrade. Closing all shell sessions.
-&gt; e8d7994a #e8d7994a          hello: {}
&lt;- e8d7994a #00000000         lookup: {&quot;objpath&quot;:&quot;system&quot;}
-&gt; e8d7994a #00000000           data: =
{&quot;objpath&quot;:&quot;system&quot;,&quot;objid&quot;:619517119,&quot;objtype&quot;:1675602203,&quot;signature&quot;:{&quot;b=
oard&quot;:{},&quot;info&quot;:{},&quot;reboot&quot;:{},&quot;watchdog&quot;:{&quot;frequency&quot;:5,&quot;timeout&quot;:5,&quot;magi=
cclose&quot;:7,&quot;stop&quot;:7},&quot;signal&quot;:{&quot;pid&quot;:5,&quot;signum&quot;:5},&quot;validate_firmware_image=
&quot;:{&quot;path&quot;:3},&quot;sysupgrade&quot;:{&quot;path&quot;:3,&quot;force&quot;:7,&quot;backup&quot;:3,&quot;prefix&quot;:3,&quot;comma=
nd&quot;:3,&quot;options&quot;:2}}}
-&gt; e8d7994a #00000000         status: {&quot;status&quot;:0}
&lt;- e8d7994a #24ed14bf         invoke: =
{&quot;objid&quot;:619517119,&quot;method&quot;:&quot;sysupgrade&quot;,&quot;data&quot;:{&quot;prefix&quot;:&quot;/tmp/root&quot;,&quot;pat=
h&quot;:&quot;/tmp/sysupgrade.img&quot;,&quot;backup&quot;:&quot;/tmp/sysupgrade.tgz&quot;,&quot;command&quot;:&quot;/lib/up=
grade/do_stage2&quot;,&quot;options&quot;:{&quot;save_partitions&quot;:1}}}
-&gt; 35669f7b #e8d7994a         invoke: =
{&quot;objid&quot;:619517119,&quot;method&quot;:&quot;sysupgrade&quot;,&quot;data&quot;:{&quot;prefix&quot;:&quot;/tmp/root&quot;,&quot;pat=
h&quot;:&quot;/tmp/sysupgrade.img&quot;,&quot;backup&quot;:&quot;/tmp/sysupgrade.tgz&quot;,&quot;command&quot;:&quot;/lib/up=
grade/do_stage2&quot;,&quot;options&quot;:{&quot;save_partitions&quot;:1}},&quot;user&quot;:&quot;root&quot;,&quot;group&quot;:&quot;r=
oot&quot;}
&lt;- 35669f7b #e8d7994a           data: =
{&quot;objid&quot;:619517119,&quot;data&quot;:{&quot;error&quot;:{&quot;message&quot;:&quot;Firmware image couldn't =
be validated&quot;}}}
{
	&quot;error&quot;: {
		&quot;message&quot;: &quot;Firmware image couldn't be validated&quot;
	}
}
-&gt; e8d7994a #24ed14bf           data: =
{&quot;objid&quot;:619517119,&quot;data&quot;:{&quot;error&quot;:{&quot;message&quot;:&quot;Firmware image couldn't =
be validated&quot;}}}
Command failed: Unknown error
&lt;- 35669f7b #e8d7994a         status: {&quot;status&quot;:9,&quot;objid&quot;:619517119}
-&gt; e8d7994a #24ed14bf         status: {&quot;status&quot;:9,&quot;objid&quot;:619517119}
root@OpenWrt:~#


&gt; On 30 Dec 2019, at 23:56, Petr =C5=A0tetiar &lt;ynezz@true.cz&gt; wrote:
&gt;=20
&gt; Petr Nov=C3=A1k &lt;petrn@me.com&gt; [2019-12-30 20:43:36]:
&gt;=20
&gt; Hi,
&gt;=20
&gt;&gt; I will do my best to reproduce the issue giving more details, I will =
post
&gt;&gt; any more details here tomorrow.
&gt;=20
&gt; if I may, can you do following for the start:
&gt;=20
&gt; 1. add following change (changing it directly on device right before =
step 2.
&gt;   should be enough):
&gt;=20
&gt; diff --git =
a/package/base-files/files/usr/libexec/validate_firmware_image
&gt; b/package/base-files/files/usr/libexec/validate_firmware_image
&gt; index f85fb9e4b435..aed9cdfd64b5 100755
&gt; --- a/package/base-files/files/usr/libexec/validate_firmware_image
&gt; +++ b/package/base-files/files/usr/libexec/validate_firmware_image
&gt; @@ -62,5 +62,6 @@ json_init
&gt;         json_add_boolean valid &quot;$VALID&quot;
&gt;         json_add_boolean forceable &quot;$FORCEABLE&quot;
&gt;         json_add_boolean allow_backup &quot;$ALLOW_BACKUP&quot;
&gt; +json_dump -i &gt;&amp;2
&gt;  json_dump -i
&gt;  json_set_namespace $old_ns
&gt;=20
&gt; 2. run:
&gt;=20
&gt; $ ubus monitor &amp;
&gt; $ sysupgrade -v =
openwrt-brcm2708-bcm2711-rpi-4-squashfs-sysupgrade.img.gz
&gt;=20
&gt; and send the output, thanks!
&gt;=20
&gt; -- ynezz


]