about buysbox mdev

Denys Vlasenko vda.linux at googlemail.com
Mon Aug 16 12:33:50 UTC 2010


On Sun, Aug 15, 2010 at 11:29 AM, 何家胜 <asmcos at akaedu.org> wrote:
> I use busybox 1.17.0. When  I insert a device.
> mdev can create a device file at /dev/.
>
> When I remove the device ,mdev cann't delete the device file.
>
> I use busybox 1.13.0. mdev can work.
>
> in busybox 1.17.0 mdev.c
>
> static void make_device(char *path, int delete)
> {
> line ...
> 382:
> 			if (delete && major >= 0) { //major = -1, so We cann't delete device
>
>                                 ....//
>                         }
> }
>
> The busybox from 1.13 to 1.16 mdev.c
> static void make_device(char *path, int delete)
> {
>
>           if (delete) //no (major >=0)
>           {
>           }
> }
>
>
> The busybox 1.17.0
>
> static void make_device(char *path, int delete)
> {
>
> // line 382
>
> why need the "(major >= 0)" ?
>
>
> }

The idea was to make "!" alias (which means "don't create/delete this node")
to really _not_ delete the node. But accidentally it prevented node deletion
in all cases! :(

Thanks for finding it. Here's the patch:

http://busybox.net/downloads/fixes-1.17.1/busybox-1.17.1-mdev.patch

-- 
vda


More information about the busybox mailing list