]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
fix(systemd-sysext): install new initrd-specific units
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Wed, 18 Dec 2024 13:36:29 +0000 (14:36 +0100)
committerLaszlo <laszlo.gombos@gmail.com>
Wed, 18 Dec 2024 14:46:11 +0000 (09:46 -0500)
The old service units will no longer be activated in the initrd.

Added in https://github.com/systemd/systemd/commit/7a8556b90119412db8f55534c72a1158edf275e6

modules.d/01systemd-sysext/module-setup.sh

index 381e3394b958b4c1f08b575f5aa71e109d8320ef..379d0aa191bace696e524f1b9cc3545343573960 100755 (executable)
@@ -26,6 +26,11 @@ depends() {
 # Install the required file(s) and directories for the module in the initramfs.
 install() {
 
+    local _suffix=
+
+    # systemd >= v258
+    [[ -e "$systemdsystemunitdir"/systemd-sysext-initrd.service ]] && _suffix="-initrd"
+
     # It's intended to work only with raw binary disk images contained in
     # regular files, but not with directory trees.
 
@@ -35,10 +40,10 @@ install() {
         "/var/lib/extensions/*.raw" \
         "/etc/extension-release.d/extension-release.*" \
         "/usr/lib/extension-release.d/extension-release.*" \
-        "$systemdsystemunitdir"/systemd-confext.service \
-        "$systemdsystemunitdir/systemd-confext.service.d/*.conf" \
-        "$systemdsystemunitdir"/systemd-sysext.service \
-        "$systemdsystemunitdir/systemd-sysext.service.d/*.conf" \
+        "$systemdsystemunitdir"/systemd-confext${_suffix}.service \
+        "$systemdsystemunitdir/systemd-confext${_suffix}.service.d/*.conf" \
+        "$systemdsystemunitdir"/systemd-sysext${_suffix}.service \
+        "$systemdsystemunitdir/systemd-sysext${_suffix}.service.d/*.conf" \
         systemd-confext systemd-sysext
 
     # Enable systemd type unit(s)
@@ -52,10 +57,10 @@ install() {
     if [[ $hostonly ]]; then
         inst_multiple -H -o \
             "/etc/extensions/*.raw" \
-            "$systemdsystemconfdir"/systemd-confext.service \
-            "$systemdsystemconfdir/systemd-confext.service.d/*.conf" \
-            "$systemdsystemconfdir"/systemd-sysext.service \
-            "$systemdsystemconfdir/systemd-sysext.service.d/*.conf"
+            "$systemdsystemconfdir"/systemd-confext${_suffix}.service \
+            "$systemdsystemconfdir/systemd-confext${_suffix}.service.d/*.conf" \
+            "$systemdsystemconfdir"/systemd-sysext${_suffix}.service \
+            "$systemdsystemconfdir/systemd-sysext${_suffix}.service.d/*.conf"
     fi
 
 }