From: Nicolas Chauvet Date: Mon, 5 Nov 2012 23:39:04 +0000 (+0100) Subject: Fix rd.blacklist.driver when no /etc/modprobe.d exists X-Git-Tag: 025~36 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=00ae54f00a0ef83ff9afac0aa658a7dcac5ae1e1;p=thirdparty%2Fdracut.git Fix rd.blacklist.driver when no /etc/modprobe.d exists This bug was reported as http://bugzilla.redhat.com/873220#c2 As the /etc/modprobe.d isn't created in the boot process nor bundled within the initramfs, the initramfsblacklist.conf cannot be created. Instead, the /usr/lib/modprobe.d directory is available and using it will restore the blacklist behavior. --- diff --git a/modules.d/90kernel-modules/parse-kernel.sh b/modules.d/90kernel-modules/parse-kernel.sh index 485528b7b..7470905f8 100755 --- a/modules.d/90kernel-modules/parse-kernel.sh +++ b/modules.d/90kernel-modules/parse-kernel.sh @@ -2,6 +2,15 @@ # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- # ex: ts=8 sw=4 sts=4 et filetype=sh +_modprobe_d=/etc/modprobe.d +if [ -d /usr/lib/modprobe.d ] ; then + _modprobe_d=/usr/lib/modprobe.d +elif [ -d /lib/modprobe.d ] ; then + _modprobe_d=/lib/modprobe.d +elif [ ! -d $_modprobe_d ] ; then + mkdir -p $_modprobe_d +fi + for i in $(getargs rd.driver.pre -d rdloaddriver=); do ( IFS=, @@ -15,15 +24,15 @@ for i in $(getargs rd.driver.blacklist -d rdblacklist=); do ( IFS=, for p in $i; do - echo "blacklist $p" >> /etc/modprobe.d/initramfsblacklist.conf + echo "blacklist $p" >> $_modprobe_d/initramfsblacklist.conf done ) done for p in $(getargs rd.driver.post -d rdinsmodpost=); do - echo "blacklist $p" >> /etc/modprobe.d/initramfsblacklist.conf + echo "blacklist $p" >> $_modprobe_d/initramfsblacklist.conf _do_insmodpost=1 done [ -n "$_do_insmodpost" ] && initqueue --settled --unique --onetime insmodpost.sh -unset _do_insmodpost +unset _do_insmodpost _modprobe_d