diff --git a/0016-fix-rescue-create-hmac-file-for-rescue-kernel.patch b/0016-fix-rescue-create-hmac-file-for-rescue-kernel.patch new file mode 100644 index 0000000..47a3d67 --- /dev/null +++ b/0016-fix-rescue-create-hmac-file-for-rescue-kernel.patch @@ -0,0 +1,35 @@ +From 687582799c466e215229336ad6cf6dd3e050c326 Mon Sep 17 00:00:00 2001 +From: Pavel Valena +Date: Thu, 6 Mar 2025 14:23:27 +0100 +Subject: [PATCH 16/16] fix(rescue): create hmac file for rescue kernel + +Resolves: RHEL-59543 +--- + install.d/51-dracut-rescue.install | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/install.d/51-dracut-rescue.install b/install.d/51-dracut-rescue.install +index 1be9b882..030f45ba 100755 +--- a/install.d/51-dracut-rescue.install ++++ b/install.d/51-dracut-rescue.install +@@ -117,6 +117,17 @@ case "$COMMAND" in + echo "Can't copy '$KERNEL_IMAGE to '$BOOT_DIR_ABS/$KERNEL'!" >&2 + fi + ++ HMAC=".${KERNEL}.hmac" ++ ++ KERNEL_DIR="${KERNEL_IMAGE%/*}" ++ KERNEL_FILE="${KERNEL_IMAGE##*/}" ++ ++ HMAC_FILE="${KERNEL_DIR}/.${KERNEL_FILE}.hmac" ++ ++ if ! sed -E "s/([0-9a-f]+)(\s+).*$/\1\2${KERNEL}/" "$HMAC_FILE" > "$BOOT_DIR_ABS/$HMAC"; then ++ echo "Can't create '$BOOT_DIR_ABS/$HMAC' from '$HMAC_FILE'!" >&2 ++ fi ++ + if [[ ! -f "$BOOT_DIR_ABS/$INITRD" ]]; then + # shellcheck disable=SC2046 + dracut -f --no-hostonly --no-uefi \ +-- +2.48.1 + diff --git a/dracut.spec b/dracut.spec index 0c98c4f..c3355c5 100644 --- a/dracut.spec +++ b/dracut.spec @@ -8,7 +8,7 @@ Name: dracut Version: 105 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Initramfs generator using udev @@ -67,6 +67,9 @@ Patch14: 0014-fix-openssl-harden-ossl-build-CFLAGS.patch # fix(ossl): copy executables for the test suite # Author: Pavel Valena Patch15: 0015-fix-ossl-copy-executables-for-the-test-suite.patch +# fix(rescue): create hmac file for rescue kernel +# Author: Pavel Valena +Patch16: 0016-fix-rescue-create-hmac-file-for-rescue-kernel.patch # Please use source-git to work with this spec file: # HowTo: https://packit.dev/source-git/work-with-source-git @@ -485,6 +488,9 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %{_prefix}/lib/kernel/install.d/51-dracut-rescue.install %changelog +* Thu Mar 06 2025 Pavel Valena - 105-4 +- fix(rescue): create hmac file for rescue kernel + * Mon Feb 17 2025 Pavel Valena - 105-3 - fix(ossl): copy executables for the test suite