[PATCH] Add subsystem support to mdev (firmware loading)

Rob Landley rob at landley.net
Fri Oct 20 18:24:25 UTC 2006


On Thursday 19 October 2006 4:11 pm, Erik Andersen wrote:
> I ended up needing to do some firmware loading myself, so I've
> put together an alternative patch to handle firmware loading
> within mdev.  My patch is a bit larger, but does not require any
> external script (or even a shell), making it faster, better
> suited for use in early userspace, and (most importantly) it does
> what I happened to need yesterday.  I've tested it using a
> usb speedtouch modem and an AIC-9405W SAS adapter and It Worked
> For Me(tm).  So perhaps it might work for others as well...

Ooh!  I'm sucking this into toybox.  (Which may actually have its 0.01 release 
this weekend, if I can get BusyBox 1.2.2 out of the way early enough.)

> On an unrelated note, somebody remind me why mdev lives under
> util-linux as it has little (except portions of the end result)
> in common with udev?

Because it's a Linux utility?

I was pondering moving all the BusyBox-only utilities to their own config 
menu, but never got around to it.  And in the meantime, they have to go 
somewhere...

> Any any reason not to have it install 
> itself as /sbin/hotplug or set /proc/sys/kernel/hotplug pointing
> to /sbin/mdev when run with 'mdev -s'?

No deep ones, but a couple of shallow ones:

A) Finding our binary is nontrivial, remember that /proc/self/exe follows 
symlinks so it'll point to "busybox", not "mdev".  I'm adding code to toybox 
to handle this (loosely inspired by libiberty's make_relative_prefix(), or 
more accurately the screaming and banging my head against the wall I did when 
looking at that piece of garbage and the strong desire to THROW IT OUT AND DO 
IT RIGHT that is the FSF's gift to the open source world).  But then you 
could always just register $PREFIX/sbin/mdev and if the binary's not there 
this isn't our problem.

B) In modern kernels I believe /sbin/hotplug won't get called at all unless 
you write something to /proc/sys/kernel/hotplug (the default is netlink 
only).  So no real advantage in calling it /sbin/hotplug instead of mdev.

C) I'd prefer to have a separate flag, perhaps "-r" to register as hotplug, 
rather than making -s perform multiple nonorthogonal functions.

But other than that, sure.

Rob
-- 
"Perfection is reached, not when there is no longer anything to add, but
when there is no longer anything to take away." - Antoine de Saint-Exupery



More information about the busybox mailing list