mdev doesn't remove devices

Jason Schoon floydpink at gmail.com
Wed Aug 9 15:10:30 UTC 2006


On 8/9/06, Chris Steel <chriszaurus at yahoo.co.uk> wrote:
>
> I've built a rootfs with uclibc 0.9.28 and busybox 1.2.1 and set up mdev
> rather than udev. I've noticed that when I plug in a USB stick all the
> expected devices are created in /dev, but when I unplug the stick none of
> the devices get removed from /dev. This seems to be down to mdev checking if
> each new entry in /sys has a dev component containing the major and minor
> device numbers, and only creating a device if it can get the device numbers.
> This works fine for creating the devices, but when it comes to removing
> them, the dev component has been removed from /sys before the hotplug event
> arrives, so nothing ever gets removed.
>
> The attached patch stops mdev checking for device numbers (which it
> doesn't need to delete a device) on remove events, and this makes mdev work
> like I was expecting. It'll try to delete a lot of devices which is hasn't
> created but I think that this is OK as they non existant devices all have
> weird names like 4-1:1-0 which are unlikely to duplicate the name of an
> existing legitimate device.
>
> Is this a valid fix, or have I just broken mdev in some way that I don't
> appreciate?
>
> ------------------------------
>

I was having the same issue with mdev (USB devices not getting cleaned up on
removal) and it was on my TODO list but I hadn't made it there yet.  I can't
say for sure yet if this is a valid fix (can't try it right now), but I can
confirm that you are not the only one seeing the original issue.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.busybox.net/pipermail/busybox/attachments/20060809/7e0462de/attachment.htm 


More information about the busybox mailing list