All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] mkfs.jffs2 image is not usable
@ 2010-10-13  4:53 H Hartley Sweeten
  2010-10-13 12:06 ` Gustavo Zacarias
  0 siblings, 1 reply; 8+ messages in thread
From: H Hartley Sweeten @ 2010-10-13  4:53 UTC (permalink / raw)
  To: buildroot

Hello all,

With the latest git of buildroot I have been unable to create a rootfs.jffs2
image that is usable on my i.mx35 arm platform.  But, the same $(TARGET_DIR)
created as a cpio image is usable when mounted as a nfs based rootfs.

When I try using the jffs2 image I get error messages during the kernel boot
like:

jffs2_scan_eraseblock(): Node at 0x00000000 {0x1985, 0x2003, 0x0000000c) has invalid CRC 0x813c6fd8 (calculated 0xe41eb0b1)
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000004: 0x000c instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000008: 0x6fd8 instead
jffs2_scan_eraseblock(): Node at 0x0000000c {0x1985, 0xe001, 0x0000002b) has invalid CRC 0x1804b18f (calculated 0x7d266ee6)
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000010: 0x002b instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000014: 0xb18f instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000018: 0x0001 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000020: 0x0002 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000024: 0x1a8d instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000028: 0x0403 instead
Further such events for this erase block will not be printed
Old JFFS2 bitmask found at 0x00000078
You cannot use older JFFS2 filesystems with newer kernels
Empty flash at 0x0000a46c ends at 0x0000a470

I have an older jffs2 image that works fine but I'm not sure when I created
it and what might have changed in buildroot.

I'm using the same steps in RedBoot to program the images so the problem is
not in the writing of the image to flash.

I have also tried manually creating the jffs2 image using mkfs.jffs2 from
${HOST_DIR)/usr/sbin.  That image give me error messages similar to the
ones above.  Interestingly, the two image files differ in size slightly.

I also tried installing the mtd utils locally on my Debian system and then
created the jffs2 image using /usr/sbin/mkfs.jffs2.  This image is the
same size as the one manually created using the $(HOST_DIR) one, but the
files are very different.  When I boot with that image I don't get any
error messages by the kernel boot hangs after:

Freeing init memory: 208K

Can anyone offer some ideas of suggestions?

Thanks,
Hartley

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] mkfs.jffs2 image is not usable
  2010-10-13  4:53 [Buildroot] mkfs.jffs2 image is not usable H Hartley Sweeten
@ 2010-10-13 12:06 ` Gustavo Zacarias
  2010-10-13 19:07   ` H Hartley Sweeten
  0 siblings, 1 reply; 8+ messages in thread
From: Gustavo Zacarias @ 2010-10-13 12:06 UTC (permalink / raw)
  To: buildroot

On 10/13/10 01:53, H Hartley Sweeten wrote:

> I also tried installing the mtd utils locally on my Debian system and then
> created the jffs2 image using /usr/sbin/mkfs.jffs2.  This image is the
> same size as the one manually created using the $(HOST_DIR) one, but the
> files are very different.  When I boot with that image I don't get any
> error messages by the kernel boot hangs after:
> 
> Freeing init memory: 208K
> 
> Can anyone offer some ideas of suggestions?
> 
> Thanks,
> Hartley

Did you check that the flash geometry (page size / erase size) match the
flash device on your board? That would make the jffs2 image different in
content but not much in size as you see.
It's the "flash type" option in buildroot.
Parallel flash = NOR.
AT45 = SPI DataFlash from Atmel.
NAND flash = the usual these days.
Or you can go the custom way if one of the predetermined values doesn't
match your flash device.
Regards.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] mkfs.jffs2 image is not usable
  2010-10-13 12:06 ` Gustavo Zacarias
