/Documentation/aoe/udev-install.sh

https://bitbucket.org/evzijst/gittest · Shell · 26 lines · 14 code · 3 blank · 9 comment · 5 complexity · 0e26a3f8f195aa19637985b65a0e4b7c MD5 · raw file

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