Blob Blame History Raw
From 727543c1e65d94be8e2f1540b616a6e87d3053cb Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 13 Mar 2013 10:51:47 +0100
Subject: [PATCH] systemd: add modules-load.d modules to the initramfs

---
 modules.d/98systemd/module-setup.sh | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/modules.d/98systemd/module-setup.sh b/modules.d/98systemd/module-setup.sh
index 443481a..6b00be5 100755
--- a/modules.d/98systemd/module-setup.sh
+++ b/modules.d/98systemd/module-setup.sh
@@ -16,6 +16,7 @@ depends() {
 }
 
 install() {
+    local _mods
 
     SYSTEMD_VERSION=$($systemdutildir/systemd --version | { read a b a; echo $b; })
     if (( $SYSTEMD_VERSION < 198 )); then
@@ -109,6 +110,26 @@ install() {
     dracut_install -o \
         /usr/lib/modules-load.d/*.conf
 
+    modules_load_get() {
+        local _line i
+        for i in "$1"/*.conf; do
+            [[ -f $i ]] || continue
+            while read _line; do
+                case $_line in
+                    \#*)
+                        ;;
+                    \;*)
+                        ;;
+                    *)
+                        echo $_line
+                esac
+            done < "$i"
+        done
+    }
+
+    _mods=$(modules_load_get /usr/lib/modules-load.d)
+    [[ $_mods ]] && instmods $_mods
+
     if [[ $hostonly ]]; then
         dracut_install -o \
             /etc/systemd/journald.conf \
@@ -120,6 +141,8 @@ install() {
 
         dracut_install -o \
             /etc/modules-load.d/*.conf
+        _mods=$(modules_load_get /etc/modules-load.d)
+        [[ $_mods ]] && instmods $_mods
     else
         if ! [[ -e "$initdir/etc/machine-id" ]]; then
             > "$initdir/etc/machine-id"