Openwrt K on la Fonera without serial console...when DD-WRT?

Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware
Goto page 1, 2, 3, 4, 5, 6, 7, 8, 9  Next
Author Message
Camicia
DD-WRT User


Joined: 24 Dec 2006
Posts: 79

PostPosted: Thu Dec 28, 2006 22:35    Post subject: Openwrt K on la Fonera without serial console...when DD-WRT? Reply with quote
Hi everybody,
I am going to summarize what you have to do to run Openwrt on your Fonera.
At the moment this tutorial is WIP, suggestions are welcome. A few people tested it and it seemed to work. Lately someone had problems at the end of step 3. The procedure MUST be verified on new version of La Fonera Confused
You can also read something here: http://wiki.openwrt.org/OpenWrtDocs/Hardware/Fon/Fonera


I want first to specify a few things:

- Fon paid for the routers to realize their vision. Put Openwrt on the router which they paid is not the right thing to do. If you do, do it with pupouse: so they can improve their OS (already based on OpenWrt) and the advanced users can have more flexibility.
Please don't let me feel like Einstain after the boms on Japan: I don't want to kill FON.

- With firmware 7.1 r1 the Fonera should be good enough for the average user. Remeber that the Fonera come with a firmware that is based on Openwrt Kamikaze and a web interface to configure. Currently Openwrt Kamikaze has NOT ANY web interface, even if X-WRT will come soon.

- Don't come to cry saying "I bricked my Fonera" and, moreover, don't go to Fon saying that your Fonera got broken when you broke it!


Ok... ready to start:

1 - Start with a Fonera with original firmware 7.x (but NOT with 7.1 r2 because step 2 doensn't work).

2 - Hack the Fonera to havea SSH connection (see here: http://blog.blase16.de/index.php?url=2006/11/28/Hacking-Fonera)

3 - Through SSH access write (please note that these are 4 different commands):
Code:
cd /tmp

wget http://coppercore.net/~kevin/fon/openwrt-ar531x-2.4-vmlinux-CAMICIA.lzma

mtd -e vmlinux.bin.l7 write openwrt-ar531x-2.4-vmlinux-CAMICIA.lzma vmlinux.bin.l7

reboot

Don't be mislead by the name of the file. This is actually a FON kernel hacked to write on the mtd partion with read boot. After this step the Fonera should be able to restart without any problem.

4 - It's time to enable Redboot through ethernet connection. After this step you will need a crossover ethernet cable or a switch and 2 normal cables.
Through SSH access write:
Code:
cd /tmp
wget http://coppercore.net/~kevin/fon/out.hex
mtd -e "RedBoot config" write out.hex "RedBoot config"
reboot


5 - Your Fonera could not be able to reboot (because the FIS directory can be erased) but you should have a connection to Redboot. To connect to Redboot you need to:
a) Configure your PC so you have an address like 192.168.1.166.
b) enstablish a ethernet phisical connection between your PC and the Fonera through a crossover ethernet cable or a switch and 2 normal cables.
c) Disconnect and reconnect the power to your Fonera. In the filrst 10 secs you can access to RedBoot throught "telnet 192.168.1.254 9000" (9000 is the port to use)
If everytihnf goes well you should have a "RedBoot>" prompt in your telnet.

It's interesting to note that before before Step 4 when you woite "fis list" the ouptput of Redboot was:
Code:

+PHY ID is 0022:5521
Ethernet eth0: MAC address 00:18:84:10:97:f4
IP: 0.0.0.0/255.255.255.255, Gateway: 0.0.0.0
Default server: 0.0.0.0

RedBoot(tm) bootstrap and debug environment [ROMRAM]
Non-certified release, version v1.3.0 - built 16:57:58, Aug  7 2006

Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.

