~ubuntu-branches/ubuntu/breezy/lvm2/breezy

« back to all changes in this revision

Viewing changes to scripts/lvm2create_initrd/lvm2udev

  • Committer: Bazaar Package Importer
  • Author(s): Patrick Caulfield
  • Date: 2004-11-03 09:37:56 UTC
  • Revision ID: james.westby@ubuntu.com-20041103093756-jt0nj8z0v8k1lyiv
Tags: upstream-2.00.25
ImportĀ upstreamĀ versionĀ 2.00.25

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
# $Id: lvm2udev,v 1.1 2004/06/07 16:20:05 agk Exp $
 
4
 
 
5
# simple startup script to create lvm2 devices if /dev is a mountpoint, there
 
6
# are active dm- devices, and an executable /sbin/vgscan.
 
7
 
 
8
# this script is licensed under GPLv2.
 
9
# See http://www.gnu.org/licenses/gpl.html
 
10
 
 
11
case $1 in
 
12
start)
 
13
    # is /dev a mountpoint?
 
14
    mountpoint -q /dev
 
15
    DEVMNTPOINT=$?
 
16
 
 
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=$?
 
20
 
 
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
 
24
    fi
 
25
    ;;
 
26
stop)
 
27
    exit 0
 
28
    ;;
 
29
*)
 
30
    echo "usage:"
 
31
    echo "    $0 start|stop"
 
32
    ;;
 
33
esac