diff options
Diffstat (limited to 'modules.d/98systemd/dracut-pre-udev.sh')
-rwxr-xr-x | modules.d/98systemd/dracut-pre-udev.sh | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/modules.d/98systemd/dracut-pre-udev.sh b/modules.d/98systemd/dracut-pre-udev.sh index d20e6137..afbd61f0 100755 --- a/modules.d/98systemd/dracut-pre-udev.sh +++ b/modules.d/98systemd/dracut-pre-udev.sh @@ -15,5 +15,46 @@ make_trace_mem "hook pre-udev" '1:shortmem' '2+:mem' '3+:slab' getarg 'rd.break=pre-udev' 'rdbreak=pre-udev' && emergency_shell -n pre-udev "Break pre-udev" source_hook pre-udev +_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=, + for p in $i; do + modprobe $p 2>&1 | vinfo + done + ) +done + + +[ -d /etc/modprobe.d ] || mkdir -p /etc/modprobe.d + +for i in $(getargs rd.driver.blacklist -d rdblacklist=); do + ( + IFS=, + for p in $i; do + echo "blacklist $p" >> $_modprobe_d/initramfsblacklist.conf + done + ) +done + +for p in $(getargs rd.driver.post -d rdinsmodpost=); do + echo "blacklist $p" >> $_modprobe_d/initramfsblacklist.conf + _do_insmodpost=1 +done + +[ -n "$_do_insmodpost" ] && initqueue --settled --unique --onetime insmodpost.sh +unset _do_insmodpost _modprobe_d +unset i + export -p > /dracut-state.sh +service="${0##*/}" +cp "/etc/systemd/system/${service%.sh}.service" /run/systemd/system/ exit 0 |