diff --git a/SPECS/dracut/0014-fix-systemd-pcrphase-in-hostonly-mode-do-not-try-to-include-systemd-pcrphase.patch b/SPECS/dracut/0014-fix-systemd-pcrphase-in-hostonly-mode-do-not-try-to-include-systemd-pcrphase.patch new file mode 100644 index 00000000000..1531e2a6663 --- /dev/null +++ b/SPECS/dracut/0014-fix-systemd-pcrphase-in-hostonly-mode-do-not-try-to-include-systemd-pcrphase.patch @@ -0,0 +1,57 @@ +From 96d153fe927987ce31a1f876b7eeea6fe9cee06a Mon Sep 17 00:00:00 2001 +From: Laszlo Gombos +Date: Thu, 30 May 2024 10:06:04 -0400 +Subject: [PATCH] fix(systemd-pcrphase): in hostonly mode do not try to include + systemd-pcrphase + +--- + modules.d/01systemd-pcrphase/module-setup.sh | 11 +++++------ + 1 file changed, 5 insertions(+), 6 deletions(-) + +diff --git a/modules.d/01systemd-pcrphase/module-setup.sh b/modules.d/01systemd-pcrphase/module-setup.sh +index eb8520799..922711709 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,24 @@ 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 ++ + # 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 +43,4 @@ install() { + "$systemdsystemconfdir/systemd-pcrphase-initrd.service.d/*.conf" \ + "$systemdsystemconfdir"/initrd.target.wants/systemd-pcrphase-initrd.service + fi +- + } diff --git a/SPECS/dracut/0015-fix-systemd-pcrphase-make-tpm2-tss-an-optional-dependency.patch b/SPECS/dracut/0015-fix-systemd-pcrphase-make-tpm2-tss-an-optional-dependency.patch new file mode 100644 index 00000000000..8f89fddc973 --- /dev/null +++ b/SPECS/dracut/0015-fix-systemd-pcrphase-make-tpm2-tss-an-optional-dependency.patch @@ -0,0 +1,32 @@ +From a2193b71f7be75f719eec29faacae36ab25e9147 Mon Sep 17 00:00:00 2001 +From: Laszlo Gombos +Date: Fri, 5 Jul 2024 14:17:00 -0400 +Subject: [PATCH] fix(systemd-pcrphase): make tpm2-tss an optional dependency + +--- + modules.d/01systemd-pcrphase/module-setup.sh | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/modules.d/01systemd-pcrphase/module-setup.sh b/modules.d/01systemd-pcrphase/module-setup.sh +index 922711709..3016d7e44 100755 +--- a/modules.d/01systemd-pcrphase/module-setup.sh ++++ b/modules.d/01systemd-pcrphase/module-setup.sh +@@ -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 diff --git a/SPECS/dracut/dracut.spec b/SPECS/dracut/dracut.spec index 2b7812a5929..2b9b86aea26 100644 --- a/SPECS/dracut/dracut.spec +++ b/SPECS/dracut/dracut.spec @@ -4,7 +4,7 @@ Summary: dracut to create initramfs Name: dracut Version: 102 -Release: 5%{?dist} +Release: 6%{?dist} # The entire source code is GPLv2+ # except install/* which is LGPLv2+ License: GPLv2+ AND LGPLv2+ @@ -34,6 +34,8 @@ Patch: 0006-dracut.sh-validate-instmods-calls.patch Patch: 0011-Remove-reference-to-kernel-module-zlib-in-fips-module.patch Patch: 0012-fix-dracut-functions-avoid-awk-in-get_maj_min.patch Patch: 0013-revert-fix-crypt-unlock-encrypted-devices-by-default.patch +Patch: 0014-fix-systemd-pcrphase-in-hostonly-mode-do-not-try-to-include-systemd-pcrphase.patch +Patch: 0015-fix-systemd-pcrphase-make-tpm2-tss-an-optional-dependency.patch BuildRequires: bash BuildRequires: kmod-devel @@ -288,6 +290,9 @@ ln -srv %{buildroot}%{_bindir}/%{name} %{buildroot}%{_sbindir}/%{name} %dir %{_sharedstatedir}/%{name}/overlay %changelog +* Thu Oct 10 2024 Thien Trung Vuong - 102-6 +- Add patch to make tpm2-tss an optional dependency for systemd-pcrphase + * Sun Oct 06 2024 Jon Slobodzian - 102-5 - Bump version to build with latest systemd