Back to home page

OSCL-LXR

 
 

    


0001 # install the aoe-specific udev rules from udev.txt into 
0002 # the system's udev configuration
0003 # 
0004 
0005 me="`basename $0`"
0006 
0007 # find udev.conf, often /etc/udev/udev.conf
0008 # (or environment can specify where to find udev.conf)
0009 #
0010 if test -z "$conf"; then
0011         if test -r /etc/udev/udev.conf; then
0012                 conf=/etc/udev/udev.conf
0013         else
0014                 conf="`find /etc -type f -name udev.conf 2> /dev/null`"
0015                 if test -z "$conf" || test ! -r "$conf"; then
0016                         echo "$me Error: no udev.conf found" 1>&2
0017                         exit 1
0018                 fi
0019         fi
0020 fi
0021 
0022 # find the directory where udev rules are stored, often
0023 # /etc/udev/rules.d
0024 #
0025 rules_d="`sed -n '/^udev_rules=/{ s!udev_rules=!!; s!\"!!g; p; }' $conf`"
0026 if test -z "$rules_d" ; then
0027         rules_d=/etc/udev/rules.d
0028 fi
0029 if test ! -d "$rules_d"; then
0030         echo "$me Error: cannot find udev rules directory" 1>&2
0031         exit 1
0032 fi
0033 sh -xc "cp `dirname $0`/udev.txt $rules_d/60-aoe.rules"