[klibc] why mtd root device number is __makedev(0,254)

Eric W. Biederman ebiederm at xmission.com
Wed Mar 24 13:05:22 PDT 2010

zheng shi <neversetsun at gmail.com> writes:

> Hi,
> Why can't a mtd root be a block device?
> In current embedded devices, two mainstream NAND file system can be
> used: YAFFS and UBIFS.

And jffs2.

> YAFFS uses /dev/mtdblockX (for example in Android) and UBIFS use a
> specific naming spec (Android may transfer to UBIFS).
> I think klibc may add support for these platforms.

yaffs isn't merged into the kernel, so I don't have a clue what
is going on there.  Someone really needs to fix that situation.

/dev/mtdblockX is the flash translation layer, to simulate a hard
drive and make it possible to use normal filesystems on flash.  You
don't want to use that for a native flash filesystem.

In the kernel, in do_mounts:prepare_namespace() where this code comes
from mtd devices are special cased so that you can specify a string
"mtdXXX" and get_sb_mtd will use that to figure out the mtd character
device the filesystem is mounted on.  klibc should continue that behavior
and not expect flash filesystems to be mounted on a block device.


More information about the klibc mailing list