This is some kind of continuation of:
WNDR4500: OpenWRT freezing at "Starting program at 0x80001000"
after more experiment and getting some knowledge about the problem.

===

The short summary:
1) When I prepare vmlinux.elf using
mipsel-openwrt-linux-uclibc-objcopy without -O, it works. I can share
such a image using tftpd and my laptop and boot from it using CFE tftp
client on WNDR4500
2) When I prepare trx and then chk from that vmlinux, it doesn't work.
Installing such a .chk works fine, all data are correctly written to
the 2nd flash, but it doesn't boot. It hangs like that:
Checking crc...Loader:raw Filesys:raw Dev:nflash0.os File: Options:(null)
Loading: ........ 4630972 bytes read
Entry at 0x80001000
Closing network.
Starting program at 0x80001000

The simplest (and most obvious) conclusion is that vmlinux is alright,
but we can't make correct .chk image file. Not so easy...

===

I've decided to give OpenWRT chance to make .chk image using vmlinux
from official Netgear's firmware. So I've just replaced path to
vmlinux and used same tools, same commands OpenWRT does use normally.
I've ever used mipsel-openwrt-linux-uclibc-objcopy from OpenWRT's
directory!
Then I've uploaded such a .chk image and booted from flash memory. It worked!

Checking crc...Loader:raw Filesys:raw Dev:nflash0.os File: Options:(null)
Loading: ....... 3784838 bytes read
Entry at 0x80001000
Closing network.
Starting program at 0x80001000
Linux version 2.6.22 (za...@linux-bxwm.site) (gcc version 4.2.4) #223
Sun Aug 26 00:30:09 CEST 2012

Conclusion: OpenWRT tools and image build process is alright!

===

Another test was to use Netgear's tools to package OpenWRT's vmlinux.
I've used mipsel-uclibc-linux26-objcopy from Netgear buildsystem, same
for "lzma", "trx" and "packet". I've just replaced Netgear's vmlinux
with OpenWRT's vmlnux.
Finally I've uploaded .chk generated with Netgear's tools and... it didn't work.

Checking crc...Loader:raw Filesys:raw Dev:nflash0.os File: Options:(null)
Loading: ........ 4630372 bytes read
Entry at 0x80001000
Closing network.
Starting program at 0x80001000

Conclusion: Using Netgear tools doesn't help, vmlinux from OpenWRT
still doesn't work

===

So we have two inconsistent conclusions here. Thanks to testing
booting from tftp and elf, we can assume OpenWRT's vmlinux is alright.
On the other hand packaging the same vmlinux with Netgear's tools
results in non-bootable kernel.

Do you have any idea what may be wrong? Is that possible for vmlinux
to be so specific, that it's bootable using tftp and elf, but isn't
bootable anymore after putting it compressed on flash memory?

I'm not sure how I can compare vmlinux files for possible differences.
Some quick test has shown:

> file /home/zajec/openwrt.git/build_dir/linux-brcm47xx/linux-3.3.8/vmlinux
/home/zajec/openwrt.git/build_dir/linux-brcm47xx/linux-3.3.8/vmlinux:
ELF 32-bit LSB executable, MIPS, MIPS32 version 1 (SYSV), statically
linked, BuildID[sha1]=0x5a4549b6018a9465864a805af9ffebf1f1f40701, with
unknown capability 0xf41 = 0x756e6700, with unknown capability 0x70100
= 0x3040000, not stripped

> file /home/zajec/tmp/WNDR4500-V1.0.0.58_1.0.13_src/src/linux/linux-2.6/vmlinux
/home/zajec/tmp/WNDR4500-V1.0.0.58_1.0.13_src/src/linux/linux-2.6/vmlinux:
ELF 32-bit LSB executable, MIPS, MIPS32 version 1 (SYSV), statically
linked, stripped

Does it mean anything? Can that BuildID/unknown capability be a source
of problem?

