[FS#3304] MVEBU - sysupgrade may not correctly detect device from bootcmd

OpenWrt Bugs openwrt-bugs at lists.openwrt.org
Fri Oct 29 11:22:18 PDT 2021


THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.

The following task has a new comment added:

FS#3304 - MVEBU - sysupgrade may not correctly detect device from bootcmd
User who did this - M95D (M95D)

----------
I found this error too. The sysupgrade overwrote the current booted kernel (and failed trying to overwrite the rest of the partition) instead of the alternate partition.

The bug can be reproduced like this:
1) Connect to serial console.
2) Boot from the first partition (working firmware - you want to keep this).
3) Use sysupgrade to write a test image to the alternate partition (the second one). OpenWrt automatically restarts and Uboot will boot that partition. Let's assume it's a failed test - you prepare another test image.
4) Reboot to first partition (working) to write the new test firmware. To skip the somewhat complicated "fw_setenv boot_part 1" and "reboot" (maybe the router won't even boot), simply reset and "run nandboot" from the bootloader to boot from the fist partition.
5) Try to sysupgrade another test image. At this point, sysupgrade will overwrite the fist partition kernel (the working kernel) and fail trying to overwrite the squashfs, instead of writing to the second partition.
At this point no partition is working. Device is bricked.

root at GRAPHRT:~# sysupgrade -n -v openwrt-snapshot-r17857-269bdf6eef-mvebu-cortex
a9-linksys_wrt1900ac-v1-squashfs-sysupgrade.bin
Sat Oct 23 20:59:22 EEST 2021 upgrade: Image not in /tmp, copying...
Sat Oct 23 20:59:23 EEST 2021 upgrade: Commencing upgrade. Closing all shell sessions.
Watchdog handover: fd=3
- watchdog -
killall: telnetd: no process killed
Sat Oct 23 20:59:24 EEST 2021 upgrade: Sending TERM to remaining processes ... ubusd urngd logd rpcd hostapd wpa_supplicant netifd crond pptpd upsd blockd mosquitto upsmon upsmon uhttpd dnsmasq ntpd
Sat Oct 23 20:59:27 EEST 2021 upgrade: Sending KILL to remaining processes ...
Sat Oct 23 20:59:29 EEST 2021 upgrade: Switching to ramdisk...
Sat Oct 23 17:59:31 UTC 2021 upgrade: Performing system upgrade...
Unlocking kernel1 ...

Writing from  to kernel1 ...
cannot find ubi mtd partition rootfs1
libubi: error!: "/dev/" is not a character device
ubiupdatevol: error!: error w[   93.985373] UBIFS (ubi1:0): un-mount UBI device 1
hile probing "/d[   93.991263] UBIFS (ubi1:0): background thread "ubifs_bgt1_0" stops
ev/"
              error 22 (Invalid argument)
tar: write error: Broken pipe
sysupgrade successful
umount: can't unmount /dev: Resource busy
umount: can't [   94.011251] reboot: Restarting system

(Text above contains kernel messages written over console messages. That's how it appears on serial console.)
----------

More information can be found at the following URL:
https://bugs.openwrt.org/index.php?do=details&task_id=3304#comment10250

You are receiving this message because you have requested it from the Flyspray bugtracking system.  If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.



More information about the openwrt-bugs mailing list