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
   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

-- 
Walter Dnes <[email protected]>
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to