home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / src / linux-headers-2.6.28-15 / Documentation / aoe / udev-install.sh < prev   
Encoding:
Text File  |  2008-12-24  |  852 b   |  34 lines

  1. # install the aoe-specific udev rules from udev.txt into 
  2. # the system's udev configuration
  3.  
  4. me="`basename $0`"
  5.  
  6. # find udev.conf, often /etc/udev/udev.conf
  7. # (or environment can specify where to find udev.conf)
  8. #
  9. if test -z "$conf"; then
  10.     if test -r /etc/udev/udev.conf; then
  11.         conf=/etc/udev/udev.conf
  12.     else
  13.         conf="`find /etc -type f -name udev.conf 2> /dev/null`"
  14.         if test -z "$conf" || test ! -r "$conf"; then
  15.             echo "$me Error: no udev.conf found" 1>&2
  16.             exit 1
  17.         fi
  18.     fi
  19. fi
  20.  
  21. # find the directory where udev rules are stored, often
  22. # /etc/udev/rules.d
  23. #
  24. rules_d="`sed -n '/^udev_rules=/{ s!udev_rules=!!; s!\"!!g; p; }' $conf`"
  25. if test -z "$rules_d" ; then
  26.     rules_d=/etc/udev/rules.d
  27. fi
  28. if test ! -d "$rules_d"; then
  29.     echo "$me Error: cannot find udev rules directory" 1>&2
  30.     exit 1
  31. fi
  32. sh -xc "cp `dirname $0`/udev.txt $rules_d/60-aoe.rules"
  33.