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