Build Openwrt
=============
Get trunk build
svn checkout https://svn.openwrt.org/openwrt/trunk/ .
Configure and compile:
make
Get the resulting binary
./trunk/bin/openwrt-ar7-squashfs.bin
Prep the original DG834G(v2)
============================
Login via web and enable the telnet debug access:
http://192.168.0.1/setup.cgi?todo=debug
Telnet to the unit and set ADAM2's IP
echo "my_ipaddress 192.168.0.1" > /proc/sys/dev/adam2/environment
Set up a new partition mapping for the upcoming openwrt kernel:
echo "mtd5 0x90020000,0x903e0000" > /proc/sys/dev/adam2/environment
Start to backup the partitions:
cd /tmp/ ; mini_httpd -p 1080
cat /dev/mtdblock/0 > /tmp/mtd0.bin
cat /dev/mtdblock/1 > /tmp/mtd1.bin
cat /dev/mtdblock/2 > /tmp/mtd2.bin
cat /dev/mtdblock/3 > /tmp/mtd3.bin
cat /dev/mtdblock/4 > /tmp/mtd4.bin
Get them off onto a remote machine:
wget 192.168.0.1:1080/mtd{0,1,2,3,4}.bin
Check their md5sums: (V3.01.31)
ubuntu@ubuntu:~$ md5sum mtd*
f0f416c9a4ae22a1f3f97eaf66c3fc91 mtd0.bin
eff06c398966943975576cffdef2f0c7 mtd1.bin
0530bfdf00ec155f4182afd70da028c1 mtd2.bin
21f235faae279e147d41cf5622e75834 mtd3.bin
f63240ca1c3b6d87d9658ad884656794 mtd4.bin
Modify ADAM2 only if mtd2.bin == 0530bfdf00ec155f4182afd70da028c1
TODO Noodles:
It should result in a binary with an md5sum of d8a2f4623bf6f64b7427812f0e849aa7
Get the new image back onto the router using wget:
cd /tmp
wget http://192.168.0.3/mtd2.bin
dd if=mtd2.bin of=/dev/mtdblock/2
rm mtd2.bin
wget http://192.168.0.3/openwrt-ar7-squashfs.bin
dd if=openwrt-ar7-squashfs.bin of=/dev/mtdblock/5
rm openwrt-ar7-squashfs.bin
(2nd batch of commands takes around 30 sec)
Reboot
reboot
Same method using ADAM2
=======================
Connect RJ45 to router and as you power on the unit, issue:
sleep 2 ; ftp 192.168.0.1
Log in with adam2/adam2
Get the env settings
get env
Ensure a environment variable mtd5 spans the kernel and rootfs partion
ftp> quote GETENV mtd5
mtd5 0x90020000,0x903e0000
If not, set it:
quote SETENV mtd5,0x90020000,0x903e0000
Issue the commands (case sensitive)
type binary
hash
debug
quote MEDIA FLSH
put openwrt-ar7-2.6-squashfs.bin "openwrt-ar7-2.6-squashfs.bin mtd5"
quote REBOOT
(whole process takes ~ 30 sec)
Let the router come up, and then power it off and on again. This lets it write correctly any non-stardard IP settings.
YOU CANNNOT UPDATE ADAM2 using ADAM2!!!!!!
To Restore via ADAM2
====================
type binary
quote MEDIA FLSH
put mtd0.bin "mtd0.bin mtd0"
put mtd1.bin "mtd1.bin mtd1"
quote REBOOT
Setting up Openwrt
==================
Telnet to the router on 192.168.0.1 and set a root password
passwd
Append the following to /etc/config/network :
config interface wan
option ifname ppp0
option username "user@isp"
option password "password"
option proto pppoa
option mtu 1500
option mru 1500
option vpi 0
option vci 38
option encapsulation vc-encaps
Firmware can be found here:
http://acx100.sourceforge.net/wiki/Firmware
http://195.66.192.167/linux/acx100/acx111_airlinkplus_awlc3025/fw1/tiacx111c16
To Restore via Openwrt (not totally sure yet)
======================
ADAM2's view
mtd0 0x900d0000,0x903e0000 <---These both must be restored
mtd1 0x90020000,0x900d0000 <---
mtd2 0x90000000,0x90020000
mtd3 0x903e0000,0x903f0000
mtd4 0x903f0000,0x90400000
mtd5 0x90020000,0x903e0000
Openwrt's view
0x00000000-0x00010000 : "loader" (is this too short?)
0x003f0000-0x00400000 : "config" mtd4?
0x00020000-0x003f0000 : "linux" mtd5 (just over?)
0x000e24b4-0x003f0000 : "rootfs" latter parts of mtd5
We need to have the same map regions as ADAM2 to get the original firmware back on.
Conclusion, Openwrt's view of things may not be correct.
Serial Console:
==============
| led
| Pin 4: RX ----> () |
| Pin 3: VCC(3.3V)----> () |
| Pin 2: TX ----> () |
| Pin 1: GND ----> [] tick led Front of DG834G
| JP603 |
| power led
| |
|_______________________________________/
DATE AND TIME:
=============
In /etc/TZ
GMT+0BST-1,M3.5.0/01:00,M10.5.0/02:00
see http://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html
rdate -s 171.64.7.77