]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut-functions: install udev rules
authorHarald Hoyer <harald@redhat.com>
Fri, 25 Mar 2011 12:05:05 +0000 (13:05 +0100)
committerHarald Hoyer <harald@redhat.com>
Fri, 25 Mar 2011 15:10:46 +0000 (16:10 +0100)
Install the udev rules to /lib, if the original rule is found there.

dracut-functions

index 4f3822ea21e398f85450f047256766203155f996..6702222c8c2edbb87c080a3141cfe2deda8d7d12 100755 (executable)
@@ -403,9 +403,19 @@ inst_rules() {
     inst_dir "/lib/udev/rules.d"
     inst_dir "$target"
     for rule in "$@"; do 
-        found=$(find_rule "$rule") && \
-            inst_simple "$found" "$target/${found##*/}" \
-            || dinfo "Skipping udev rule: $rule"
+        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    
+        for r in '' ./ $dracutbasedir/rules.d/; do
+            if [[ -f ${r}$rule ]]; then
+                found="${r}$rule"
+                inst_simple "$found" "$target/${found##*/}" 
+            fi
+        done
+        [[ $found ]] || dinfo "Skipping udev rule: $rule"
     done
 }