Board: ap51
RAM: 0x80000000-0x81000000, [0x80040450-0x80fe1000] available
FLASH: 0xa8000000 - 0xa87f0000, 128 blocks of 0x00010000 bytes each.
== Executing boot script in 1.000 seconds - enter ^C to abort
^C
RedBoot> ^C
RedBoot>
RedBoot> fis list
Name              FLASH addr  Mem addr    Length      Entry point
RedBoot           0xA8000000  0xA8000000  0x00030000  0x00000000
rootfs            0xA8030000  0xA8030000  0x00700000  0x00000000
vmlinux.bin.l7    0xA8730000  0x80041000   x000B0000  0x80041000
FIS directory     0xA87E0000  0xA87E0000  0x0000F000  0x00000000
RedBoot config    0xA87EF000  0xA87EE000  0x00001000  0x00000000
RedBoot>

Now the output is just:
Code:

RedBoot> fis list
Name              FLASH addr  Mem addr    Length      Entry point

Command "fis init" at step 8 will solve this.

6 - Downlaod the files http://rapidshare.com/files/8887147/openwrt-atheros-2.6.tar.htm on your PC and run a TFTP server in the same directory. You can use this on windows: http://tftpd32.jounin.net/ or for linux look at this: http://ecos.sourceware.org/docs-latest/redboot/configuring-the-redboot-environment.html#AEN351

7 - Next, tell the Fonera client and server IP:
Code:
 ip_addr -h server_ip -l fonera_ip/24

Do not forget the /netmask_length at the end of your fonera_ip.
In our case we should write:
Code:
ip_addr -h 192.168.1.166 -l 192.168.1.254/24


8 - Load the Operwrt Kamikaze changing the partitions (some of the commands can take till 20 minutes - DO NOT TOUCH THE FONERA DURING THEM):
Code:
fis init
load -r -v -b 0x80040450 openwrt-atheros-2.6-root.jffs2-64k
fis create -b 0x80040450 -f 0xA8030000 -l 0x00700000 -e 0x00000000 rootfs
load -r -b %{FREEMEMLO} openwrt-atheros-2.6-vmlinux.lzma
fis create -r 0x80041000 -e 0x80041000 vmlinux.bin.l7
fis load -l vmlinux.bin.l7


Output of these line are in the post below by Heini66.

NOTE: The command "fis init" was missing. Now it should work :wink:

9 - Write "exec"

10 - Connect to your new Fonera/OpenWrt at 192.168.1.1 thought telnet (port 23) and change your password via "passwd root". Next time to connect to the router you will need a SSH access with login "root" and the password you have inserted


If everything went well now your Fonera is running Openwrt Kamikaze, otherwise is bricked :wink:

Camicia


Last edited by Camicia on Thu Mar 01, 2007 7:54; edited 10 times in total
Sponsor
Camicia
DD-WRT User


Joined: 24 Dec 2006
Posts: 79

PostPosted: Thu Dec 28, 2006 22:36    Post subject: Reply with quote
How to restore the Fon original firmware

I assume that, as prerequisite, you have the access to Redboot through a serial cable or ethernet cable.

1) Download http://downloads.fon.com/firmware/current/fonera_0.7.1.1.fon

2) Remove the first useless 519 bytes with the command:
Code:
dd if=fonera_0.7.1.1.fon of=fonera.tar.gz bs=519 skip=1

or this:
Code:
#!/bin/sh
SIZE=$(du -b $1 | cut -f1)
tail -c $((SIZE-519)) $1 > $1.tar.gz

On Windows you can do that with a Hex Editor and renaming the file in "fonera.tar.gz"

3) Extract the 2 files in the archive

4) Run a TFTP server in the directory where you extract the files

5) Connect to Redboot through the serial console or Telnet (see previous post)

6) On the Redboot load firmware on fonera by serial console and tftpserver

Code:
ip_address - l IpOfFonera/24 -h IpOfTftpserver
load -r -v -b 0x80040450 openwrt-atheros-2.6-root.jffs2-64k
fis create -b 0x80040450 -f 0xA8030000 -l 0x00700000 -e 0x00000000 rootfs
load -r -b %{FREEMEMLO} openwrt-atheros-2.6-vmlinux.lzma
fis create -r 0x80041000 -e 0x80041000 vmlinux.bin.l7
fis load -l vmlinux.bin.l7
exec


NOTE: Also this procedure is WIP. Please give feedback

Camicia
Heini66
DD-WRT User