@ 2010-10-13 19:07   ` H Hartley Sweeten
  2010-10-14 20:17     ` Peter Korsgaard
  2010-10-14 20:20     ` Peter Korsgaard
  0 siblings, 2 replies; 8+ messages in thread
From: H Hartley Sweeten @ 2010-10-13 19:07 UTC (permalink / raw)
  To: buildroot

On Wednesday, October 13, 2010 5:06 AM, Gustavo Zacarias wrote:
> On 10/13/10 01:53, H Hartley Sweeten wrote:
>> I also tried installing the mtd utils locally on my Debian system and then
>> created the jffs2 image using /usr/sbin/mkfs.jffs2.  This image is the
>> same size as the one manually created using the $(HOST_DIR) one, but the
>> files are very different.  When I boot with that image I don't get any
>> error messages by the kernel boot hangs after:
>> 
>> Freeing init memory: 208K
>> 
>> Can anyone offer some ideas of suggestions?
>
> Did you check that the flash geometry (page size / erase size) match the
> flash device on your board? That would make the jffs2 image different in
> content but not much in size as you see.
> It's the "flash type" option in buildroot.
> Parallel flash = NOR.
> AT45 = SPI DataFlash from Atmel.
> NAND flash = the usual these days.
> Or you can go the custom way if one of the predetermined values doesn't
> match your flash device.

The flash geometry settings should be the same as when I made the jffs2 image
that does work.  But, for the record, the flash is a parallel 4kB pagesize
and 128 kB erase size.

Buildroot makes my jffs2 image with the basically the following command
passed top fakeroot:

$(HOST_DIR)/usr/sbin/mkfs.jffs2 -e 0x20000 -l -s 0x1000 -d $(TARGET_DIR) -o $(BINARIES_DIR)/rootfs.jffs2

I manually used the same commands with both the mkfs.jffs2 in the $(HOST_DIR)
and the one installed locally in my /usr/sbin/.  All three make repeatable
images, but all three are different sizes.  The two created with the
$(HOST_DIR) mkfs.jffs2 hang the boot with the error messages then a Kernel
canic and the one created from mu local mkfs.jffs2 hangs the kernel after
Freeing init memory.

I re-pulled the latest buildroot this morning and tried building everything
from scratch with the same results.

One other item, I can manually mount the rootfs.jffs2 created by my local
mkfs.jffs2 on my host machine but the other two give me the error messages.

I mounted the images with the following:

sudo modprobe mtd
sudo modprobe jffs2
sudo modprobe mtdram totalsize=32768 erase_size=256
sudo modprobe mtdchar
sudo modprobe mtdblock
sudo dd if=rootfs.jffs2 of=/dev/mtd0
mkdir temp
sudo mount -t jffs2 /dev/mtdblock0 temp

Suggestions?

Regards,
Hartley

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] mkfs.jffs2 image is not usable
  2010-10-13 19:07   ` H Hartley Sweeten
@ 2010-10-14 20:17     ` Peter Korsgaard
  2010-10-14 20:34       ` H Hartley Sweeten
  2010-10-14 20:20     ` Peter Korsgaard
  1 sibling, 1 reply; 8+ messages in thread
From: Peter Korsgaard @ 2010-10-14 20:17 UTC (permalink / raw)
  To: buildroot

>>>>> "H" == H Hartley Sweeten <hartleys@visionengravers.com> writes:

Hi,

 H> The flash geometry settings should be the same as when I made the
 H> jffs2 image that does work.  But, for the record, the flash is a
 H> parallel 4kB pagesize and 128 kB erase size.

 H> sudo modprobe mtd
 H> sudo modprobe jffs2
 H> sudo modprobe mtdram totalsize=32768 erase_size=256

You should use the same erase_size here, E.G. 128KB.

 H> Suggestions?

Not really, do you have an old (working) image? If so, you could compare
the jffs2dump output of those.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] mkfs.jffs2 image is not usable
  2010-10-13 19:07   ` H Hartley Sweeten
  2010-10-14 20:17     ` Peter Korsgaard
@ 2010-10-14 20:20     ` Peter Korsgaard
  2010-10-14 20:46       ` H Hartley Sweeten
  1 sibling, 1 reply; 8+ messages in thread
From: Peter Korsgaard @ 2010-10-14 20:20 UTC (permalink / raw)
  To: buildroot

>>>>> "H" == H Hartley Sweeten <hartleys@visionengravers.com> writes:

 H> Suggestions?

You could also try going back to mtd-1.3.1, E.G. reverting
a9b783379271e - Maybe something is broken upstream?

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] mkfs.jffs2 image is not usable
  2010-10-14 20:17     ` Peter Korsgaard
