Re: devfs question

From: Khimenko Victor (khim@dell.sch57.msk.ru)
Date: Tue Jul 18 2000 - 18:13:20 EST


On Tue, 18 Jul 2000, Richard Gooch wrote:

> Andrew Pimlott writes:
> > On Tue, Jul 18, 2000 at 06:20:07PM -0400, Richard Gooch wrote:
> > > Andrew Pimlott writes:
> > > > Perhaps best to look for a purely numerical last component, and in
> > > > that case take the last two components.
> > >
> > > That would break the old names. "/dev/tty1" would not match to "tty1".
> >
> > I'm sorry, I meant fall back to the old logic if the last component
> > of the path is not purely numerical.
>
> You mean if all characters after the last '/' are numeric, match on
> the last two path components?
> Yeah, I guess that would work. It seems a little hacky, but then again
> so are the other solutions.
>
In fact I think it's pretty good solution :-) You need ability to
distingush /dev/pts/0 , /dev/vc/0 and [perhaps] /devfs/x/y/z/0 or
/usb/A/B/C/0 while retaining compatibility with old scheme (where
/dev/tty1 is just tty1 ). It works:

/dev/tty1 => tty1
/dev/pts/0 => pts/0
/dev/vc/0 => vc/0
/devfs/x/y/z/0 => /devfs/x/y/z/0
/usb/A/B/C/0 => /usb/A/B/C/0

All is pretty clear: if your device is in /dev then strip /dev and use
path relative to /dev, if not - use full name. To me it looks better then
any other scheme (it's possible to make a clash if you'll create
/dev/devfs/x/y/z/0 AND you'll use /dev//devfs/x/y/z/0 in inittab; in this
situation answer is simple: DON'T DO IT! And if you are using full
canonical pathnames clash is not possible anymore with ANY structure of
device names).

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Jul 23 2000 - 21:00:11 EST