OpenWrt/LEDE Project

  • Status Unconfirmed
  • Percent Complete
  • Task Type Bug Report
  • Category Base system
  • Assigned To No-one
  • Operating System All
  • Severity Low
  • Priority Very Low
  • Reported Version Trunk
  • Due in Version Undecided
  • Due Date Undecided
  • Private
Attached to Project: OpenWrt/LEDE Project
Opened by william wortel - 05.09.2020

FS#3320 - Ubiquiti Routerstation compilation produces no sysupgrade image anymore

OpenWrt SNAPSHOT, r14382+7-ad0f0df909
When compiling e.g. for another Ubiquiti device like Bullet XW, factory and sysupgrade images appear.
Compiling for Routerstation only the factory image.
Looking into target/linux/ath79/image/ noticed that under
Device/ubnt there is IMAGES += factory.bin
and under
Device/ubnt_routerstation_common there is IMAGES := factory.bin

Just changing the := into +: produces a ...sysupgrade.bin but it is not accepted by sysupgrade.
Not hindered by knowledge just copied what it was in the times of ar71xx and it produces a working sysupgrade image:

define Device/ubnt_routerstation_common

DEVICE_PACKAGES := -kmod-ath9k -wpad-basic-wolfssl -uboot-envtools kmod-usb-ohci \
kmod-usb2 fconfig
SOC := ar7161
IMAGE_SIZE := 16128k
IMAGES := sysupgrade.bin factory.bin
IMAGE/factory.bin := append-rootfs | pad-rootfs | mkubntimage | \
IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | combined-image | check-size $$$$(IMAGE_SIZE)
KERNEL := kernel-bin | append-dtb | lzma | pad-to $$(BLOCKSIZE)
KERNEL_INITRAMFS := kernel-bin | append-dtb


define Device/ubnt_routerstation

DEVICE_MODEL := RouterStation
DEVICE_TITLE := Ubiquiti RouterStation
UBNT_CHIP := ar7100
DEVICE_PACKAGES += -swconfig
SUPPORTED_DEVICES += routerstation

TARGET_DEVICES += ubnt_routerstation

Project Manager
Adrian Schmutzler commented on 11.09.2020 19:46

sysupgrade on these devices is broken, so the images have been removed in

william wortel commented on 11.09.2020 20:48

Thanks. By now the kernel that gets compiled is 5.4.63
Is this kernel problem still present?
The situation poses a big difficulty to me as several Routerstation systems are not easily physically accessible. It turned out that only on an old compilation of some years ago the now experimentally produced sysupgrade.bin worked. Once upgraded to today's OpenWrt, the sysupgrade process commences but stops and the system reboots in the old setting.
Is there a manual way to produce a working sysupgrade binary for Routerstation boards?
Today's factory.bin works without tweaks. But you cannot apply it remotely.

Project Manager
Adrian Schmutzler commented on 11.09.2020 21:53

You can try to contact Tomasz (the patch author) about that.

Personally, I only know what I read in the commit message. From that perspective it looks to me like something nobody is interested in and which will probably stay that way until somebody feels enough pain to fix it.

william wortel commented on 15.09.2020 15:57

experimented under kernel 5 with the previous sysupgrade code and indeed ended up bricking the Routerstation.
Revived it using Jtag; had copies of the mtd 0-5. Restored mtd0 (uboot) and mtd4 (fis) and mtd5 (uboot data), the latter two I combined into one image.
Interestingly also the Openocd jtag programme provides for erasing flash per sector, and then writing it. But mtd4 and mtd5 together occupy the last sector of the 256 sectors the Routerstation's flash has. So when changing something in one of mtd4 or 5, both need to be rewritten as the flash erase that Openocd offers is not limited to just a part of the sector size.

william wortel commented on 18.09.2020 07:50

Further experimentation and contact with the patch' author has confirmed that a fix has already been proposed but has not been introduced yet. Experimintally have verified that it works fine. The sysupgrade works on the Routerstation under kernel 5 when pending kernel patch #411
(411-mtd-partial_eraseblock_write.patch) in target/linux/generic/pending-5.4/ is patched using Revert the commits and compile. The produced image has the ability to do sysupgrade on systems with partitions that are smaller than the erase block size of its flash, such as the Ubiquiti Routerstation and RS-Pro. When applying sysupgrade to provide Routerstations with new firmware do verify that the existing firmware does not have a kernel 4 or 5. Sysupgrade then will brick the board and require Jtag to revive it. If in doubt, use tftp and a factory image to upgrade the first time. From then on sysupgrade can be used again using compilations with the fix included.


Available keyboard shortcuts


Task Details

Task Editing