Re: [ANNOUNCE] ndevfs - a "nano" devfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 27, 2005 at 05:35:50PM -0500, Dmitry Torokhov wrote:
> AFAIK there is no requirement in input subsystem that devices should be
> created under /dev/input. When devfs is activated they are created there
> by default, but that's it.

Things which accept a path to an event file as an argument will work
just fine. But anything which tries autodiscovery HAS to be able to find
the device nodes. Think directfb, most (but not all) of the X patches,
any user-space driver that wants to find the hardware it owns, etc.

This illustrates nicely my reasons for preferring devfs.

1) Predictable, canonical device names are a Good Thing.

2) If you accept that, exporting the device names from the kernel is the
most sensible way to do it.

For point one, how do you do autodiscovery otherwise? You can look at
sysfs or /proc/bus/input/devices to find out what input devices are on
the system, but if the device nodes can be named anything then how do
you find them? Grep over all of /dev and find the guy with the right
major/minor? Or create your own private device node using the dev sysfs
parameter? Or use some crazy interface to udev's configuration files to
find out what the hell it decided to name the node?

For point two, without doubting the need for a userspace utility to do
chown and symlinks to meaningful names, I cannot conceive of how anyone
could say "I need a device node named /dev/input/event0 with this
major/minor created and deleted according to in-kernel events. The best
way to do this is to export an empty ram-backed filesystem and mount it
on /dev from userspace, use a second kernel-generated filesystem to
export a file called /sys/class/input/event0/dev with the major and
minor in it, use a second kernel->userspace interface to send an event
to a userspace helper which will read that value, look up that it's
supposed to be named /dev/input/event0, and mknod the corresponding
device file". Not if the node is always going to be named
/dev/input/event0.

udev can do lots of amazing things, but ONE of the things it does,
creating device nodes, could be done much better in the kernel IMHO. The
only thing udev offers over a devfs-like solution in this regard is the
ability to have those device nodes use all sorts of wacky, random names.
And that's not a feature in my book, it's a colossal bug. If you want
wacky, random names, make them symlinks. And please don't confuse hatred
for ide/host0/bus0/target0/lun0/part1 versus hda1 with hatred of
standardized names. Picking a dumb standard one time doesn't mean
standards are dumb.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux