]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
fix(systemd-255): handle systemd-pcr{phase -> extend} rename
authorBrian Harring <ferringb@gmail.com>
Tue, 12 Dec 2023 01:10:20 +0000 (17:10 -0800)
committerNeal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
Sun, 31 Mar 2024 02:09:01 +0000 (22:09 -0400)
The binary systemd-pcrphase was renamed to systemd-pcrextend
in systemd 255, but the backing units were all left named
systemd-pcrphase.

Fixes: #2583
Signed-off-by: Brian Harring <ferringb@gmail.com>
modules.d/01systemd-pcrphase/module-setup.sh

index fa960a42c141244632be308f4534e3341cdc7727..1294f1e0fcb4088686331048861c39f44bb939dc 100755 (executable)
@@ -6,7 +6,11 @@
 check() {
 
     # If the binary(s) requirements are not fulfilled the module can't be installed.
-    require_binaries "$systemdutildir"/systemd-pcrphase || return 1
+    # systemd-255 renamed the binary, check for old and new location.
+    if ! require_binaries "$systemdutildir"/systemd-pcrphase \
+        && ! require_binaries "$systemdutildir"/systemd-pcrextend; then
+        return 1
+    fi
 
     # Return 255 to only include the module, if another module requires it.
     return 255
@@ -28,6 +32,7 @@ install() {
 
     inst_multiple -o \
         "$systemdutildir"/systemd-pcrphase \
+        "$systemdutildir"/systemd-pcrextend \
         "$systemdsystemunitdir"/systemd-pcrphase-initrd.service \
         "$systemdsystemunitdir/systemd-pcrphase-initrd.service.d/*.conf" \
         "$systemdsystemunitdir"/initrd.target.wants/systemd-pcrphase-initrd.service