From 1dedcda65a267dd385c17a3bbd6d8121feb5d089 Mon Sep 17 00:00:00 2001 From: Miroslav Rezanina Date: Wed, 24 Jul 2024 08:04:29 -0400 Subject: [PATCH] * Wed Jul 24 2024 Miroslav Rezanina - 20240524-2 - edk2-MdeModulePkg-Warn-if-out-of-flash-space-when-writing.patch [RHEL-45261] - Resolves: RHEL-45261 ([RHEL10] edk2 disconnects abnormally before loading the kernel) --- ...n-if-out-of-flash-space-when-writing.patch | 43 +++++++++++++++++++ edk2.spec | 9 +++- 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 edk2-MdeModulePkg-Warn-if-out-of-flash-space-when-writing.patch diff --git a/edk2-MdeModulePkg-Warn-if-out-of-flash-space-when-writing.patch b/edk2-MdeModulePkg-Warn-if-out-of-flash-space-when-writing.patch new file mode 100644 index 0000000..635a256 --- /dev/null +++ b/edk2-MdeModulePkg-Warn-if-out-of-flash-space-when-writing.patch @@ -0,0 +1,43 @@ +From b1b719573ff7410985fd502b3c30e6592229c3bd Mon Sep 17 00:00:00 2001 +From: Oliver Steffen +Date: Mon, 4 Mar 2024 15:32:58 +0100 +Subject: [PATCH] MdeModulePkg: Warn if out of flash space when writing + variables + +RH-Author: Oliver Steffen +RH-MergeRequest: 65: MdeModulePkg: Warn if out of flash space when writing variables +RH-Jira: RHEL-45261 +RH-Acked-by: Gerd Hoffmann +RH-Commit: [1/1] b1f6ac49f246cc6a670b9fdd583da3bb9556550d (osteffen/edk2) + +Emit a DEBUG_WARN message if there is not enough flash space left to +write/update a variable. This condition is currently not logged +appropriately in all cases, given that full variable store can easily +render the system unbootable. +This new message helps identifying this condition. + +Signed-off-by: Oliver Steffen +Reviewed-by: Laszlo Ersek +Reviewed-by: Gerd Hoffmann +(cherry picked from commit 80b59ff8320d1bd134bf689fe9c0ddf4e0473b88) +Signed-off-by: Oliver Steffen +--- + MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c +index d394d237a5..1c7659031d 100644 +--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c ++++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c +@@ -2364,6 +2364,8 @@ Done: + ); + ASSERT_EFI_ERROR (Status); + } ++ } else if (Status == EFI_OUT_OF_RESOURCES) { ++ DEBUG ((DEBUG_WARN, "UpdateVariable failed: Out of flash space\n")); + } + + return Status; +-- +2.39.3 + diff --git a/edk2.spec b/edk2.spec index 1fad249..dd929f1 100644 --- a/edk2.spec +++ b/edk2.spec @@ -21,7 +21,7 @@ ExclusiveArch: x86_64 aarch64 Name: edk2 Version: %{GITDATE} -Release: 1%{?dist} +Release: 2%{?dist} Summary: UEFI firmware for 64-bit virtual machines License: BSD-2-Clause-Patent and Apache-2.0 and MIT URL: http://www.tianocore.org @@ -89,6 +89,8 @@ Patch35: 0037-SecurityPkg-RngDxe-add-rng-test.patch Patch36: 0038-OvmfPkg-wire-up-RngDxe.patch Patch37: 0039-CryptoPkg-Test-call-ProcessLibraryConstructorList.patch Patch38: 0040-MdePkg-X86UnitTestHost-set-rdrand-cpuid-bit.patch +# For RHEL-45261 - [RHEL10] edk2 disconnects abnormally before loading the kernel +Patch39: edk2-MdeModulePkg-Warn-if-out-of-flash-space-when-writing.patch # python3-devel and libuuid-devel are required for building tools. # python3-devel is also needed for varstore template generation and @@ -423,6 +425,11 @@ install -m 0644 \ %changelog +* Wed Jul 24 2024 Miroslav Rezanina - 20240524-2 +- edk2-MdeModulePkg-Warn-if-out-of-flash-space-when-writing.patch [RHEL-45261] +- Resolves: RHEL-45261 + ([RHEL10] edk2 disconnects abnormally before loading the kernel) + * Fri Jun 28 2024 Miroslav Rezanina - 20240524-1 - Rebase to edk2-stable202405 - Resolves: RHEL-32487