mkfs.ubifs gives corrupt images/crc errors

Artem Bityutskiy dedekind1 at gmail.com
Thu Sep 2 13:40:53 EDT 2010


On Thu, 2010-09-02 at 19:28 +0200, Leo Barnes wrote:
> Sorry for not answering earlier, I was on vacation without internet
> access. I have not tested the absolutely latest commits, but I have
> now identified the problem.
> 
> In commit 2d40ed7b415bcb6a358c9f221160c4a419f01f19, the
> crc-calculation function changed from being an inline function to a
> linked function called crc32. There already exists a crc32 function
> with the same arguments in ZLIB, which does not seem to give the same
> checksums as the mtd-utils crc-function. After the mentioned commit,
> mkfs.ubifs seems to use the ZLIB crc32-function instead of the
> mtd-utils version which is what gives the faulty checksums.
> 
> I managed to fix this in two simple ways:
> 1. Change the order of linking in the makefile so that libmtd comes
> before libz. This might possibly break ZLIB (I have not tried this
> when using ZLIB).
> 2. Change the name of the mtd-utils crc32 function.
> 
> Changing the name of the function is probably the preferred option.

Right, another guy reported the same issue a couple of days ago and I
fixed this.

-- 
Best Regards,
Artem Bityutskiy (Битюцкий Артём)




More information about the linux-mtd mailing list