-- 
Rafał
[ELF]
/home/zajec/openwrt.git/staging_dir/toolchain-mipsel_gcc-4.6-linaro_uClibc-0.9.33.2/bin/mipsel-openwrt-linux-uclibc-objcopy
 \
        -R .reginfo -R .notes -R .note -R .comment -R .mdebug -R 
.note.gnu.build-id -S \
        /home/zajec/openwrt.git/build_dir/linux-brcm47xx/linux-3.3.8/vmlinux \
        /home/zajec/openwrt.git/bin/brcm47xx/openwrt.elf
/home/zajec/openwrt.git/staging_dir/toolchain-mipsel_gcc-4.6-linaro_uClibc-0.9.33.2/bin/mipsel-openwrt-linux-uclibc-objcopy
 \
        -R .reginfo -R .notes -R .note -R .comment -R .mdebug -R 
.note.gnu.build-id -S \
        
/home/zajec/tmp/WNDR4500-V1.0.0.58_1.0.13_src/src/linux/linux-2.6/vmlinux \
        /home/zajec/openwrt.git/bin/brcm47xx/netgear.elf


[HACK #1] tools:OpenWRT, vmlinux:Netgear
/home/zajec/openwrt.git/staging_dir/toolchain-mipsel_gcc-4.6-linaro_uClibc-0.9.33.2/bin/mipsel-openwrt-linux-uclibc-objcopy
 \
        -O binary -R .reginfo -R .notes -R .note -R .comment -R .mdebug -R 
.note.gnu.build-id -S \
        
/home/zajec/tmp/WNDR4500-V1.0.0.58_1.0.13_src/src/linux/linux-2.6/vmlinux \
        /home/zajec/wndr4500/vmlinux-hack.bin
/home/zajec/openwrt.git/staging_dir/host/bin/lzma e -so -d16 
/home/zajec/wndr4500/vmlinux-hack.bin > /home/zajec/wndr4500/vmlinux-hack.lzma
/home/zajec/openwrt.git/staging_dir/host/bin/trx \
        -o /home/zajec/wndr4500/vmlinux-hack.trx \
        -f /home/zajec/wndr4500/vmlinux-hack.lzma \
        -a 1024 \
        -f /home/zajec/openwrt.git/build_dir/linux-brcm47xx/root.squashfs \
        -a 0x10000 \
        -A /home/zajec/openwrt.git/build_dir/linux-brcm47xx/fs_mark
/home/zajec/openwrt.git/staging_dir/host/bin/mkchkimg \
        -o /home/zajec/wndr4500/vmlinux-hack.chk \
        -k /home/zajec/wndr4500/vmlinux-hack.trx \
        -b U12H189T00_NETGEAR \
        -r 1


[HACK #2] tools:Netgear, vmlinux:OpenWRT
/projects/hnd/tools/linux/hndtools-mipsel-uclibc-4.2.4/bin/mipsel-uclibc-linux26-objcopy
 \
        -O binary -g \
        /home/zajec/openwrt.git/build_dir/linux-brcm47xx/linux-3.3.8/vmlinux \
        /home/zajec/wndr4500/vmlinux-hack.bin
/home/zajec/tmp/WNDR4500-V1.0.0.58_1.0.13_src/tools/lzma e \
        /home/zajec/wndr4500/vmlinux-hack.bin \
        /home/zajec/wndr4500/vmlinux-hack.lzma
/home/zajec/tmp/WNDR4500-V1.0.0.58_1.0.13_src/tools/trx \
        -o /home/zajec/wndr4500/vmlinux-hack.trx \
        /home/zajec/wndr4500/vmlinux-hack.lzma \
        
/home/zajec/tmp/WNDR4500-V1.0.0.58_1.0.13_src/src/router/mipsel-uclibc/target.squashfs
touch /home/zajec/wndr4500/rootfs
cd /home/zajec/wndr4500/
/home/zajec/tmp/WNDR4500-V1.0.0.58_1.0.13_src/tools/packet \
        -k vmlinux-hack.trx \
        -f rootfs \
        -b 
../tmp/WNDR4500-V1.0.0.58_1.0.13_src/src/router/mipsel-uclibc/compatible_WNDR4500rev.txt
 \
        -ok kernel_image \
        -oall kernel_rootfs_image \
        -or rootfs_image \
        -i ../tmp/WNDR4500-V1.0.0.58_1.0.13_src/project/acos/include/ambitCfg.h


[OpenWRT]
mipsel-openwrt-linux-uclibc-objcopy -O binary -R .reginfo -R .notes -R .note -R 
.comment -R .mdebug -R .note.gnu.build-id -S \
        /home/zajec/openwrt.git/build_dir/linux-brcm47xx/linux-3.3.8/vmlinux \
        /home/zajec/openwrt.git/build_dir/linux-brcm47xx/vmlinux
/home/zajec/openwrt.git/staging_dir/host/bin/lzma e -so -d16 
/home/zajec/openwrt.git/build_dir/linux-brcm47xx/vmlinux > \
        /home/zajec/openwrt.git/build_dir/linux-brcm47xx/vmlinux-wndr4500.lzma
/home/zajec/openwrt.git/staging_dir/host/bin/trx \
        -o 
/home/zajec/openwrt.git/bin/brcm47xx/openwrt-brcm47xx-squashfs-noloader-wndr4500.trx
 \
        -f 
/home/zajec/openwrt.git/build_dir/linux-brcm47xx/vmlinux-wndr4500.lzma \
        -a 1024 \
        -f /home/zajec/openwrt.git/build_dir/linux-brcm47xx/root.squashfs \
        -a 0x10000 \
        -A /home/zajec/openwrt.git/build_dir/linux-brcm47xx/fs_mark
/home/zajec/openwrt.git/staging_dir/host/bin/mkchkimg \
        -o /home/zajec/openwrt.git/bin/brcm47xx/openwrt-wndr4500-squashfs.chk \
        -k 
/home/zajec/openwrt.git/bin/brcm47xx/openwrt-brcm47xx-squashfs-noloader-wndr4500.trx
 \
        -b U12H189T00_NETGEAR \
        -r 1


[Netgear]
mipsel-uclibc-linux26-objcopy -O binary -g \
        
/home/zajec/tmp/WNDR4500-V1.0.0.58_1.0.13_src/src/linux/linux-2.6/vmlinux \
        
/home/zajec/tmp/WNDR4500-V1.0.0.58_1.0.13_src/src/router/mipsel-uclibc/vmlinux.bin
../../tools/lzma e 
/home/zajec/tmp/WNDR4500-V1.0.0.58_1.0.13_src/src/router/mipsel-uclibc/vmlinux.bin
 
/home/zajec/tmp/WNDR4500-V1.0.0.58_1.0.13_src/src/router/mipsel-uclibc/vmlinux.lzma
trx -o 
/home/zajec/tmp/WNDR4500-V1.0.0.58_1.0.13_src/src/router/mipsel-uclibc/linux.trx
 \
        
/home/zajec/tmp/WNDR4500-V1.0.0.58_1.0.13_src/src/router/mipsel-uclibc/vmlinux.lzma
 \
        
/home/zajec/tmp/WNDR4500-V1.0.0.58_1.0.13_src/src/router/mipsel-uclibc/target.squashfs
rm -f 
/home/zajec/tmp/WNDR4500-V1.0.0.58_1.0.13_src/src/router/mipsel-uclibc/vmlinux.bin
 
/home/zajec/tmp/WNDR4500-V1.0.0.58_1.0.13_src/src/router/mipsel-uclibc/vmlinux.lzma

cd /home/zajec/tmp/WNDR4500-V1.0.0.58_1.0.13_src/src/router/mipsel-uclibc && 
touch rootfs && \
../../../tools/packet \
        -k linux.trx \
        -f rootfs \
        -b compatible_WNDR4500rev.txt \
        -ok kernel_image \
        -oall kernel_rootfs_image \
        -or rootfs_image \
        -i ../../../project/acos/include/ambitCfg.h
cp kernel_rootfs_image.chk WNDR4500REV_`date +%m%d%H%M`.chk
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to