[Fwd: Help with list post]

Natanael Copa natanael.copa at gmail.com
Thu Oct 5 06:06:07 UTC 2006


On Wed, 2006-10-04 at 22:25 +0200, Eric Spakman wrote:
> Hi all,
> 
> Forwarded to the list on request.
> 
> Eric
> 
> 
> --------------------------------------------------------------------
...
> Trying to post this one more time (I keep getting a delivery error)
> 
> Dear Busybox experts,
> I'm trying to get some help on using mdev is I really need to.
> I'm using 2.6.18 kernel and a file system I built from scratch.
> 
> All my /dev entries are known before hand and I have no need to
> automatically create these entries. However, I have a usb port where a
> usb pen drive can be connected and disconnected at anytime. I'm trying
> to find out how do I call /sbin/hotplug so it will be executed. 

The kernel calls whats in /proc/sys/kernel/hotplug for hotplugging
events. If /proc/sys/kernel/hotplug is empty it sends the event over a
NETLINK socket.

> I
> thought this sore of thing was builtin to the kernel and all I have to
> do is enable hotpluggable device support. A little digging seem to
> indicate I have to use udev where the udevd deamon calls
> /sbin/hotplug.

The udev daemon uses NETLINK nowdays to get those evens earlier udev
also used /proc/sys/kernel/hotplug.

> From what I've read mdev replaces udev in busybox so, how is
> /sbin/hotplug called?

udev opens a NETLINK socket and reads events from there. Mdev is much
simpler and needs to be specified as hotplug program for the kernel:

echo /sbin/mdev > /proc/sys/kernel/hotplug

> If I don't use mdev (or udev for that matter) how can I capture the
> events so as to call /sbin/hotplug?

echo /sbin/hotplug > /proc/sys/kernel/hotplug

> Am I missing something?

mdev replaces /sbin/hotplug. Its much smaler and much simpler.

echo /sbin/mdev > /proc/sys/kernel/hotplug

> Can anyone provide me with assistance?

If you want to see how I solved the usb hotplugging using mdev, then
download the alpinelinux iso, boot it and plug in and out usb devices
and see what happens in /dev.

http://dl.alpinelinux.org/alpine/v1.4/iso/

If you are only interested in browsing the scripts that creates links,
the default /etc/mdev.conf etc, then take a look at
http://dev.alpinelinux.org/distfiles/alpine-baselayout-1.0.1.tar.gz

--
Natanael Copa




More information about the busybox mailing list