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

Elliot F. elliotf-dev-busybox at gratuitous.net
Mon Oct 16 10:11:04 PDT 2006


Rob Landley wrote:
> 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

Just to give feedback, the above patch makes mdev correctly delete 
devices on unplug.

> It'll be in 1.2.2
> 
> http://busybox.net/downloads/busybox-1.2.1.fixes.patch

Is there an expected time to see 1.2.2 released?

>> 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. :)

grep'ing the .config yields CONFIG_MDEV=y, CONFIG_FEATURE_MDEV_CONF=y, 
and CONFIG_FEATURE_MDEV_EXEC=y.  I 'make clean' and 'make' (just to make 
sure) and copy it over.  The devices are deleted successfully now, but 
no action (appears to be taken.)

I'll try to put in some debug printfs, but I would welcome whatever 
patches you suggest.  Your response leads me to believe that this should 
work...  Is there a specific setup that it is known to work with 
(device/config/kernel/platform/toolchain/etc)?

Thanks for your response, and for busybox.


More information about the busybox mailing list