Debugging sysupgrade for Linksys WRT1200AC v1

Hi there,

I've built snapshots r5115-184c92e and r5935-c25d9cb from source for the Linksys WRT1200AC v1, however sysupgrades do not work and just reset the overlay filesystems.
This means that in order to upgrade, I have to manually flash the WRT1200AC over TFTP which in turn requires me to physically access the device.

How can I can see the sysupgrade output without getting my terminal session killed? I also log to a network location, but as all processes are terminated during upgrade, so is logging.

This is the configuration of the most recent image:

Any help in this matter is greatly appreciated.

Best Regards,

What is the current/existing release version that you are sysupgrading from?

(If I remember right, there are certain older versions that you could not sysupgrade from)

I want to upgrade from those exact snapshots to anything else, e.g stock LEDE / OpenWRT.
This is what the release file shows:
root@ap-wrt1200ac-10:~# cat /etc/openwrt_release
DISTRIB_TAINTS='no-ipv6 busybox'

The problem lies likely in your old build config, if those are your own snapshots and you can't sysupgrade from them.

mtd is still there? usable from command line?
The symptom is not typical, so I wonder if you have somehow lost the flashing ability.

You have apprently modified the build somewhat? ipv6 left out?
That change should not affect the sysupgrade, but have you left out any core packages?

There was an issue very similar to, if not exactly the same as, your current issue that was discussed in the now [finally] ceased WRT1900AC OpenWrt thread, however I'm not sure when or where within that almost 15K post thread to look.

  • I'd recommend using Google's advanced search functionality to search that thread specifically using paramaters such as:
  • site: "sysupgrade" AND "issue" OR "failure"
    • I know people have created a complete list of the entire advanced search functionality options and it would likely be worth the time to see if you can locate a write up like that (I'm not sure if Google still has an accessible webpage showing the vast number of search parameters which can be utilized)

Out of curiosity, you're not flashing via wifi or remotely are you (i.e. not via ethernet, over WAN, etc.)? If so, that's likely the issue.

  • Flashing over WiFi should never be attempted, and the issue with remotely flashing is there's no way to maintain the connection on a remote terminal.

  • I do believe this is the purpose of the attended-sysupgrade and openwisp packages, however I haven't thoroughly researched either. Either way, @hnyman should be able to shed some light on whether my understanding is correct or not.

I have not looked into those packages that you mentioned, so no info regarding them.

But there were indeed sysupgrade problems with mvebu devices earlier, but those were already earlier, with r4188-r4212 generically, and specifically for mvebu with r4250-r4293, but those were earlier than @kevle's current revision.

just for reference the older bugs:

Sysupgrade bug in r4188-r4212, fixed by r4213 (NAND devices, LuCI)

Sysupgrade in wrt3200 (mvebu bug in r4250-r4293)

They were specific to those commit ranges, but apparenly OP has a newer firmware, so those should not be the reason.

1 Like

It appears to be there.

root@ap-wrt1200ac-8:~# mtd --help
mtd: unrecognized option: -
Usage: mtd [<options> ...] <command> [<arguments> ...] <device>[:<device>...]

There is no need for ipv6 support on those devices, I have posted the whole .config file in the gist.

Currently I copy the sysupgrade file using scp to the /tmp/ directory of the access point. Then I run sysupgrade over a "wired" ssh connection. However, I could try running it over the serial headers if I get more output that way.

root@ap-wrt1200ac-8:~# grep sysupgrade.lock /sbin/sysupgrade

Gives me no output.

The last comment in this thread makes me think that directly using "mtd" to write the firmware is possible.
According to it may be used to flash the original firmware. So it probably should work with the "factory" image variant too, right? Thanks for your input :slight_smile:

IMO, using mtd write is a recipe for a brick.

I'd recommend to try flashing via serial, as at least at that point you can fully follow everything from the point of you initiating the flash (I'd also use sysupgrade -v).

I wouldn't recommend this either because the WRT AC Series uses a round robin flash process to flash, and a simple typo could brick the router or corrupt the bootloader (recoverable, but a major inconvenience).

Flash Layout

  • If booted to the primary partition (mtd4), it will flash the kernel to mtd6 (kernel2) & firmware to mtd7 (rootfs2)

  • If booted to the alternate partition (mtd6), it will flash the kernel to mtd4 (kernel1) and the firmware to mtd5 (rootfs1)