HOWTO:Backup your router
When experimenting with kernels, you may find yourself corrupting the router and having to recover from a known good state. It is a good idea to make a copy of the CFE when it is in its original factory configuration for if and when. Here are a few different methods depending on your resources:
If you are running a relatively recent version of dd-wrt, you can download the CFE from the web interface.
To backup the CFE from within the CFE itself you need an active serial console and a live network connection to a TFTP server. On the TFTP server, create a file for the backup image. It must be world writable. If you do not pre-create the file for the TFTP client, the backup may fail. We name and label our routers to keep them straight. Consider naming the backup image after each router's hostname if you have many of them.
user@xinuserver:tftpboot$ touch routername.cfe user@xinuserver:tftpboot$ chmod a+w routername.cfe
If necessary, configure the network interface and check the connection to your TFTP server (192.168.6.10 in this example):
CFE> ifconfig eth0 -auto Device eth0: hwaddr 00-1E-E5-86-02-7A, ipaddr 192.168.6.122, mask 255.255.255.0 gateway 192.168.6.50, nameserver 184.108.40.206, domain xinu.mu.edu *** command status = 0 CFE> ping 192.168.6.10 192.168.6.10 (192.168.6.10) is alive 192.168.6.10 (192.168.6.10): 1 packets sent, 1 received *** command status = 0
Save the CFE region to the file you created on the TFTP server:
CFE> save 192.168.6.10:routername.cfe BC000000 40000 262144 bytes written to 192.168.6.10:routername.cfe *** command status = 0
Note: You can also save the entire flash image (CFE+Kernel+NVRAM) by passing 400000 as the length instead of 40000. This isn't really necessary, but you might find it referenced elsewhere. If you have to recover via JTAG it will take a LONG time to restore the entire flash image. It is much more efficient to load just the CFE, then upload the kernel via TFTP and use a factory reset to restore NVRAM.
Use the -probeonly option to figure out what options TJTAG needs for your particular setup.
Backup the CFE with TJTAG:
user@host:tjtag$ ./tjtag -backup:cfe /wiggler /noemw /noreset
TJTAG will create a CFE.BIN file with some sort of timestamp identifier appended to the filename. Rename and store somewhere safe.