[Yaffs] Make YAFFS2 work as a root FS, patch
Martin Fouts
Martin.Fouts at palmsource.com
Thu Oct 27 20:41:43 BST 2005
> > You were, by the way, mistaken. Linux kernel will mount YAFFS2
> > filesystem without it. However, when the read of the mtd
> super struct
> > fails, the error returned (EPERM) will be confusing to the end user.
>
> No, it will not.
>
> All the filesystems known to the kernel at bootup are tried
> in turn. YAFFS comes before YAFFS2 so before YAFFS2 is tried
> kernel gets an error from YAFFS that is -1 i.e. -EPERM now.
> That breaks the loop and make the kernel panic.
Hi Sergey,
Guess we got caught in the terminology thing. To *me* YAFFS2 is version
2 of the YAFFS source code base, which works for both 512 byte and 2k
byte page size file systems. In that sense, YAFFS2 *will* work.
Also, it is possible to build for 2k devices without building for 512
bytes pages. In that sense, YAFFS2 *will* work.
But, you mention reading source code. Perhaps you should read man
pages. If you specify the -t option to mount, it does not try all file
system types, but tries the one you specify, so even if you've built a
YAFFS2 file system that handles both 512 byte and 2k devices, you could
still mount a 2k device, even with the bug in place.
In fact, of the many ways to build and install YAFFS2, there is only one
in which it won't mount a file system. Had you put more information and
less vitriol into your email, I would have realized that you were in
that one circumstance. It's hard to read your mind, and your attitude
makes it undesirable to try.
I mention this, Sergey, because it seems to be the root of your
misunderstanding about how fragile YAFFS is. You seem to think that
there is only one way to use a file system -- yours -- and if it breaks
when being used that way, it can't work any other way.
So yes, Sergey, as things stood until your patch, if you tried to use
YAFFS2 as the root file system on a 2k NAND device, your kernel wouldn't
boot. Too bad you hadn't thought to tell us that was the set of
circumstances you were running under. Among other things, it would have
given me the basis for a test case to add to a regression suite for
yaffs.
The patch is in my tree. As soon as I test it, it'll get pushed. Now
that you've taken the time to identify exactly what you were doing, I'll
see about making it a test case. (We don't have 2k parts here at
PalmSource, so it will be difficult for me to test.)
More information about the yaffs
mailing list