On Fri, Sep 16, 2011 at 11:05 AM, Baruch Siach <[email protected]> wrote:
> Hi Walter,
>
> On Wed, Sep 14, 2011 at 11:55:08PM -0400, Walter Dnes wrote:
>
> [snip]
>
>>   Gentoo has /bin/busybox as part of the default system.  There is also
>> an option to build busybox with libraries statically linked.  IANAPP
>> (I Am Not A Professional Programmer), but I can do quite a bit of bash
>> scripting etc.  In Gentoo, the user generally knows what peripherals he
>> has permanently connected to the machine.  Plus you'll get the usual USB
>> keys and external drives being hooked up occasionally.
>>
>>   If mdev can replace udev a lot of Gentoo users would be very happy.
>> You might even have to start a separate "mdev-users" list <G>.
>
> I haven't seen a mention of the inherently racy nature of the hotplug
> mechanism on which mdev relies. Below is an explanation taken from
> http://www.kernel.org/doc/pending/hotplug.txt (down at the moment).
>
> <quote>
>
> A note about race conditions (or "why bother with netlink?"):
> =============================================================
...
> In theory, transient devices (which are created and removed again almost
> instantly, which can be caused by poorly written drivers that fail their
> device probe) could have similar "leftover" /dev entries from the
> /sbin/hotplug mechanism.  (If two processes are spawned simultaneously, which
> one completes first is not guaranteed.)  This is not common, but theoretically
> possible.

$SEQNUM thing is supposed to take care of that, no?

Which reminds me: mdev --help is woefully inadequate. How about this
expanded version? -



$ ./busybox mdev --help
BusyBox v1.20.0.git (2011-09-19 12:00:37 CEST) multi-call binary.

Usage: mdev [-s]

mdev -s is to be run during boot to scan /sys and populate /dev.

Bare mdev is a kernel hotplug helper. To activate it:
        echo /sbin/mdev >/proc/sys/kernel/hotplug

It uses /etc/mdev.conf with lines
        [-]DEVNAME UID:GID PERM [>|=PATH]|[!] [@|$|*PROG]
where DEVNAME is device name regex, @major,minor[-minor2], or
environment variable regex. One common use of the latter is
to load modules for hotplugged devices:
        $MODALIAS=.* 0:0 660 @modprobe "$MODALIAS"

If /dev/mdev.seq file exists, mdev will wait for its value
to match $SEQNUM variable. This prevents plug/unplug races.



-- 
vda
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to