]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(dmsquash-live): do not install systemd files when systemd is not enabled
authorLaszlo Gombos <laszlo.gombos@gmail.com>
Fri, 19 Nov 2021 17:45:20 +0000 (12:45 -0500)
committerJóhann B. Guðmundsson <johannbg@gmail.com>
Tue, 23 Nov 2021 05:53:33 +0000 (05:53 +0000)
Systemd is an optional module for the dmsquash-live module. This scenario
is properly handled for other modules (for example livenet module) but not
for dmsquash-live module.

modules.d/90dmsquash-live/module-setup.sh

index bae9afd7adb45f1045d4574435d27e78b93df0b7..65766e8306620610c3d3c6dd482d7c47ed87a96a 100755 (executable)
@@ -31,9 +31,11 @@ install() {
     inst_hook pre-pivot 20 "$moddir/apply-live-updates.sh"
     inst_script "$moddir/dmsquash-live-root.sh" "/sbin/dmsquash-live-root"
     inst_script "$moddir/iso-scan.sh" "/sbin/iso-scan"
-    inst_script "$moddir/dmsquash-generator.sh" "$systemdutildir"/system-generators/dracut-dmsquash-generator
+    if dracut_module_included "systemd-initrd"; then
+        inst_script "$moddir/dmsquash-generator.sh" "$systemdutildir"/system-generators/dracut-dmsquash-generator
+        inst_simple "$moddir/checkisomd5@.service" "/etc/systemd/system/checkisomd5@.service"
+    fi
     # should probably just be generally included
     inst_rules 60-cdrom_id.rules
-    inst_simple "$moddir/checkisomd5@.service" "/etc/systemd/system/checkisomd5@.service"
     dracut_need_initqueue
 }