]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Check for systemd before installing systemd specific files
authorHarald Hoyer <harald@redhat.com>
Mon, 16 Nov 2015 08:41:26 +0000 (09:41 +0100)
committerHarald Hoyer <harald@redhat.com>
Mon, 16 Nov 2015 08:41:26 +0000 (09:41 +0100)
https://bugzilla.redhat.com/show_bug.cgi?id=1282010

dracut.sh
modules.d/90crypt/module-setup.sh
modules.d/95udev-rules/module-setup.sh

index be4c1073f97c4b68b07d0c3f4711b4b1a5b9c8a2..9e85f500262bc8ea1c8adf53580826fdefe8e48c 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -1481,13 +1481,15 @@ if [[ $kernel_only != yes ]]; then
         cat "$f" >> "${initdir}/etc/fstab"
     done
 
-    if [ -d ${initdir}/$systemdutildir ]; then
-        mkdir -p ${initdir}/etc/conf.d
-        {
-            printf "%s\n" "systemdutildir=\"$systemdutildir\""
-            printf "%s\n" "systemdsystemunitdir=\"$systemdsystemunitdir\""
-            printf "%s\n" "systemdsystemconfdir=\"$systemdsystemconfdir\""
-        } > ${initdir}/etc/conf.d/systemd.conf
+    if dracut_module_included "systemd"; then
+        if [ -d ${initdir}/$systemdutildir ]; then
+            mkdir -p ${initdir}/etc/conf.d
+            {
+                printf "%s\n" "systemdutildir=\"$systemdutildir\""
+                printf "%s\n" "systemdsystemunitdir=\"$systemdsystemunitdir\""
+                printf "%s\n" "systemdsystemconfdir=\"$systemdsystemconfdir\""
+            } > ${initdir}/etc/conf.d/systemd.conf
+        fi
     fi
 
     if [[ $DRACUT_RESOLVE_LAZY ]] && [[ $DRACUT_INSTALL ]]; then
index 4df520cb8b06d98ce8bd83098bc0f8032a7d379d..5d964f471ecf00d1c1969d2a9e1044cf0d1296c3 100755 (executable)
@@ -86,14 +86,17 @@ install() {
 
     inst_simple "$moddir/crypt-lib.sh" "/lib/dracut-crypt-lib.sh"
 
-    inst_multiple -o \
-        $systemdutildir/system-generators/systemd-cryptsetup-generator \
-        $systemdutildir/systemd-cryptsetup \
-        $systemdsystemunitdir/systemd-ask-password-console.path \
-        $systemdsystemunitdir/systemd-ask-password-console.service \
-        $systemdsystemunitdir/cryptsetup.target \
-        $systemdsystemunitdir/sysinit.target.wants/cryptsetup.target \
-        systemd-ask-password systemd-tty-ask-password-agent
-    inst_script "$moddir"/crypt-run-generator.sh /sbin/crypt-run-generator
+    if dracut_module_included "systemd"; then
+        inst_multiple -o \
+                      $systemdutildir/system-generators/systemd-cryptsetup-generator \
+                      $systemdutildir/systemd-cryptsetup \
+                      $systemdsystemunitdir/systemd-ask-password-console.path \
+                      $systemdsystemunitdir/systemd-ask-password-console.service \
+                      $systemdsystemunitdir/cryptsetup.target \
+                      $systemdsystemunitdir/sysinit.target.wants/cryptsetup.target \
+                      systemd-ask-password systemd-tty-ask-password-agent
+        inst_script "$moddir"/crypt-run-generator.sh /sbin/crypt-run-generator
+    fi
+
     dracut_need_initqueue
 }
index f4f9cf835ec9312f910ac3952b1c2fbf4ab20d69..6a0625aa2f911ff9e2c0d9fd3a58a3976845b388 100755 (executable)
@@ -56,8 +56,10 @@ install() {
     # eudev rules
     inst_rules 80-drivers-modprobe.rules
 
-    inst_multiple -o ${systemdutildir}/network/*.link
-    [[ $hostonly ]] && inst_multiple -H -o /etc/systemd/network/*.link
+    if dracut_module_included "systemd"; then
+        inst_multiple -o ${systemdutildir}/network/*.link
+        [[ $hostonly ]] && inst_multiple -H -o /etc/systemd/network/*.link
+    fi
 
     {
         for i in cdrom tape dialout floppy; do