]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
fix(systemd): make checking for systemd availability consistent
authorJo Zzsi <jozzsicsataban@gmail.com>
Mon, 26 May 2025 00:21:42 +0000 (20:21 -0400)
committerLaszlo <laszlo.gombos@gmail.com>
Mon, 26 May 2025 11:22:38 +0000 (07:22 -0400)
The best way to check if systemd is available is to check for the
systemd dracut module. Most of the existing code does this already,
fix the remaining few places where it does not.

modules.d/70dmsquash-live/module-setup.sh
modules.d/70livenet/module-setup.sh
modules.d/74nbd/module-setup.sh

index ae0dee0f675d8be23b990a6d956a77e94b2799e5..5601346ee68ac5f106271c736f94c8cab740ac0d 100755 (executable)
@@ -31,7 +31,7 @@ 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"
-    if dracut_module_included "systemd-initrd"; then
+    if dracut_module_included "systemd"; then
         inst_script "$moddir/dmsquash-generator.sh" "$systemdutildir"/system-generators/dracut-dmsquash-generator
         inst_simple "$moddir/checkisomd5@.service" "/etc/systemd/system/checkisomd5@.service"
     fi
index d1f55ceda5ba2ebae7e087e10df0b4c9a0d4d1b4..3ec6baf4c39a84b15a0933f82d6c5ed3dccbc2b5 100755 (executable)
@@ -17,7 +17,7 @@ install() {
     inst_hook cmdline 29 "$moddir/parse-livenet.sh"
     inst_hook initqueue/online 95 "$moddir/fetch-liveupdate.sh"
     inst_script "$moddir/livenetroot.sh" "/sbin/livenetroot"
-    if dracut_module_included "systemd-initrd"; then
+    if dracut_module_included "systemd"; then
         inst_script "$moddir/livenet-generator.sh" "$systemdutildir"/system-generators/dracut-livenet-generator
     fi
 }
index 06154a620461f25e58a55c28a3d01801f4e97add..2ad45a0a2b50159f49dc1045a8c0c3cdae5734bf 100755 (executable)
@@ -32,7 +32,7 @@ install() {
     inst nbd-client
     inst_hook cmdline 90 "$moddir/parse-nbdroot.sh"
     inst_script "$moddir/nbdroot.sh" "/sbin/nbdroot"
-    if dracut_module_included "systemd-initrd"; then
+    if dracut_module_included "systemd"; then
         inst_script "$moddir/nbd-generator.sh" "$systemdutildir"/system-generators/dracut-nbd-generator
     fi
 }