On 07/02/2017 04:05 PM, Hauke Mehrtens wrote:
> Hi,
> 
> I just tried to run sysupgrade on a WRT53GS (brcm47xx) device and it
> failed. I am running LEDE r4504.
> 
> Hauke

Hmm, the "Could not get image magic" and "Image check failed." message are
from mtd itself. What exactly does mtd check here?

You could apply the attached patch to get some more debug output.

Matthias



> 
> 
> root@LEDE:/tmp# wget
> http://192.168.1.195/hauke-web/lede/targets/brcm47xx/legacy
> /lede-brcm47xx-legacy-linksys-wrt54gs-squashfs.bin
> Downloading
> 'http://192.168.1.195/hauke-web/lede/targets/brcm47xx/legacy/lede-brcm47xx-legacy-linksys-wrt54gs-squashfs.bin'
> Connecting to 192.168.1.195:80
> Writing to 'lede-brcm47xx-legacy-linksys-wrt54gs-squashfs.bin'
> lede-brcm47xx-legacy 100% |*******************************|  3588k
> 0:00:00 ETA
> Download completed (3674144 bytes)
> root@LEDE:/tmp# sysupgrade
> lede-brcm47xx-legacy-linksys-wrt54gs-squashfs.bin
> Image metadata not found
> Found CyberTAN image with device pattern: W54S
> Found a valid TRX version 1
> Saving config files...
> Commencing upgrade. All shell sessions will be closed now.
> Watchdog handover: fd=3
> - watchdog -
> killall: telnetd: no process killed
> Sending TERM to remaining processes ... ubusd logd netifd odhcpd ntpd
> dnsmasq
> Sending KILL to remaining processes ...
> Switching to ramdisk...
> Performing system upgrade...
> Could not get image magic
> Image check failed.
> Upgrade completed
> Rebooting system...
> umount: can't unmount /dev: Resource busy
> umount: can't unmount /tmp: Resource busy
> [  469.312242] reboot: Restarting system
> [  469.316208] bcm47xx: Please stand by while rebooting the system...
> 
> 
> CFE version 1.0.37 for BCM947XX (32bit,SP,LE)
> Build Date: Fri Jun 25 15:49:22 CST 2004 (root@Amin)
> Copyright (C) 2000,2001,2002,2003 Broadcom Corporation.
> 

diff --git a/package/base-files/files/lib/upgrade/stage2 b/package/base-files/files/lib/upgrade/stage2
index bdbb892664..2bdd165ac6 100755
--- a/package/base-files/files/lib/upgrade/stage2
+++ b/package/base-files/files/lib/upgrade/stage2
@@ -133,6 +133,9 @@ kill_remaining KILL 1
 sleep 1
 
 
+set -x
+
+
 if [ -n "$IMAGE" ] && type 'platform_pre_upgrade' >/dev/null 2>/dev/null; then
 	IS_PRE_UPGRADE=1 platform_pre_upgrade "$IMAGE"
 
@@ -146,4 +149,4 @@ if [ -n "$(rootfs_type)" ]; then
 fi
 
 # Exec new shell from ramfs
-exec /bin/busybox ash -c "$COMMAND"
+exec /bin/busybox ash -xc "$COMMAND"

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev

Reply via email to