Re: [GIT PATCH] Remove devfs from 2.6.12-git

From: Kay Sievers
Date: Thu Jun 23 2005 - 15:15:55 EST


On Wed, Jun 22, 2005 at 11:26:27PM -0700, Greg KH wrote:
> On Thu, Jun 23, 2005 at 03:14:08PM +0900, Miles Bader wrote:
> > Greg KH <greg@xxxxxxxxx> writes:
> > > And again, for embedded systems, there are packages to build it and put
> > > it in initramfs. People have already done the work for you.
> >
> > BTW, has anyone done a comparison of the space usage of udev vs. devfs
> > (including size of code etc....)?
>
> Not that I know of. If you want to do this, compare the original udev
> releases that were around 5kb of code, as the nice features it has today
> are stuff that devfs can not support at all.

Sure, the main udev target is not the embedded world, just because there
is not such a big requirement to adapt a system to so many possible changes
that a desktop system or big servers seeing today.

But we have prepared the kernel with hotplug-events over netlink and a
full featured environment carried with the event. Instead of whining
about devfs going, start implementing your own tiny "udev" that even works
without sysfs at all:

o Set /proc/sys/kernel/hotplug to "".

o Create a single daemon that listens for netlink/events. Use $MAJOR $MINOR
from the environment and create a node.

o Define a simple kernel-name <-> node-name + action lookup table in the daemon
If an action is defined, fork an event with the environment of the received
netlink/event and handle the event externally.

o For bootup, embedded setups can probably just use the minimal required set
of nodes, which are copied over to the tmpfs /dev - mount. After
real userspace is up, the daemon will take care of maintaining /dev.

That way, you have a nice replacement for devfs, /sbin/hotplug and using
$MODALIAS a replacement for most of the hotplug scripts.

Based on udevd.c in the current udev-tree one can do this in less than a
week, still enough time before devfs is removed. :)

Thanks,
Kay
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/