Installing OpenWRT on an Actiontec GT701WG

WARNING: Make sure you do not touch mtd2 (which contains ADAM2, the bootloader) under any circumstances, as you will most likely brick your router.
Continue at your own risk: I disclaim any responsibility for damage done to your device by following these instructions.

References:

GT704WG (Similar Model)
GT701D (Similar Model)
Old Wiki Entry on GT701WG

Flash Maps

Original Flash Map

Partition Start End Description
mtd2 0x90000000 0x90010000 ADAM2
mtd1 0x90010000 0x900d0000 Kernel
mtd0 0x900d0000 0x903e0000 SquashFS Filesystem
mtd4 0x903e0000 0x903f0000 Unused
mtd3 0x903f0000 0x90400000 ADAM2 Config

Modified Flash Map

Partition Start End Description
mtd2 0x90000000 0x90010000 ADAM2
mtd1 0x90010000 0x900d0000 Placeholder
mtd0 0x900d0000 0x903e0000 Placeholder
mtd4 0x903e0000 0x903f0000 Placeholder
mtd5 0x90010000 0x903f0000 SquashFS Filesystem (Spanned from mtd1-mtd4)
mtd3 0x903f0000 0x90400000 ADAM2 Config

Note: The original mtd partitions must remain intact on this model. The one I have freaked out when I removed any of them, hanging with red light and refused to boot OpenWRT. To workaround this, we create a spanned mtd5 on which we will install OpenWRT.

Installing OpenWRT

The best method of doing this is to use ADAM2's FTP server, which is accessible during the first few seconds of the boot process at the static ip 192.168.0.1.
I can confirm that the SquashFS versions of both Backfire and Attitude Adjustment are working with this router. However, I would recommend Backfire, since Attitude Adjustment uses a LOT more RAM and you might have issues with running out of it on this device.
If you're getting a connection error, turn off iptables (or whatever firewall you use). A restrictive-by-default can block some of the required ports for this operation.
Transfer Speeds will be Painfully slow (~512 bytes/min) without this command:
# echo 0 > /proc/sys/net/ipv4/tcp_frto
$ ftp 192.168.0.1
Connected to 192.168.0.1. 
220 ADAM2 FTP Server ready. 
Name (192.168.0.1:user): adam2 
331 Password required for adam2. 
Password: adam2
230 User adam2 successfully logged in. 
Remote system type is UNIX. 
ftp> quote SETENV mtd5,0x90010000,0x903f0000
200 SETENV command successful
ftp> quote SETENV MAC_PORT,0
200 SETENV command successful
ftp> binary 
200 Type set to I. 
ftp> quote MEDIA FLSH 
200 Media set to FLSH.
ftp> put openwrt-ar7-squashfs.bin "openwrt-ar7-squashfs.bin mtd5"
200 Port command successful. 
150 Opening BINARY mode data connection for file transfer. 
226 Transfer complete. 
3145732 bytes sent in 29.5 seconds (106544 bytes/s) 
ftp> quote REBOOT 
221-Thank you for using the FTP service on ADAM2. 
221 Goodbye. 
ftp> quit

Restoring Default Partition Map

If you mess up mtd3, you can recreate it here as well. Refer to the flash map above and just run a SETENV for it.
Similar to the FTP during installation, this is available during the first few seconds of boot at the static ip 192.168.0.1.
$ telnet 192.168.0.1 21
Trying 192.168.0.1... 
Connected to 192.168.0.1. 
Escape character is '^]'. 
220 ADAM2 FTP Server ready. 
USER adam2 
331 Password required for adam2. 
PASS adam2 
230 User adam2 successfully logged in. 
UNSETENV mtd5
UNSETENV MAC_PORT
SETENV mtd0,0x900d0000,0x903e0000
SETENV mtd1,0x90010000,0x900d0000
SETENV mtd4,0x903e0000,0x903f0000

Restoring the Default Firmware

First, Follow the procedure for restoring the default partiton map. If you weren't messing with mtd3, this process will work.
If you messed up mtd3, you will need access to a Windows computer to follow the directions Here rather than the following commands.
You can obtain the original firmware Here, which contains 'nsp.ar7wrd.squashfs.img' and 'ram_zimage_pad.ar7wrd.nsp.squashfs.bin', the files you'll need to restore your firmware.
Transfer Speeds will be Painfully slow (~512 bytes/min) without this command:
# echo 0 > /proc/sys/net/ipv4/tcp_frto
$ ftp 192.168.0.1
Connected to 192.168.0.1. 
220 ADAM2 FTP Server ready. 
Name (192.168.0.1:user): adam2 
331 Password required for adam2. 
Password: adam2
230 User adam2 successfully logged in. 
Remote system type is UNIX. 
ftp> binary 
200 Type set to I. 
ftp> quote MEDIA FLSH 
200 Media set to FLSH.
ftp> put nsp.ar7wrd.squashfs.img "nsp.ar7wrd.squashfs.img mtd0"
ftp> put ram_zimage_pad.ar7wrd.nsp.squashfs.bin "ram_zimage_pad.ar7wrd.nsp.squashfs.bin mtd1"
ftp> quote REBOOT 
221-Thank you for using the FTP service on ADAM2. 
221 Goodbye. 
ftp> quit