mdev automount questions
walter harms
wharms at bfs.de
Mon May 14 09:04:39 UTC 2012
Am 14.05.2012 09:45, schrieb Walter Dnes:
> This really should be a separate topic. Sorry for derailing the wifi
> question.
>
> On Sun, May 13, 2012 at 12:16:37PM +0200, Laurent Bercot wrote
>
>> Just have a single rule for /dev/sd* and have a
>> if [ "$DEV" = "/dev/sda" ] ; exit 0
>> line at the beginning of your rule script. (Maybe $DEV isn't the right
>> variable name, I don't remember.)
>
> A couple of options...
>
> 1) The comments in /lib/mdev/usbdisk_link say
> # NOTE: since mdev -s only provide $MDEV, don't depend on any hotplug vars.
> Can I use the lack of an ACTION var to assume that this call is from
> "mdev -s" (i.e. bootup), whereas if ACTION is present, assume that it's
> a hotplug
> if [ "X${ACTION}" == "X" ]; then
a bit off-topic but ...
adding a char to avoid comparision to "" is to avoid an ancient bug.
Is this "fix" realy in the commen busybox example ?
re,
wh
> assume it's a hard drive coming up at boot time (mdev -s)
> else
> it's from the command in /proc/sys/kernel/hotplug (userspace hotplug)
> fi
>
> 2) Get info from /sys
>
> cat /sys/block/sda/removable
> 0
>
> cat /sys/block/sdb/removable
> 1
>
More information about the busybox
mailing list