Broadcom CFE backup

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 13:17, 13 March 2018 (edit)
Jeremywh7 (Talk | contribs)
(by web interface (preferred method))
← Previous diff
Revision as of 18:13, 18 March 2018 (edit) (undo)
Ian5142 (Talk | contribs)
(Added Advanced tutorials category.)
Next diff →
Line 56: Line 56:
[[Category:jtag]] [[Category:jtag]]
[[Category:Low-level settings]] [[Category:Low-level settings]]
 +[[Category:Advanced tutorials]]

Revision as of 18:13, 18 March 2018


Contents

How to backup your CFE

So you're afraid you will ever need to use a backup of your CFE (bootloader) in case you brick your router sooner or later.

If you own a Linksys WRT54G/GL/GS and your CFE is already screwed, you could try the Skynet repairkit to make yourself a new one. CFEs for these and other various models may also be found at CFE collection project ("Old" Forum CFE collection project ).

There are several methods to backup the CFE, as follows:

by web interface (preferred method)

This methods works with since svn8428 (post-RC5). CFE backup is easy via web browser:

http://{router IP address}/backup/cfe.bin

E.g. the DD-WRT default IP address is 192.168.1.1 (adjust if you've changed it):

http://192.168.1.1/backup/cfe.bin

by telnet/SSH

this maybe works on other 3rd party firmwares, too. connect to the router via telnet or ssh (SSH must be enabled!) just enter the following command for all, except dd-wrt micro builds:

dd if=/dev/mtd/0 of=/tmp/cfe.bin

With v24 (mini and mega), paste that line into the Commands box on the Administration/Commands tab (Diagnostics.asp), and click the Run Commands button.

Then get the cfe.bin file from the /tmp directory with FTP, SFTP or SCP (using, for example, WinSCP).


On micro builds it's little more tricky:

cat /dev/mtd/0 > /tmp/www/cfe.jpg

Then point your browser to http://routerip/user/cfe.jpg and do a "save page as" cfe.bin to your disk drive. The resulting file should be 256K in size for a cfe.bin file.

Note: "/user/cfe.jpg" points to "/tmp/www/cfe.jpg"


You could do the same for mtd/1 (kernel, firmware), mtd/2 (jffs part if any) and mtd/3 (nvram)

by JTAG

this assumes you already have a JTAG-Adapter cable ready to use on your router, use the following command:

wrt54g -backup:cfe

you can do the same with the nvram, kernel, etc.

Restoring the CFE

by telnet/SSH

WARNING: Do not attempt to restore the CFE by telnet/SSH unless you know what you are doing and why you are doing it. If done incorrectly, this could render your router unbootable!

The following was tested and working on wl-500gp:

First copy your CFE into router's /tmp directory (using something like WinSCP or wget), then

mtd unlock cfe
mtd write -f /tmp/cfe_new.bin cfe

by JTAG

Use JTAG to restore the unit's CFE. For example,

tjtag -flash:cfe