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