Opened 2 years ago

Closed 2 years ago

#21371 closed defect (fixed)

ar71xx sysupgrade broken in trunk since r47878 for non-nand devices

Reported by: hnyman Owned by: developers
Priority: highest Milestone: Designated Driver (Trunk)
Component: base system Version: Trunk
Keywords: ar71xx sysupgrade Cc: hannu.nyman@…


r47878 broke the sysupgrade for non-nand ar71xx devices.

If a non-nand ar71xx device tries sysupgrade from a firmware revision 47878 or later, the user gets a warning about invalid file in Luci or the following error at the system console:

/sbin/sysupgrade: .: line 10: can't open '/lib/upgrade/'

The reason is explained in

r7878 inserted a new file /lib/upgrade/, which contains a nand-specific script sourcing. "normal" ar71xx devices now fail due to that missing script.

If you have installed the broken ar71xx firmware with revision r47878-current, the easy fix is to manually edit /lib/upgrade/ file in the live router and remove the line 10 containing ". /lib/upgrade/". Below is the same patch for source repo:

--- target/linux/ar71xx/base-files/lib/upgrade/
+++ target/linux/ar71xx/base-files/lib/upgrade/
@@ -7,7 +7,6 @@
 . /lib/
 . /lib/
-. /lib/upgrade/
 get_magic_at() {
     local mtddev=$1

The file /lib/upgrade/ can be also deleted, as it is not needed by other devices.

Attachments (0)

Change History (4)

comment:1 Changed 2 years ago by nbd

  • Resolution set to fixed
  • Status changed from new to closed

fixed in r47889

comment:2 Changed 2 years ago by haminhcine@…

  • Resolution fixed deleted
  • Status changed from closed to reopened

Any chance of a step by step solution? Thanks

comment:3 Changed 2 years ago by hnyman

Easiest is probably to delete the whole file /lib/upgrade/

  • login into router console with ssh
  • rm /lib/upgrade/

Then sysupgrade should work normally.

comment:4 Changed 2 years ago by nbd

  • Resolution set to fixed
  • Status changed from reopened to closed

Add Comment

Modify Ticket

as closed .
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.