]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
fix(systemd-portabled, initqueue): enable systemd type units
authorJo Zzsi <jozzsicsataban@gmail.com>
Sun, 10 Aug 2025 17:55:08 +0000 (13:55 -0400)
committerNeal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
Mon, 11 Aug 2025 12:49:36 +0000 (05:49 -0700)
Use systemctl enable command (instead of add-wants command) to
enable systemd type units.

Without these changes the following error message is seen on
TEST-FULL-SYSTEMD:

```
Failed to add dependency on unit: Unit initrd.target does not exist
Failed to add dependency on unit: Unit initrd.target does not exist
```

modules.d/11systemd-portabled/module-setup.sh
modules.d/77initqueue/module-setup.sh

index ace9cb1bdcef5cd3897f9a25903f2a95383f6b94..82970a04c2700a36cd59e041c9df7d92937e9795 100755 (executable)
@@ -54,6 +54,7 @@ install() {
         "$systemdutildir/portable/profile/strict/*.conf" \
         "$systemdutildir/portable/profile/trusted/*.conf" \
         "$systemdsystemunitdir"/systemd-portabled.service \
+        "$systemdsystemunitdir"/initrd.target.wants/systemd-portabled.service \
         "$systemdsystemunitdir/systemd-portabled.service.d/*.conf" \
         "$systemdsystemunitdir"/dbus-org.freedesktop.portable1.service \
         portablectl
@@ -62,7 +63,6 @@ install() {
     touch "$initdir"/etc/resolv.conf
 
     # Enable systemd type unit(s)
-    $SYSTEMCTL -q --root "$initdir" add-wants initrd.target systemd-portabled.service
     $SYSTEMCTL -q --root "$initdir" enable systemd-portabled.service
 
     # Install the hosts local user configurations if enabled.
index cb0fbfc5421bd5e0edc21f198ec2d3617f316924..cf42391abd159a65f1362e8180674c36254a25e6 100755 (executable)
@@ -14,7 +14,10 @@ install() {
     if dracut_module_included "systemd"; then
         inst_script "$moddir/dracut-initqueue.sh" /usr/bin/dracut-initqueue
         inst_simple "$moddir/dracut-initqueue.service" "$systemdsystemunitdir/dracut-initqueue.service"
-        $SYSTEMCTL -q --root "$initdir" add-wants initrd.target dracut-initqueue.service
+        inst_simple "$systemdsystemunitdir"/initrd.target.wants/dracut-initqueue.service
+
+        # Enable systemd type unit(s)
+        $SYSTEMCTL -q --root "$initdir" enable dracut-initqueue.service
     fi
 
     dracut_need_initqueue