On Friday 25 August 2006 00:03, Andre Renaud wrote: > I've fiddled that code into yaffs, with one minor change - > JFFS2 uses ':' to delimit the partition name, that is: > mount -t jffs2 mtd:PartitionName /mnt > However busybox assumes that any mount device containing a ':' > is an NFS mount, and changes the type to nfs even if you > explicitly set it. To avoid this I've used '.' instead, ie: > mount -t yaffs mtd.PartitionName /mnt > > I'm not sure if anyone else would find this useful or not, but > I've attached the patch if so. We implemented similar functionality at the MTD layer: we register an mtd_notifier callback before we call add_mtd_partitions in our NAND hook-up module (aka MTD map driver), and the callback creates symlinks for each partition/device. This is done for both the char and block interfaces. So /dev/mtd/myfs -> 4, for example, where 'myfs' comes from the partition name. Using the 'named' partitions keeps all the user-space scripts and configuration more sane. [An earlier implementation was done using a shell script to grab the partition names from 'dmesg' and create the links]. The use of 'logical' names for the devices is generally useful, and not just limited to the 'mount' case. Perhaps MTD will support this one day. Attached is some code to illustrate this approach, the 'MTD map driver' code is from one of our platforms. We have a proprietary flash label format, and it's included just so you can follow the flow through bse_mtd_label() to add_mtd_partitions(), which invokes the notifier. Also included are some helper functions we use to fix-up code that relied on DEVFS which has become extinct in the 2.6 codebase; this creates the symlinks. Use these files as an example only - don't expect to build/use them verbatim. The (missing) include files mainly contain function prototypes. -imcd