you are right, nacide.
although my problem happens with nios2-download program,
it is also the byte alignment issue.
after tracing the booting process,
i found that if the size of generated vmlinux.bin.gz (in linux-2.6.x/arch/nios2nommu/boot/compressed/) is odd,
i will get "length error" during uncompressing kernel.
it is because that in function gunzip (linux-2.6.x/lib/inflate.c),
it always gets wrong length value when size of vmlinux.bin.gz is odd.
orig_crc[23:00] is correct, but orig_crc[31:24](the last byte we get) is wrong.
the length value in zImage is correct, but it gets wrong value during uncompressing.
what i did is trying to add some spaces at the end of .data section in linux-2.6.x/arch/nios2nommu/boot/compressed/vmlinux.scr in order to make sure that we can get correct orig_crc[31:24] byte without byte alignment issue.
SECTIONS
{
.data : {
input_len = .;
LONG(input_data_end - input_data) input_data = .;
*(.data)
input_data_end = .;
LONG(0) /* for byte alignment issue */
}
}
now i can always get the workable image after that patch.
http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/cool.gif
here are steps i do to generate image.
1. make clean vendor_hwselect SYSPTF=~/project/ptf/nios2.ptf
2. make romfs
3. make
4. make linux image