2011-05-18 07:02:17 [2010R1-RC5] Add YAFFS2?
Gilles Ganault (FRANCE)
Message: 100720
Hello
YAFFS2 was still available in 2009R1-RC6 but isn't part of 2010R1-RC5. It looks like it was dropped and replaced with UBIFS.
Since I need to access a YAFFS2-formatted partition in the NAND, is there a way I can re-add YAFFS2 to the "Miscellaneous filesystems" section before recompiling a new image?
Thank you.
QuoteReplyEditDelete
2011-05-18 08:54:39 Re: [2010R1-RC5] Add YAFFS2?
Gilles Ganault (FRANCE)
Message: 100722
Alternatively, I tried JFFS2, and am having the following issues:
1. "flash_eraseall -j /dev/mtd2" is pretty slow (15mn to format a 256MB NAND): Is there a way to speed things up, eg. erasing from Uboot instead?
2. After running "mount -t jffs2 /dev/mtdblock2 /mnt", uClinux is stuck for a couple of minutes with the following message:
=========
...
MTD_ioctl
Erasing 128 Kibyte @ f800000 -- 100 % complete.MTD_close
> mount -t jffs2 /dev/mtdblock2 /mnt
MTDSB: lookup_bdev() returned 0
MTDSB: New superblock for device 2 ("file system(nand)")
=========
So I tried this instead, to no avail:
=========
root:~> mount -t jffs2 -o noatime /dev/mtdblock2 /mnt
MTDSB: lookup_bdev() returned 0
MTDSB: New superblock for device 2 ("file system(nand)")
=========
QuoteReplyEditDelete
2011-05-18 09:19:20 Re: [2010R1-RC5] Add YAFFS2?
Gilles Ganault (FRANCE)
Message: 100724
Good news: uClinux can now access the JFFS2-formatted /dev/mtdblock2 for its root filesystem :-) So the issue I had was not due to wrong settings in the board resources file, but rather lack of support for YAFFS2. Erasing + formatting the NAND partition as JFFS2 and copying the RAM root filesystem onto it worked.
I have two issues left:
1. Is there a way to tell uClinux to check for jffs2 directly, to avoid having to specify this in the kernel command line?
set bootargs... root=/dev/mtdblock2 -rw rootfstype=jffs2
If I don't spell it out, it can't load the root fs:
"No filesystem could mount root, tried: ext2 vfat msdos"
2. Boot is pretty slow, where uClinux stops twice:
...
Scanning device for bad blocks
...
MTDSB: lookup_bdev() returned 0
MTDSB: New superblock for device 2 ("file system(nand)")
Thank you.
QuoteReplyEditDelete
2011-05-18 12:23:09 Re: [2010R1-RC5] Add YAFFS2?
Mike Frysinger (UNITED STATES)
Message: 100726
we recommend UBIFS over JFFS2 because the latter does not perform as well on large devices (which NAND tend to be)
QuoteReplyEditDelete
2011-05-18 12:23:58 Re: [2010R1-RC5] Add YAFFS2?
Mike Frysinger (UNITED STATES)
Message: 100727
you have to specify rootfstype= ... no real way around it that i'm aware of
QuoteReplyEditDelete
2011-05-18 17:39:18 Re: [2010R1-RC5] Add YAFFS2?
Gilles Ganault (FRANCE)
Message: 100729
Thanks for the infos.
we recommend UBIFS over JFFS2 because the latter does not perform as well on large devices (which NAND tend to be)
I followed this document to compile a new image to include UBIFS, but get this error:
make image.rootfs.all
make[5]: Entering directory `/usr/src/uClinux-dist-2010R1-RC5/vendors/Rowetel/IP04'
/usr/src/uClinux-dist-2010R1-RC5/user/genext2fs/build-host/genext2fs -m 0 -i 1024 -b 8192 -d /usr/src/uClinux-dist-2010R1-RC5/romfs -D device_table.txt /usr/src/uClinux-dist-2010R1-RC5/images/rootfs.ext2
/usr/src/uClinux-dist-2010R1-RC5/user/mtd-utils/mkfs.ubifs --squash-uids -m 2048 -e 204800 -c 1024 -d /usr/src/uClinux-dist-2010R1-RC5/romfs -D device_table.txt -o /usr/src/uClinux-dist-2010R1-RC5/images/rootfs.ubifs
Error: count cannot be zero if increment is non-zero
Error: cannot parse '/dev/mtdblock0 b 640 0 0 31 0 0 1 -'
Error: cannot parse device table file 'device_table.txt'
make[5]: *** [image.rootfs.ubifs.force] Error 255
make[5]: Leaving directory `/usr/src/uClinux-dist-2010R1-RC5/vendors/Rowetel/IP04'
make[4]: *** [image] Error 2
make[4]: Leaving directory `/usr/src/uClinux-dist-2010R1-RC5/vendors/Rowetel/IP04'
make[3]: *** [image] Error 2
make[3]: Leaving directory `/usr/src/uClinux-dist-2010R1-RC5/vendors'
make[2]: *** [image] Error 2
make[2]: Leaving directory `/usr/src/uClinux-dist-2010R1-RC5'
make[1]: *** [single_] Error 2
make[1]: Leaving directory `/usr/src/uClinux-dist-2010R1-RC5'
make: *** [single] Error 2
I attached my device_table.txt: Does ubifs require a different format for device_table.txt?
you have to specify rootfstype= ... no real way around it that i'm aware of
By default, Linux tries "ext2 vfat msdos": Does someone know if this hard-coded, or is there a file where we can add other filesystem types to try before giving up?
device_table.txt
QuoteReplyEditDelete
2011-05-18 18:40:09 Re: [2010R1-RC5] Add YAFFS2?
Mike Frysinger (UNITED STATES)
Message: 100730
if you read the code in init/do_mounts.c and fs/filesystems.c, you'll see the list is not hardcoded. it is built up by the filesystems you've enabled in your kernel.
as for the device table, refer to the one used by ADI boards (device_table-min.txt).
QuoteReplyEditDelete
2011-05-19 09:33:12 Re: [2010R1-RC5] Add YAFFS2?
Gilles Ganault (FRANCE)
Message: 100749
if you read the code in init/do_mounts.c and fs/filesystems.c, you'll see the list is not hardcoded. it is built up by the filesystems you've enabled in your kernel.
So, since Jffs2 is compiled in, Linux should try this without having to be told explicitely through rootfstype=. No biggie, though.
as for the device table, refer to the one used by ADI boards (device_table-min.txt).
I tried the BF357 device_table.txt, but it fails with the same error, since it also contain this for the mdblock0 line (no "count"):
/dev/mtdblock0 b 640 0 0 31 0 0 1 -
Next, I tried to configure Buildroot to create dev nodes dynamically, ie. use device_table-min.txt: It compiles OK, but when booting the image, /dev doesn't include any mtd*, and even with "rootfstype=jffs2 root=/dev/mtdblock2 rw", Linux doesn't use the root filesystem in the NAND.
Did I miss a second option in Buildroot to have it create the nodes dynamically?
Does someone have a valid device_table.txt for mkfs.ubifs?
Thank you.
QuoteReplyEditDelete
2011-05-23 21:24:26 Re: [2010R1-RC5] Add YAFFS2?
Mike Frysinger (UNITED STATES)
Message: 100802
in the min mode, there shouldnt be any /dev/mtd* nodes at init time. that's what mdev is for. but that shouldnt matter to the kernel as it doesnt actually open the device node in the rootfs.
we know this works on ADI boards as we do it all the time. if things are failing, it's more likely for a different reason.
QuoteReplyEditDelete
2011-05-27 06:17:37 Re: [2010R1-RC5] Add YAFFS2?
Gilles Ganault (FRANCE)
Message: 100898
Thanks for the info. Compiling succeeds with the attached device_table.txt.
device_table.txt