[PATCH 1/2] dracut-functions.sh: support for alternative udev dirs - udevaltdirs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It is required for Gentoo which moves udev from / to /usr and supports
both /lib/udev and /usr/lib/udev for compatibility with other packages.
---
 dracut-functions.sh | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/dracut-functions.sh b/dracut-functions.sh
index f1c797c..4a9ebbb 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -896,12 +896,18 @@ inst_rule_group_owner() {
 # create a function to install them to make life simpler.
 inst_rules() {
     local _target=/etc/udev/rules.d _rule _found
+    local _rules_dirs=( "$udevdir/rules.d" "/etc/udev/rules.d" )
+    local _d
+
+    for _d in $udevaltdirs; do
+        _rules_dirs+=( "$_d/rules.d" )
+    done
 
     inst_dir "${udevdir}/rules.d"
     inst_dir "$_target"
     for _rule in "$@"; do
         if [ "${rule#/}" = "$rule" ]; then
-            for r in ${udevdir}/rules.d /etc/udev/rules.d; do
+            for r in "${_rules_dirs[@]}"; do
                 if [[ -f $r/$_rule ]]; then
                     _found="$r/$_rule"
                     inst_rule_programs "$_found"
-- 
1.8.0.2

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux