summaryrefslogtreecommitdiffstats
path: root/modules.d/01systemd-pcrphase
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-26 10:33:11 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-26 10:33:11 +0000
commit203af7302854f453fa4a05ecefd4403b6c8a4f8d (patch)
tree967fdacafe332baabd12b57725505c138d0f3bbf /modules.d/01systemd-pcrphase
parentAdding upstream version 102. (diff)
downloaddracut-upstream.tar.xz
dracut-upstream.zip
Adding upstream version 103.upstream/103upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'modules.d/01systemd-pcrphase')
-rwxr-xr-xmodules.d/01systemd-pcrphase/module-setup.sh23
1 files changed, 16 insertions, 7 deletions
diff --git a/modules.d/01systemd-pcrphase/module-setup.sh b/modules.d/01systemd-pcrphase/module-setup.sh
index eb85207..3016d7e 100755
--- a/modules.d/01systemd-pcrphase/module-setup.sh
+++ b/modules.d/01systemd-pcrphase/module-setup.sh
@@ -4,7 +4,6 @@
# Prerequisite check(s) for module.
check() {
-
# If the binary(s) requirements are not fulfilled the module can't be installed.
# systemd-255 renamed the binary, check for old and new location.
if ! require_binaries "$systemdutildir"/systemd-pcrphase \
@@ -12,23 +11,34 @@ check() {
return 1
fi
- return 0
+ if [[ $hostonly ]]; then
+ return 255
+ fi
+ return 0
}
# 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
-
}
# Install the required file(s) and directories for the module in the initramfs.
install() {
-
inst_multiple -o \
"$systemdutildir"/systemd-pcrphase \
"$systemdutildir"/systemd-pcrextend \
@@ -43,5 +53,4 @@ install() {
"$systemdsystemconfdir/systemd-pcrphase-initrd.service.d/*.conf" \
"$systemdsystemconfdir"/initrd.target.wants/systemd-pcrphase-initrd.service
fi
-
}