]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
fix(systemd-pcrphase): make tpm2-tss an optional dependency
authorLaszlo Gombos <laszlo.gombos@gmail.com>
Fri, 5 Jul 2024 18:17:00 +0000 (14:17 -0400)
committerNeal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
Mon, 8 Jul 2024 22:50:18 +0000 (18:50 -0400)
modules.d/01systemd-pcrphase/module-setup.sh

index 92271170964ee84727b3c273b75548a753206588..3016d7e44da666744aae96d70075e21259945b3f 100755 (executable)
@@ -21,7 +21,17 @@ check() {
 # Module dependency requirements.
 depends() {
     # This module has external dependency on other module(s).
-    echo systemd tpm2-tss
+
+    local deps
+    deps="systemd"
+
+    # optional dependencies
+    module="tpm2-tss"
+    module_check $module > /dev/null 2>&1
+    if [[ $? == 255 ]]; then
+        deps+=" $module"
+    fi
+    echo "$deps"
 
     # Return 0 to include the dependent module(s) in the initramfs.
     return 0