Thursday, June 5, 2008

Flashing Fonera to DD-WRT

Still writing.

You would need these below.
1. telnet client (pietty also support telnet)
2. ssh client (pietty)
3. tftpd (tftpd32)
4. HFS
5. openwrt-ar531x-2.4-vmlinux-CAMICIA.lzma
6. out.hex
7. image file (Download from DD-WRT. )
EX: Get from stable/v24/Atheros WiSoc/fonera/linux.bin
Fonera-firmware.bin one might be the firmware for you to flash back to fonera.)

First, you would need to get access of SSH. Please refer to the previous post.

Set your computer IP 169.254.255.2 , mask 255.255.0.0 , Gateway 169.254.255.1
Run HFS and add openwrt-ar531x-2.4-vmlinux-CAMICIA.lzma , out.hex to it.

Login and type the commend below.

> cd /tmp
> wget http://169.254.255.2/openwrt-ar531x-2.4-vmlinux-CAMICIA.lzma
> mtd -e vmlinux.bin.l7 write openwrt-ar531x-2.4-vmlinux-CAMICIA.lzma vmlinux.bin.l7
> reboot

After reboot, login again and do below.

> cd /tmp
> wget http://169.254.255.2/out.hex
> mtd -e "RedBoot config" write out.hex "RedBoot config"
> reboot

Set computer IP 192.168.1.166 , mask 255.255.255.0
Put linux.bin under the folder where tftpd is. Run tftpd.
Try to telnet 192.168.1.254 port 9000 after the fonera reboot.
Once succeed, you would get the message below and can follow the commends.

== Executing boot script in 8.760 seconds - enter ^C to abort
^C
RedBoot>
RedBoot> ip_address -l 192.168.1.254/24 -h 192.168.1.166
IP: 192.168.1.254/255.255.255.0, Gateway: 0.0.0.0
Default server: 192.168.1.166
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 -b 0x80041000 linux.bin
Using default protocol (TFTP)
Raw file loaded 0x80041000-0x806a0fff, assumed entry at 0x80041000
RedBoot> fis create linux

It would take up to 10 minutes or more. Please be patient and do not type anything during waiting. Otherwise would get error and need to start up it again. You would see Redboot> again after it is already to continue.

... Erase from 0xa8030000-0xa8690000: ......................................................................................................
... Program from 0x80041000-0x806a1000 at 0xa8030000: ......................................................................................................
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
RedBoot> fconfig
Run script at boot: true
Boot script:
.. fis load -l vmlinux.bin.l7
.. exec
Enter script, terminate with empty line
>> fis load -l linux
>> exec
>>
Boot script timeout (1000ms resolution): 10
Use BOOTP for network configuration: false
Gateway IP address:
Local IP address: 192.168.1.254
Local IP address mask: 255.255.255.0
Default server IP address:
Console baud rate: 9600
GDB connection port: 9000
Force console for special debug messages: false
Network debug at boot time: false
Update RedBoot non-volatile configuration - continue (y/n)? y
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
RedBoot> reset

Now you may access to dd-wrt page via 192.168.1.1 with wireless.
Or you can access via 169.254.255.1 with ethernet port.