Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37535060
en ru br
ALT Linux repos
S:15.7-alt3

Group :: System/Kernel and hardware
RPM: shim

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: shim-15.4-upstream-0033-fallback-Print-info-on-GetNextVariableName-errors.patch
Download


From 437caecbab16b1f17bda9ee10115a0c5d7317a1d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jo=C3=A3o=20Paulo=20Rechi=20Vita?= <jprvita@endlessos.org>
Date: Fri, 15 Feb 2019 16:21:58 -0800
Subject: [PATCH 33/35] fallback: Print info on GetNextVariableName errors
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
When listing all variables checking for duplicates, print which error
was returned if not EFI_NOT_FOUND (which simply means reached the end of
the list).
Signed-off-by: João Paulo Rechi Vita <jprvita@endlessos.org>
---
 fallback.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/fallback.c b/fallback.c
index 2eea8a74..feb15df5 100644
--- a/fallback.c
+++ b/fallback.c
@@ -431,8 +431,21 @@ find_boot_option(EFI_DEVICE_PATH *dp, EFI_DEVICE_PATH *fulldp,
 		UINTN varname_size = sizeof(varname);
 		efi_status = gRT->GetNextVariableName(&varname_size, varname,
 						      &vendor_guid);
-		if (EFI_ERROR(efi_status))
+		if (EFI_ERROR(efi_status)) {
+			if (efi_status == EFI_BUFFER_TOO_SMALL)
+				VerbosePrint(L"Buffer too small for next variable name\n");
+
+			if (efi_status == EFI_DEVICE_ERROR)
+				VerbosePrint(L"The next variable name could not be retrieved due to a hardware error\n");
+
+			if (efi_status == EFI_INVALID_PARAMETER)
+				VerbosePrint(L"Invalid parameter to GetNextVariableName: varname_size=%d, varname=%s\n",
+					     varname_size, varname);
+
+			/* EFI_NOT_FOUND means we listed all variables */
+			VerbosePrint(L"Checked all boot entries\n");
 			break;
+		}
 
 		if (StrLen(varname) != 8 || StrnCmp(varname, L"Boot", 4) ||
 		    !isxdigit(varname[4]) || !isxdigit(varname[5]) ||
@@ -474,7 +487,7 @@ find_boot_option(EFI_DEVICE_PATH *dp, EFI_DEVICE_PATH *fulldp,
 	}
 	FreePool(candidate);
 	FreePool(data);
-	return EFI_NOT_FOUND;
+	return efi_status;
 }
 
 EFI_STATUS
-- 
2.32.0
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin