OpenWrt Forum Archive

Topic: sysupgrade?

The content of this topic has been archived on 22 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi

How does sysupgrade work?
What kind of file does sysupgrade expect?
how to upgrade kernel and rootfs?

Thnx for any help.

Hi.

Sysupgrade basically switches to a ramdisk, backs up your /etc/config, invokes mtd to write the image and reappends the previously saved configs to a new jffs2 partition.

It expects an image file in .trx format.

Platfroms with separate kernel and rootfs images are _not_ supported, only those was a combined image format.

~ JoW

Hi

Thnx for that info.
I'm working on a board from scratch. I can manipulate my flash mapping and I can build jffs and squash file system and kernel, which work fine on  my board.
Where can I find more info to make a trx file to make combined image format?
What files should I look into to find out?

Kind regards

I'd like to know this too. I am trying to upgrade from 7.09 to 8.09_rc1 on my wgt634u. The images come in .bin format, which is supposed to be just a trx plus header, but I don't know how to strip that header out. Or is there a way to do this 'manually', other than using the serial cable (my serial cable is br0ken).

OK I found a post on how to convert .bin to .trx:

dd if=firmware.bin of=firmware.trx bs=32 skip=1

But, when I move the sysupgrade script and its common.sh lib file over to the wgt634u, and copy the wgt .bin image, and run it, I get"Firmware upgrade is not implemented for this platform.". So I guess it's manual, eh? That sucks, because I was hoping to do this remotely, but now I'll have to go onsite and put the config back in.

Where does sysupgrade expect the firmware file to be? /tmp?

mordak wrote:

Where does sysupgrade expect the firmware file to be? /tmp?

Yes, you can either specify a file path (/tmp/image.trx) or an url (http://example.org/image.trx). However, the http method is somewhat risky (sudden connection loss during flash etc.)

~ JoW

jow wrote:
mordak wrote:

Where does sysupgrade expect the firmware file to be? /tmp?

Yes, you can either specify a file path (/tmp/image.trx) or an url (http://example.org/image.trx). However, the http method is somewhat risky (sudden connection loss during flash etc.)

~ JoW

Thanks for the info is this going to get added to the Wiki at some point?

ugh i tried sysupgrade with a downloaded .bin file and also used the dd command above to conver to a .trx file and i still get "Firmware upgrade is not implemented for this platform." wtf? this is on a RSPro.

i just used that same .trx file with the mtd command

mtd write /tmp/openwrt-ar71xx-ubnt-rspro-jffs2-sysupgrade.bin rootfs && reboot

this worked! but i lost my config. maybe i should have used the firmware.bin file instead. i wonder if there is any difference between them. the system came up (reset to 192.168.1.1 with openwrt default blank password NOT the default ubnt ubiquiti password). more to come.

sysupgrade is a script that only recently was extended to also work on RS(pro). So if you activate it from an older OpenWrt it will not work.
Once the board carries OpenWrt with an extended version you can use sysupgrade from then onwards.

yeah i was kind of figuring that. so now i tried to do the mtd method again but with the firmware.bin file (did .bin by accident then did again with .trx) and the system wuold not accept a "reboot" command. so i cycled the power and it won't come up. i checked on 192.168.1.1 (and at 192.168.2.20 that i had changed it to and 192.168.1.20 which ubiquiti defaults to) to no avail. i think i bricked it!! wah wah. what do i do now?

it may have loaded well but via the wan port is asking for an address per dhcp.
While keeping it powered via wan, connect also to it on one of the lan ports and try telnet to 192.168.1.1 ....

If not, put it in failsave; shortly after powering press the reset button and keep that pressed a few seconds. The unit per wan port then listens for tftp on 192.168.1.20  and is pingable.

damn that was harder than it sounded. you have to catch it at the right time with the reset button. best to let your computer keep pinging 192.168.1.20 while you're trying to get reset at the right time. then you continue with tftp.

jow wrote:

Hi.

Sysupgrade basically switches to a ramdisk, backs up your /etc/config, invokes mtd to write the image and reappends the previously saved configs to a new jffs2 partition.

It expects an image file in .trx format.

Platfroms with separate kernel and rootfs images are _not_ supported, only those was a combined image format.

~ JoW

Thanks for all the good work on OpenWRT!

Luci gets

The uploaded image file does not contain a supported format. Make sure that you choose the generic image format for your platform.

when upgrading openwrt-ar71xx-ubnt-rocket-m-squashfs-factory.bin using either

openwrt-ar71xx-generic-ubnt-rocket-m-squashfs-sysupgrade.bin

or

openwrt-ar71xx-ubnt-rocket-m-squashfs-factory.bin.

Thanks for your thoughts.

kind regards/ldv

HI all, if it says "Failed to switch over to ramfs. Pleaese reboot", what will be the potential problem?

The discussion might have continued from here.