Sometimes development OpenWrt will smash some things on the Wgt's flash that prevent it from booting. Currently (circa July 30, 2010), r22409 is corrupting the nvram partition on flash, which prevents CFE from booting the image. An image built in April, r21175 is okay. I am about to attempt bisecting the problem to discover where/why it goes haywire.
To recover from the missing NVRAM, you need to restore some settings from CFE using setenv -p, like so (adjust your macaddrs appropriately):
CFE> setenv -p STARTUP "ifconfig eth0 -addr=192.168.1.1 -mask=255.255.255.0; boot -elf flash0.os:" CFE> setenv -p kernel_args "console=ttyS1,115200 root=/dev/ram0 init=/linuxrc rw syst_size=8M" CFE> setenv -p et0phyaddr 254 CFE> setenv -p et0mdcport 0 CFE> setenv -p configvlan 0x1 CFE> setenv -p et0macaddr 00-0f-b5-3d-58-b6 CFE> setenv -p et1macaddr 00-0f-b5-3d-58-b7
Or, more easily pasted as:
CFE> setenv -p STARTUP "ifconfig eth0 -addr=192.168.1.1 -mask=255.255.255.0; boot -elf flash0.os:"; setenv -p kernel_args "console=ttyS1,115200 root=/dev/ram0 init=/linuxrc rw syst_size=8M" ; setenv -p et0phyaddr 254 ; setenv -p et0mdcport 0 ; setenv -p configvlan 0x1 ; setenv -p et0macaddr 00-0f-b5-3d-58-b6 ; setenv -p et1macaddr 00-0f-b5-3d-58-b7
When nvram is patched, you can reflash by rebooting to CFE, interrupting with Ctrl-C, and the following CFE commands:
CFE> ifconfig eth0 -auto CFE> flash -noheader 192.168.80.7:wgt634u/openwrt.bin flash0.os CFE> reboot
or:
CFE> ifconfig eth0 -auto ; flash -noheader 192.168.80.7:wgt634u/openwrt.bin flash0.os ; reboot
or, if your image is too big:
CFE> flash -noheader 192.168.80.7:wgt634u/part1.img flash0.os CFE> flash -noheader -offset=3932160 192.168.80.7:wgt634u/part2.img flash0.os
or:
ifconfig eth0 -auto ; flash -noheader 192.168.80.7:wgt634u/part1.img flash0.os ; flash -noheader -offset=3932160 192.168.80.7:wgt634u/part2.img flash0.os ; reboot
From the running system:
cd /tmp scp russell@192.168.80.7:/tmp/mtdblock4.img /tmp/ mtd write /tmp/mtdblock4.img mtd4
or, for a new test image from iris:
cd /tmp scp russell@iris.personaltelco.net:src/openwrt-git/openwrt/bin/brcm47xx/openwrt-brcm47xx-squashfs.trx /tmp/ mtd -r write openwrt-brcm47xx-squashfs.trx linux
(the macaddrs will be wrong again, because the mtdblock4.img probably has the wrong ones, but it'll let you try the next bisection anyway)
- r22442 = console
- r22474 = console
- r22475 = console
- r22596 = console
- r22646 = console
- r22658 = console
- r22663 = no-console
- r22669 = no-console
- r22757 = no-console
To expedite things, it is possible to rewrite just the last 8K of flash with this:
CFE> setenv -p et0phyaddr 254 CFE> setenv -p et0mdcport 0 CFE> setenv -p configvlan 0x1 CFE> setenv -p et0macaddr 00-09-5b-f7-0d-da CFE> setenv -p et1macaddr 00-09-5b-f7-0d-db CFE> reboot
then:
CFE> ifconfig eth0 -auto ; flash -noheader 192.168.80.7:wgt634u/nvram.img flash0.nvram ; reboot

