Different zlib CRC Algorithms
Joakim Tjernlund
joakim.tjernlund at lumentis.se
Tue Feb 4 11:24:05 EST 2003
> mkfs.jffs2 is linked against -lz but first links in crc32.o from the mtd tree,
> ie. it seems to be using the kernel zlib not the userspace zlib (at least for
> crc32()).
>
> I found this putting together my bootloader JFFS2 reader which I'm doing first
> as a Linux application - and so using userspace zlib. I have to calculate the
> CRC as follows...
>
> crc = (crc32(crc ^ 0xffffffff),buf,len) ^ 0xffffffff);
>
> ...otherwise all the CRC checks fail.
What bootloader? If ppcboot/uboot I think you will find that
ppcboot/uboot has 2 versions of crc32 and you are using the
wrong one?
Jocke
More information about the linux-mtd
mailing list