]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut-functions.sh:inst_rules() do not install from /etc in generic mode
authorHarald Hoyer <harald@redhat.com>
Thu, 22 Aug 2013 08:53:43 +0000 (10:53 +0200)
committerHarald Hoyer <harald@redhat.com>
Thu, 22 Aug 2013 08:53:43 +0000 (10:53 +0200)
In generic mode, local configuration should not be part of the image.

Also handle symlinks for rule files.

dracut-functions.sh

index 87b976967c0dc4999ad84db163be81be68cd4ef0..8f32f07a85dfc391ec6ec614daef6d22db04dce8 100755 (executable)
@@ -850,12 +850,14 @@ inst_rule_initqueue() {
 inst_rules() {
     local _target=/etc/udev/rules.d _rule _found
 
+    [[ $hostonly ]] || unset hostonly
+
     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
-                if [[ -f $r/$_rule ]]; then
+            for r in ${udevdir}/rules.d ${hostonly+/etc/udev/rules.d}; do
+                if [[ -e $r/$_rule ]]; then
                     _found="$r/$_rule"
                     inst_rule_programs "$_found"
                     inst_rule_group_owner "$_found"