dracut-functions: inst_rules() do not check std dirs for abs path
authorHarald Hoyer <harald@redhat.com>
Thu, 22 Sep 2011 13:43:34 +0000 (15:43 +0200)
committerHarald Hoyer <harald@redhat.com>
Thu, 22 Sep 2011 13:43:34 +0000 (15:43 +0200)
if an absolute path is given, we should not check the standard udev rule
directories.

dracut-functions

index b11e37c..18a2e89 100755 (executable)
@@ -474,12 +474,14 @@ inst_rules() {
     inst_dir "/lib/udev/rules.d"
     inst_dir "$_target"
     for _rule in "$@"; do
-        for r in /lib/udev/rules.d /etc/udev/rules.d; do
-            if [[ -f $r/$_rule ]]; then
-                _found="$r/$_rule"
-                inst_simple "$_found"
-            fi
-        done
+        if [ "${rule#/}" = $rule ]; then
+            for r in /lib/udev/rules.d /etc/udev/rules.d; do
+                if [[ -f $r/$_rule ]]; then
+                    _found="$r/$_rule"
+                    inst_simple "$_found"
+                fi
+            done
+        fi
         for r in '' ./ $dracutbasedir/rules.d/; do
             if [[ -f ${r}$_rule ]]; then
                 _found="${r}$_rule"