Joined: 01 Dec 2006
Posts: 70

PostPosted: Fri Dec 29, 2006 0:04    Post subject: Reply with quote
dunno what i should else give more than a log.
Code:


Ethernet eth0: MAC address 00:18:84:13:57:08
IP: 192.168.0.10/255.255.255.0, Gateway: 0.0.0.0
Default server: 192.168.0.5

RedBoot(tm) bootstrap and debug environment [ROMRAM]
Non-certified release, version v1.3.0 - built 16:57:58, Aug  7 2006

Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.

Board: ap51
RAM: 0x80000000-0x81000000, [0x80040450-0x80fe1000] available
FLASH: 0xa8000000 - 0xa87f0000, 128 blocks of 0x00010000 bytes each.
== Executing boot script in 10.000 seconds - enter ^C to abort
^C
RedBoot> fis init
About to initialize [format] FLASH image system - continue (y/n)? y
*** Initialize FLASH Image System
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
RedBoot> load -r -v -b 0x80040450 openwrt-atheros-2.6-root.jffs2-64k
Using default protocol (TFTP)
Raw file loaded 0x80040450-0x8020044f, assumed entry at 0x80040450
RedBoot> fis create -b 0x80040450 -f 0xA8030000 -l 0x00700000 -e 0x00000000 rootfs
... Erase from 0xa8030000-0xa8730000: ...................................................................................
... Program from 0x80040450-0x80740450 at 0xa8030000: ...................................................................
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
RedBoot> load -r -b %{FREEMEMLO} openwrt-atheros-2.6-vmlinux.lzma
Using default protocol (TFTP)
Raw file loaded 0x80040800-0x800f07ff, assumed entry at 0x80040800
RedBoot> fis create -r 0x80041000 -e 0x80041000 vmlinux.bin.l7
... Erase from 0xa8730000-0xa87e0000: ...........
... Program from 0x80040800-0x800f0800 at 0xa8730000: ...........
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
RedBoot>fis load -l vmlinux.bin.l7
RedBoot>exec

vmlinuz file can be extracted from original firm, or taken from openwrt trunk make from atheros target.

_________________
freenode.net #openwrt

NO SUPPORT VIA PM !!!
goldserve
DD-WRT User


Joined: 07 Jun 2006
Posts: 115

PostPosted: Fri Dec 29, 2006 3:29    Post subject: Reply with quote
The output after step 5 c) is:

Code:

RedBoot> fis list
Name              FLASH addr  Mem addr    Length      Entry point
RedBoot>
Camicia
DD-WRT User


Joined: 24 Dec 2006
Posts: 79

PostPosted: Fri Dec 29, 2006 4:54    Post subject: Reply with quote
goldserve wrote:
The output after step 5 c) is:

Code:

RedBoot> fis list
Name              FLASH addr  Mem addr    Length      Entry point
RedBoot>


Thanks Goldserve. So Redboot is not going to rewrite the defauld data on itself at startup and on the FIS. What happend if you restart the router again? Same output?

I think we need to rewrite the data. Let me find out how.

Camicia
Camicia
DD-WRT User


Joined: 24 Dec 2006
Posts: 79

PostPosted: Fri Dec 29, 2006 5:00    Post subject: Reply with quote
Heini66 wrote:
dunno what i should else give more than a log.

vmlinuz file can be extracted from original firm, or taken from openwrt trunk make from atheros target.


Log is very useful to spot what you did.

However I was asking to go through the process step-by-step and see if it is working. If you write something that is not in the tutorial you need to write it down.

I would also like a list of your FIS through command "fis list".

I found a errors:
"fis init" WAS not in step 8. I think this is critical

