Differences between revisions 7 and 8
Revision 7 as of 2010-10-04 23:40:16
Size: 2223
Comment:
Revision 8 as of 2012-11-11 22:46:32
Size: 2224
Comment: make it more paste-able in my personal flashing environment
Deletions are marked like this. Additions are marked like this.
Line 17: Line 17:
CFE> flash -noheader 192.168.0.7:wgt634u/openwrt.bin flash0.os ; reboot CFE> flash -noheader 192.168.80.7:wgt634u/openwrt.bin flash0.os ; reboot

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

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 ; reboot

From the running system:

cd /tmp
scp russell@192.168.0.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
CFE> flash -noheader 192.168.0.7:wgt634u/nvram.img flash0.nvram ; reboot

WgtRecovery (last edited 2022-06-10 22:37:01 by RussellSenior)