Sat Mar 9 09:10:25 EST 2013
Playing with CFE
The usual 'HDR0' trx doesn't work:
CFE> flash 192.168.6.8:zuk.trx flash0.os
flash 192.168.6.8:zuk.trx flash0.os
Reading 192.168.6.8:zuk.trx: Done. 2887680 bytes read
Invalid header seal. This is not a CFE flash image.
*** command status = -1
Trying with "flash -noheader" works, but then it gives:
Boot program checksum is invalid
So it looks like the magic needs to be set correctly.
# hd 7301.header
00000000 22 03 10 20 |".. |
# Patch trx from trunk build by overwriting the first 4 bytes with
# different magic.
cp openwrt-brcm47xx-squashfs.trx 7301.trx
dd if=7301.header of=7301.trx conv=notrunc
# On CFE
ifconfig eth0 -addr=192.168.6.99 -mask=255.255.255.0
flash 192.168.6.8:7301.trx flash0.os
This doesn't work. Probably CRC covers the header magic too.
EDIT: it works with device flash1.trx (see below)
kernel loads but doesn't boot properly
Once flashed like this, it won't boot but will listen for tftp put,
i.e. run this on server:
atftp --trace --option "timeout 1" --option "mode octet" --put --local-file 4716.trx 192.168.2.1
I wonder what the difference is between these two.
Here it mentions to run "tftpd" command on CFE prompt. This
The command "show devices" doesn't work either. It seems the CFE is
seriously stripped down.
Going to try to flash to flash0.trx
It seems reasonably safe, looking at device map from another device:
flash0.boot New CFI flash at 1C000000 offset 00000000 size 256KB
flash0.trx New CFI flash at 1C000000 offset 00040000 size 1KB
flash0.os New CFI flash at 1C000000 offset 0004001C size 7904KB
flash0.nvram New CFI flash at 1C000000 offset 007F8000 size 32KB
flash1.boot New CFI flash at 1C000000 offset 00000000 size 256KB
flash1.trx New CFI flash at 1C000000 offset 00040000 size 7904KB
flash1.nvram New CFI flash at 1C000000 offset 007F8000 size 32KB
flash0 New CFI flash at 1C000000 size 8192KB
The os is 1C bytes into the TRX header, which makes sense. flash0.trx
didn't work, but this one worked:
flash -noheader 192.168.2.2:4716.trx flash1.trx
But boot still says it's loading from flash0.os
Next? Maybe wait until manoj reply.. Once it is ported to current
trunk the work itself can be incremental.
Learning the process itself might take a long time .