Sync usage with man page.
[netbsd-mini2440.git] / external / gpl2 / lvm2 / dist / scripts / lvm2create_initrd / lvm2udev
blobe2728e2668b690ad0cdb61570388267b6e3e4bca
1 #!/bin/sh
3 # $Id: lvm2udev,v 1.1.1.1 2008/12/22 00:18:58 haad Exp $
5 # simple startup script to create lvm2 devices if /dev is a mountpoint, there
6 # are active dm- devices, and an executable /sbin/vgscan.
8 # this script is licensed under GPLv2.
9 # See http://www.gnu.org/licenses/gpl.html
11 case $1 in
12 start)
13 # is /dev a mountpoint?
14 mountpoint -q /dev
15 DEVMNTPOINT=$?
17 # check to see if there are active dm entries under /sys
18 ls /sys/block/dm-*/dev 1>/dev/null 2>&1
19 ACTIVEDMDEVS=$?
21 # mknodes if conditions are right
22 if [ $DEVMNTPOINT -eq 0 -a $ACTIVEDMDEVS -eq 0 -a -x /sbin/vgscan ]; then
23 /sbin/vgscan --mknodes --ignorelockingfailure
26 stop)
27 exit 0
30 echo "usage:"
31 echo " $0 start|stop"
33 esac