Skip to contentSkip to conversation

Dracut is not processing last line of a kernel modules configuration file

PATCH Alexander Lakhin 1 participant 1 message Dec 26, 2014

lore
Share & tools
lore
#0 lore raw

Hello,

I've found that dracut skips a kernel module if it's specified in /etc/modules-load.d/<module>.conf in a single line without EOL. For example, when /etc/modules-load.d/krb5.conf contains the single line:
rpcsec_gss_krb5
(without end-of-line), I've got the error:
systemd-modules-load[]: Failed to find module 'rpcsec_gss_krb5'

and lsinitrd shows no such module in the initrd image.

Attached patch fixes the issue.

Best regards,
Alexander

modules.d/98systemd/module-setup.sh +2 -1
diff -ru dracut-037/modules.d/98systemd/module-setup.sh dracut-037.new/modules.d/98systemd/module-setup.sh
@@ -132,7 +132,8 @@
         local _line i
         for i in "$1"/*.conf; do
             [[ -f $i ]] || continue
-            while read _line; do
+            EOF=false; until $EOF ; do
+                read _line || EOF=true
                 case $_line in
                     \#*)
                         ;;