Blame 0053-dracut-functions-inst_rules-do-not-check-std-dirs-fo.patch

Harald Hoyer 55891e
From 76f5fa549c483a7a38e4757578480096b94615ac Mon Sep 17 00:00:00 2001
Harald Hoyer 55891e
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer 55891e
Date: Thu, 22 Sep 2011 15:43:34 +0200
Harald Hoyer 55891e
Subject: [PATCH] dracut-functions: inst_rules() do not check std dirs for abs
Harald Hoyer 55891e
 path
Harald Hoyer 55891e
Harald Hoyer 55891e
if an absolute path is given, we should not check the standard udev rule
Harald Hoyer 55891e
directories.
Harald Hoyer 55891e
---
Harald Hoyer 55891e
 dracut-functions |   14 ++++++++------
Harald Hoyer 55891e
 1 files changed, 8 insertions(+), 6 deletions(-)
Harald Hoyer 55891e
Harald Hoyer 55891e
diff --git a/dracut-functions b/dracut-functions
Harald Hoyer 55891e
index b11e37c..18a2e89 100755
Harald Hoyer 55891e
--- a/dracut-functions
Harald Hoyer 55891e
+++ b/dracut-functions
Harald Hoyer 55891e
@@ -474,12 +474,14 @@ inst_rules() {
Harald Hoyer 55891e
     inst_dir "/lib/udev/rules.d"
Harald Hoyer 55891e
     inst_dir "$_target"
Harald Hoyer 55891e
     for _rule in "$@"; do
Harald Hoyer 55891e
-        for r in /lib/udev/rules.d /etc/udev/rules.d; do
Harald Hoyer 55891e
-            if [[ -f $r/$_rule ]]; then
Harald Hoyer 55891e
-                _found="$r/$_rule"
Harald Hoyer 55891e
-                inst_simple "$_found"
Harald Hoyer 55891e
-            fi
Harald Hoyer 55891e
-        done
Harald Hoyer 55891e
+        if [ "${rule#/}" = $rule ]; then
Harald Hoyer 55891e
+            for r in /lib/udev/rules.d /etc/udev/rules.d; do
Harald Hoyer 55891e
+                if [[ -f $r/$_rule ]]; then
Harald Hoyer 55891e
+                    _found="$r/$_rule"
Harald Hoyer 55891e
+                    inst_simple "$_found"
Harald Hoyer 55891e
+                fi
Harald Hoyer 55891e
+            done
Harald Hoyer 55891e
+        fi
Harald Hoyer 55891e
         for r in '' ./ $dracutbasedir/rules.d/; do
Harald Hoyer 55891e
             if [[ -f ${r}$_rule ]]; then
Harald Hoyer 55891e
                 _found="${r}$_rule"