@ 2010-10-14 20:34       ` H Hartley Sweeten
  0 siblings, 0 replies; 8+ messages in thread
From: H Hartley Sweeten @ 2010-10-14 20:34 UTC (permalink / raw)
  To: buildroot

On Thursday, October 14, 2010 1:17 PM, Peter Korsgaard wrote:
>>>>>> "H" == H Hartley Sweeten <hartleys@visionengravers.com> writes:
>
> Hi,
>
>> The flash geometry settings should be the same as when I made the
>> jffs2 image that does work.  But, for the record, the flash is a
>> parallel 4kB pagesize and 128 kB erase size.
>>
>> sudo modprobe mtd
>> sudo modprobe jffs2
>> sudo modprobe mtdram totalsize=32768 erase_size=256
>
> You should use the same erase_size here, E.G. 128KB.

Ah... You are correct. But, the working rootfs.jffs2 image does still mount.

>> Suggestions?
>
> Not really, do you have an old (working) image? If so, you could compare
> the jffs2dump output of those.

I do have an older image that works.

When I run jffs2dump -c on the working image the output does look like my
rootfs.  But when I run it on any of the non-working images I get stuff like:

Wrong hdr_crc  at  0x00000000, 0x813c6fd8 instead of 0xe41eb0b1
Wrong bitmask  at  0x00000004, 0x000c

Hartley

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] mkfs.jffs2 image is not usable
  2010-10-14 20:20     ` Peter Korsgaard
@ 2010-10-14 20:46       ` H Hartley Sweeten
  2010-10-14 21:06         ` Peter Korsgaard
  0 siblings, 1 reply; 8+ messages in thread
From: H Hartley Sweeten @ 2010-10-14 20:46 UTC (permalink / raw)
  To: buildroot

On Thursday, October 14, 2010 1:20 PM, Peter Korsgaard wrote:
>>>>>> "H" == H Hartley Sweeten <hartleys@visionengravers.com> writes:
>>
>> Suggestions?

> You could also try going back to mtd-1.3.1, E.G. reverting
> a9b783379271e - Maybe something is broken upstream?

That fixed the problem.

Reverting a9b783379271e allows me to create a jffs2 that works.

Regards,
Hartley

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] mkfs.jffs2 image is not usable
  2010-10-14 20:46       ` H Hartley Sweeten
@ 2010-10-14 21:06         ` Peter Korsgaard
  0 siblings, 0 replies; 8+ messages in thread
From: Peter Korsgaard @ 2010-10-14 21:06 UTC (permalink / raw)
  To: buildroot

>>>>> "H" == H Hartley Sweeten <hartleys@visionengravers.com> writes:

 H> On Thursday, October 14, 2010 1:20 PM, Peter Korsgaard wrote:
 >>>>>>> "H" == H Hartley Sweeten <hartleys@visionengravers.com> writes:
 >>> 
 >>> Suggestions?

 >> You could also try going back to mtd-1.3.1, E.G. reverting
 >> a9b783379271e - Maybe something is broken upstream?

 H> That fixed the problem.

 H> Reverting a9b783379271e allows me to create a jffs2 that works.

Ok, care to report the issue on the linux-mtd list?

http://lists.infradead.org/mailman/listinfo/linux-mtd/

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-10-14 21:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-13  4:53 [Buildroot] mkfs.jffs2 image is not usable H Hartley Sweeten
2010-10-13 12:06 ` Gustavo Zacarias
2010-10-13 19:07   ` H Hartley Sweeten
2010-10-14 20:17     ` Peter Korsgaard
2010-10-14 20:34       ` H Hartley Sweeten
2010-10-14 20:20     ` Peter Korsgaard
2010-10-14 20:46       ` H Hartley Sweeten
2010-10-14 21:06         ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.