busybox mdev questions/problems with not deleting unplugged devices and execution support

Rob Landley rob at landley.net
Sun Oct 15 03:29:08 UTC 2006


On Friday 13 October 2006 12:44 pm, Elliot F. wrote:
> Hello all,
> 
> I'm having a few problems when using mdev in busybox 1.2.1 on linux 
> 2.6.12 on arm (LE) built with a codesourcery toolchain (gcc 3.4).  I 
> have registered mdev as the hotplug handler, and while it adds new 
> (hotplugged) devices, it does not remove them when they are unplugged.

http://busybox.net/downloads/patches/svn-15795.patch

It'll be in 1.2.2

http://busybox.net/downloads/busybox-1.2.1.fixes.patch

> I also configured busybox with command execution support, and the 
> commands I have configured in /etc/mdev.conf do not get activated. 
> Perhaps someone could point out my mistake:
> 
> /etc/mdev.conf:
> sd[a-z][0-9]*	0:0 600 */bin/touch /tmp/$MDEV

Looks ok off the top of my head.

> So I plug in a usb memory stick, and I see /dev/sdb1 appear with 600 
> permissions, so I would like to think the filter is matching.  However, 
> I don't see /tmp/sdb1 (or /tmp/sdb, for that matter.)  I unplug the usb 
> memory stick, and I see the kernel message announcing the disconnect, 
> but the device is still there.  I do have /bin/touch, and when I do 
> '/bin/touch /tmp/fooey', it appears correctly.

Double-check that you've got it enabled, then stick printfs into the source 
code to see what's really happening?  (Since hotplug is a glorified kernel 
thread you won't havea stdin or stdout to speak of, so you'll probably want 
to open a file and dprintf() to it, then look at that afterwards.  O_APPEND 
is probably your friend here. :)

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