I read the manual of Redboot ( http://ecos.sourceware.org/docs-latest/redboot/ ) and all the other things seem to be OK. What does the "-l" parameter in "fis load" mean?

We need to strait the things out.
Is anybody here that made Openwrt work on the Fonera through serial console? Can you check step 8 please?

Camicia


Last edited by Camicia on Fri Dec 29, 2006 5:52; edited 2 times in total
goldserve
DD-WRT User


Joined: 07 Jun 2006
Posts: 115

PostPosted: Fri Dec 29, 2006 5:19    Post subject: Reply with quote
I can attest to everything in the howto. It works!
Camicia
DD-WRT User


Joined: 24 Dec 2006
Posts: 79

PostPosted: Fri Dec 29, 2006 5:25    Post subject: Reply with quote
goldserve wrote:
I can attest to everything in the howto. It works!


Did you use "fis init" at step 8 ?

Camicia
goldserve
DD-WRT User


Joined: 07 Jun 2006
Posts: 115

PostPosted: Fri Dec 29, 2006 5:28    Post subject: Reply with quote
initially i did not and I loaded the image. It seemed like it froze so I rebooted and did a fis init first. I left it on for 20 mins and it worked after. I don't know if it was the time I waited or the fis init.
Camicia
DD-WRT User


Joined: 24 Dec 2006
Posts: 79

PostPosted: Fri Dec 29, 2006 5:53    Post subject: Reply with quote
goldserve wrote:
initially i did not and I loaded the image. It seemed like it froze so I rebooted and did a fis init first. I left it on for 20 mins and it worked after. I don't know if it was the time I waited or the fis init.


Thanks!
What is your "fis list" now?

Camicia
goldserve
DD-WRT User


Joined: 07 Jun 2006
Posts: 115

PostPosted: Fri Dec 29, 2006 6:03    Post subject: Reply with quote
Here is my fis list:

Code:

== Executing boot script in 8.810 seconds - enter ^C to abort
^C
RedBoot> fis list
Name              FLASH addr  Mem addr    Length      Entry point
RedBoot           0xA8000000  0xA8000000  0x00030000  0x00000000
rootfs            0xA8030000  0xA8030000  0x00700000  0x00000000
vmlinux.bin.l7    0xA8730000  0x80041000  0x000B0000  0x80041000
FIS directory     0xA87E0000  0xA87E0000  0x0000F000  0x00000000
RedBoot config    0xA87EF000  0xA87EF000  0x00001000  0x00000000
RedBoot>
Camicia
DD-WRT User


Joined: 24 Dec 2006
Posts: 79

PostPosted: Fri Dec 29, 2006 6:16    Post subject: Reply with quote
goldserve wrote:
Here is my fis list:


Wait a moment. Isn't this the same list of the original Fonera firmware? Confused
Is this the output of your Fonera with Openwrt on before flashing it?

Otherwise I don't see why the following "mtd" commands from SSH are not enough to install Openwrt:

Code:
mtd write openwrt-atheros-2.6-vmlinux.lzma vmlinux.bin.l7
mtd write openwrt-atheros-2.6-root.jffs2-64k rootfs


Can someone with a "virgin" Fonera and a serial cable report the result of "fis list"?

Thanks,
Camicia
Heini66
DD-WRT User


Joined: 01 Dec 2006
Posts: 70

PostPosted: Fri Dec 29, 2006 8:15    Post subject: Reply with quote
doing on a "fresh" fonera:
Code:

mtd write openwrt-atheros-2.6-vmlinux.lzma vmlinux.bin.l7
mtd write openwrt-atheros-2.6-root.jffs2-64k rootfs

will end in a bricked unit.
Code:


+PHY ID is XXXX:YYYY
Ethernet eth0: MAC address xx:xx:xx:xx:xx:xx
IP: 0.0.0.0/255.255.255.255, Gateway: 0.0.0.0
Default server: 0.0.0.0

RedBoot(tm) bootstrap and debug environment [ROMRAM]
Non-certified release, version v1.3.0 - built 16:57:58, Aug  7 2006

Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.

Board: ap51
RAM: 0x80000000-0x81000000, [0x80040450-0x80fe1000] available
FLASH: 0xa8000000 - 0xa87f0000, 128 blocks of 0x00010000 bytes each.
== Executing boot script in 1.000 seconds - enter ^C to abort
RedBoot> fis load -l vmlinux.bin.l7
lzma_decode failed. res=1
RedBoot> exec
Now booting linux kernel:
 Base address 0x80030000 Entry 0x80041000
 Cmdline :


don't have any answer why.....

when done on a kamikaze openwrt fonera, it works!

_________________
freenode.net #openwrt

NO SUPPORT VIA PM !!!
Camicia
DD-WRT User


Joined: 24 Dec 2006
Posts: 79

PostPosted: Fri Dec 29, 2006 10:25    Post subject: Reply with quote
Obviously it's something in the FIS directory.

I would like to see the output of Redboot commands
Code:
fconfig -l
fis list
fis list -d
fis list -c


On a "virgin" Fonera and on a Fonera update with Openwrt.

Camicia
Heini66
DD-WRT User


Joined: 01 Dec 2006
Posts: 70

PostPosted: Fri Dec 29, 2006 13:01    Post subject: Reply with quote
openwrt fonera:
Code:

 fis list
Name              FLASH addr  Mem addr    Length      Entry point
RedBoot           0xA8000000  0xA8000000  0x00030000  0x00000000
rootfs            0xA8030000  0xA8030000  0x00700000  0x00000000
vmlinux.bin.l7    0xA8730000  0x80041000  0x000B0000  0x80041000
FIS directory     0xA87E0000  0xA87E0000  0x0000F000  0x00000000
RedBoot config    0xA87EF000  0xA87EF000  0x00001000  0x00000000
RedBoot> fis list -d
Name              FLASH addr  Mem addr    Datalen     Entry point
RedBoot           0xA8000000  0xA8000000  0x00000000  0x00000000
rootfs            0xA8030000  0xA8030000  0x00700000  0x00000000
vmlinux.bin.l7    0xA8730000  0x80041000  0x000B0000  0x80041000
FIS directory     0xA87E0000  0xA87E0000  0x00000000  0x00000000
RedBoot config    0xA87EF000  0xA87EF000  0x00000000  0x00000000
RedBoot> fis list -c
Name              FLASH addr  Checksum    Length      Entry point
RedBoot           0xA8000000  0x00000000  0x00030000  0x00000000
rootfs            0xA8030000  0x550F24A8  0x00700000  0x00000000
vmlinux.bin.l7    0xA8730000  0x5874AC91  0x000B0000  0x80041000
FIS directory     0xA87E0000  0x00000000  0x0000F000  0x00000000
RedBoot config    0xA87EF000  0x00000000  0x00001000  0x00000000


fon fonera:
Code:

RedBoot> fis list
Name              FLASH addr  Mem addr    Length      Entry point
RedBoot           0xA8000000  0xA8000000  0x00030000  0x00000000
rootfs            0xA8030000  0xA8030000  0x00700000  0x00000000
vmlinux.bin.l7    0xA8730000  0x80041000  0x000B0000  0x80041000
FIS directory     0xA87E0000  0xA87E0000  0x0000F000  0x00000000
RedBoot config    0xA87EF000  0xA87EF000  0x00001000  0x00000000
RedBoot> fis list -d
Name              FLASH addr  Mem addr    Datalen     Entry point
RedBoot           0xA8000000  0xA8000000  0x00000000  0x00000000
rootfs            0xA8030000  0xA8030000  0x00700000  0x00000000
vmlinux.bin.l7    0xA8730000  0x80041000  0x00080000  0x80041000
FIS directory     0xA87E0000  0xA87E0000  0x00000000  0x00000000
RedBoot config    0xA87EF000  0xA87EF000  0x00000000  0x00000000
RedBoot> fis list -c
Name              FLASH addr  Checksum    Length      Entry point
RedBoot           0xA8000000  0x00000000  0x00030000  0x00000000
rootfs            0xA8030000  0xC1F22064  0x00700000  0x00000000
vmlinux.bin.l7    0xA8730000  0x4F4DCCF6  0x000B0000  0x80041000
FIS directory     0xA87E0000  0x00000000  0x0000F000  0x00000000
RedBoot config    0xA87EF000  0x00000000  0x00001000  0x00000000

_________________
freenode.net #openwrt

NO SUPPORT VIA PM !!!
Goto page 1, 2, 3, 4, 5, 6, 7, 8, 9  Next Display posts from previous:    Page 1 of 9
Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum