upgrading/installing firmwares using linux

Talk about anything you like here: as long as it's technical, doesn't fit into the other categories and is within the rules. Questions and discussions about operating systems, programming, websites, hosting, ADSL etc. are particularly welcome here.
chez
Novice
Novice
Posts: 28
Joined: Tue Jul 25, 2006 6:35 pm
Location: UK

upgrading/installing firmwares using linux

Post by chez » Tue Dec 23, 2008 2:14 pm

How do I upload RT firmware using linux?
I got rid of my win98 box before I realised that I still depended on it for this function.
Now son, this is the safe way to... ohh?
User avatar
thechief
RouterTech Team
RouterTech Team
Posts: 12067
Joined: Wed Feb 01, 2006 10:22 pm
Location: England, the Centre of Africa
Contact:

Post by thechief » Tue Dec 23, 2008 2:23 pm

What is your router?
The Chief: :afro: Be sure to read the Firmware FAQ and do a Forum Search before posting!
No support via PM. Ask all questions on the open forum.
chez
Novice
Novice
Posts: 28
Joined: Tue Jul 25, 2006 6:35 pm
Location: UK

Post by chez » Tue Dec 23, 2008 2:43 pm

We have an ASR8400 and a SWART2-54125.
(I assume that I can use Mugwump's CD for the former.)
Now son, this is the safe way to... ohh?
User avatar
thechief
RouterTech Team
RouterTech Team
Posts: 12067
Joined: Wed Feb 01, 2006 10:22 pm
Location: England, the Centre of Africa
Contact:

Post by thechief » Tue Dec 23, 2008 4:14 pm

For the SWART2, you can use scp or wget or whatever, to transfer the firmware image to the router's /var directory, and then run this command (after connecting via telnet/ssh - and assuming that the firmware image is called "fw.bin")

Code: Select all

cd /var
upgrade -f fw.bin
This is for a single-image upgrade.
The Chief: :afro: Be sure to read the Firmware FAQ and do a Forum Search before posting!
No support via PM. Ask all questions on the open forum.
chez
Novice
Novice
Posts: 28
Joined: Tue Jul 25, 2006 6:35 pm
Location: UK

Post by chez » Wed Dec 31, 2008 4:28 pm

I thought I had understood the man pages for scp, but the closest I have got so far is:

Code: Select all

alistair@unit:/home$ scp -4vp RouterTech_3.7.1B_1350A_20081123_2.80_AR7WRD_psbl_firmware.upgrade.img root@192.168.1.1:/var
Executing: program /usr/bin/ssh host 192.168.1.1, user root, command scp -v -p -t /var
.
.snip
.
root@192.168.1.1's password:
debug1: Authentication succeeded (password).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_GB.UTF-8
debug1: Sending command: scp -v -p -t /var
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
scp: No such file or directory
debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
debug1: fd 1 clearing O_NONBLOCK
debug1: Transferred: stdin 0, stdout 0, stderr 0 bytes in 0.1 seconds
debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.0
debug1: Exit status 127
lost connection
alistair@unit:/home$
(Some of the output was cut but I hope that the key info remains.)
What am I doing wrong?
(The current firmare on the unit is your first version for the tnet1350 card.)
Now son, this is the safe way to... ohh?
User avatar
thechief
RouterTech Team
RouterTech Team
Posts: 12067
Joined: Wed Feb 01, 2006 10:22 pm
Location: England, the Centre of Africa
Contact:

Post by thechief » Wed Dec 31, 2008 4:34 pm

Use WinSCP. It works pretty fine under WINE. But it also requires your firmware to have functional dropbear and scp binaries. Perhaps the safecom firmware doesn't have scp - in which case you will need to use wget.
The Chief: :afro: Be sure to read the Firmware FAQ and do a Forum Search before posting!
No support via PM. Ask all questions on the open forum.
chez
Novice
Novice
Posts: 28
Joined: Tue Jul 25, 2006 6:35 pm
Location: UK

Post by chez » Fri Jan 02, 2009 12:00 pm

Thanks TheChief.
I used 'ftp' to 'put' the firmware onto the unit.
Having logged into the remote server in 'ftp' I declared the file 'type' to be 'image' (the file is binary rather than the 'ftp' default of ascii.)
I then 'put' the .img file from the local directory to the remote /var/ directory as you suggested.
It happened so quickly that I did not realise at first that the file was self-extracting and upgrading!
(Is the "'dot'upgrade" part of the filename a command?)
"All" I have to do now is wait until the family have come off their machines so that I may plug it into the line!?!
Would it be worth adding some notes to the documents for us new to linux?
Now son, this is the safe way to... ohh?
User avatar
thechief
RouterTech Team
RouterTech Team
Posts: 12067
Joined: Wed Feb 01, 2006 10:22 pm
Location: England, the Centre of Africa
Contact:

Post by thechief » Fri Jan 02, 2009 12:15 pm

Using the firmware's own ftp server does result in the server automatically trying to upgrade the firmware with whatever was uploaded. This can be dangerous if this is not what you are trying to do - which is why no-one has mentioned it. If you use a means other than ftp to send the file over, then you still have to do the second step of running "upgrade". This is the preferred method, because it at least gives you a chance to back out!
The Chief: :afro: Be sure to read the Firmware FAQ and do a Forum Search before posting!
No support via PM. Ask all questions on the open forum.
tiepolo
Experienced
Experienced
Posts: 162
Joined: Sat Mar 03, 2007 10:10 pm
Location: milan, Italy

Re: upgrading/installing firmwares using linux

Post by tiepolo » Sat Oct 03, 2009 8:04 pm

Hello,

I'm tring to upgrade 2.91 to 2.91.1 from ssh

I renamed the image Router.img and loaded it with wget to /tmp/var

After executing

upgrade -f Router.img
the system announces "Timeout, server not responding" and I simply have no result, the firmware image I see after reboot being the same as previous.

NB: I already tested and used dd if=/var/RouterTech.img of=/dev/mtdblock/4 for flashing

I tried with normal image and annex B ports adam2 on Dlink G 604 T
Do you have ideas?

Thanks, Paolo
Last edited by tiepolo on Tue Oct 06, 2009 12:52 pm, edited 1 time in total.
Paolo
mstombs
RouterTech Team
RouterTech Team
Posts: 3753
Joined: Wed Jan 10, 2007 11:54 pm

Re: upgrading/installing firmwares using linux

Post by mstombs » Sat Oct 03, 2009 8:31 pm

Ideas:-

The file must be uploaded to "/var"

If you are using a minix nvram you must "umount /nvram" before upgrading firmware.

You have a D-Link with badly fragmented adam2
tiepolo
Experienced
Experienced
Posts: 162
Joined: Sat Mar 03, 2007 10:10 pm
Location: milan, Italy

Re: upgrading/installing firmwares using linux

Post by tiepolo » Mon Oct 05, 2009 10:53 pm

/tmp/var is linked to /var - they're the same;

I tried again after defrag, the new firmware went up this time but it was impossible to get adsl connection. I had to repeat procedure from web;

The Linux upgrade could still be necessary if the new firmware demands a repartitioning of the memory.

Paolo
Paolo
User avatar
thechief
RouterTech Team
RouterTech Team
Posts: 12067
Joined: Wed Feb 01, 2006 10:22 pm
Location: England, the Centre of Africa
Contact:

Re: upgrading/installing firmwares using linux

Post by thechief » Mon Oct 05, 2009 11:06 pm

tiepolo wrote:/tmp/var is linked to /var - they're the same;
Not in any RT firmware that I know of.
tiepolo wrote:I tried again after defrag, the new firmware went up this time but it was impossible to get adsl connection. I had to repeat procedure from web;
I use this procedure all the time, and the only times it has failed to work was when I forgot to unmount the /nvram minix partition. It should work, so I am not sure what the problem is.
The Chief: :afro: Be sure to read the Firmware FAQ and do a Forum Search before posting!
No support via PM. Ask all questions on the open forum.
tiepolo
Experienced
Experienced
Posts: 162
Joined: Sat Mar 03, 2007 10:10 pm
Location: milan, Italy

Re: upgrading/installing firmwares using linux

Post by tiepolo » Tue Oct 06, 2009 6:55 am

1) /var and /tmp/var are not the same -
True, I was using /var which is linked to /tmp/var in other firmware;

2) I wasn't probably able to umount /nvram
this could be the point -
what's the exact command?

Thx!
Paolo
User avatar
thechief
RouterTech Team
RouterTech Team
Posts: 12067
Joined: Wed Feb 01, 2006 10:22 pm
Location: England, the Centre of Africa
Contact:

Re: upgrading/installing firmwares using linux

Post by thechief » Tue Oct 06, 2009 8:03 am

Code: Select all

umount /nvram/
You only need it if you have actually created a minix partition and mounted it on /nvram.
The Chief: :afro: Be sure to read the Firmware FAQ and do a Forum Search before posting!
No support via PM. Ask all questions on the open forum.
tiepolo
Experienced
Experienced
Posts: 162
Joined: Sat Mar 03, 2007 10:10 pm
Location: milan, Italy

Re: upgrading/installing firmwares using linux

Post by tiepolo » Tue Oct 06, 2009 8:25 am

I didn't volountarly created a minix partition.

I executed
umount /nvram
and got an error message;

Do you think the fact of executing the upgrade from remote can have an influence?
Paolo
Post Reply