Some versions of udevd do not look for rules in /lib/udev/rules.d
authorVictor Lowther <victor.lowther@gmail.com>
Sat, 7 Mar 2009 14:32:02 +0000 (08:32 -0600)
committerVictor Lowther <victor.lowther@gmail.com>
Sat, 7 Mar 2009 15:11:00 +0000 (09:11 -0600)
For those versions, install rules to /etc/udev/rules.d instead.

dracut-functions

index ba6bd45..eba5eee 100755 (executable)
@@ -140,9 +140,11 @@ find_rule() {
 # udev rules always get installed in the same place, so
 # create a function to install them to make life simpler.
 inst_rules() { 
+    local target="/lib/udev/rules.d"
+    [[ -d $target ]] || target="/etc/udev/rules.d"
     for rule in "$@"; do 
        rule=$(find_rule $rule) && \
-           inst_simple "$rule" "/lib/udev/rules.d/${rule##*/}"
+           inst_simple "$rule" "$target/${rule##*/}"
     done
 }