Blame 0009-dracut-functions.sh-inst_rules-do-not-install-from-e.patch

Harald Hoyer fe48c9
From ace51ef520090e214bac2f6d98f772da0e36376a Mon Sep 17 00:00:00 2001
Harald Hoyer fe48c9
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer fe48c9
Date: Thu, 22 Aug 2013 10:53:43 +0200
Harald Hoyer fe48c9
Subject: [PATCH] dracut-functions.sh:inst_rules() do not install from /etc in
Harald Hoyer fe48c9
 generic mode
Harald Hoyer fe48c9
Harald Hoyer fe48c9
In generic mode, local configuration should not be part of the image.
Harald Hoyer fe48c9
Harald Hoyer fe48c9
Also handle symlinks for rule files.
Harald Hoyer fe48c9
---
Harald Hoyer fe48c9
 dracut-functions.sh | 6 ++++--
Harald Hoyer fe48c9
 1 file changed, 4 insertions(+), 2 deletions(-)
Harald Hoyer fe48c9
Harald Hoyer fe48c9
diff --git a/dracut-functions.sh b/dracut-functions.sh
Harald Hoyer fe48c9
index 87b9769..8f32f07 100755
Harald Hoyer fe48c9
--- a/dracut-functions.sh
Harald Hoyer fe48c9
+++ b/dracut-functions.sh
Harald Hoyer fe48c9
@@ -850,12 +850,14 @@ inst_rule_initqueue() {
Harald Hoyer fe48c9
 inst_rules() {
Harald Hoyer fe48c9
     local _target=/etc/udev/rules.d _rule _found
Harald Hoyer fe48c9
 
Harald Hoyer fe48c9
+    [[ $hostonly ]] || unset hostonly
Harald Hoyer fe48c9
+
Harald Hoyer fe48c9
     inst_dir "${udevdir}/rules.d"
Harald Hoyer fe48c9
     inst_dir "$_target"
Harald Hoyer fe48c9
     for _rule in "$@"; do
Harald Hoyer fe48c9
         if [ "${_rule#/}" = "$_rule" ]; then
Harald Hoyer fe48c9
-            for r in ${udevdir}/rules.d /etc/udev/rules.d; do
Harald Hoyer fe48c9
-                if [[ -f $r/$_rule ]]; then
Harald Hoyer fe48c9
+            for r in ${udevdir}/rules.d ${hostonly+/etc/udev/rules.d}; do
Harald Hoyer fe48c9
+                if [[ -e $r/$_rule ]]; then
Harald Hoyer fe48c9
                     _found="$r/$_rule"
Harald Hoyer fe48c9
                     inst_rule_programs "$_found"
Harald Hoyer fe48c9
                     inst_rule_group_owner "$_found"