From b207827a26391dcd205bdc22e2d6d41d5b131cc4 Mon Sep 17 00:00:00 2001 From: vit9696 Date: Thu, 2 May 2019 20:53:31 +0300 Subject: [PATCH] OcBootManagementLib: Log filesystem names and handles --- .../OcBootManagementLib/OcBootManagementLib.c | 43 +++++++++++++++---- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/Library/OcBootManagementLib/OcBootManagementLib.c b/Library/OcBootManagementLib/OcBootManagementLib.c index 7e75282e..8b47f90a 100644 --- a/Library/OcBootManagementLib/OcBootManagementLib.c +++ b/Library/OcBootManagementLib/OcBootManagementLib.c @@ -1483,14 +1483,16 @@ OcScanForBootEntries ( IN BOOLEAN Describe ) { - EFI_STATUS Status; - UINTN NoHandles; - EFI_HANDLE *Handles; - UINTN Index; - OC_BOOT_ENTRY *Entries; - UINTN EntryIndex; - CHAR16 *DevicePath; - UINTN EntryCount; + EFI_STATUS Status; + UINTN NoHandles; + EFI_HANDLE *Handles; + UINTN Index; + OC_BOOT_ENTRY *Entries; + UINTN EntryIndex; + CHAR16 *DevicePath; + CHAR16 *VolumeLabel; + UINTN EntryCount; + EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *SimpleFs; Status = gBS->LocateHandleBuffer ( ByProtocol, @@ -1529,7 +1531,30 @@ OcScanForBootEntries ( LoadHandle == Handles[Index] ); - DEBUG ((DEBUG_INFO, "OCB: Filesystem %u has %u entries\n", (UINT32) Index, (UINT32) EntryCount)); + DEBUG_CODE_BEGIN (); + Status = gBS->HandleProtocol ( + Handles[Index], + &gEfiSimpleFileSystemProtocolGuid, + (VOID **) &SimpleFs + ); + if (!EFI_ERROR (Status)) { + VolumeLabel = GetVolumeLabel (SimpleFs); + } else { + VolumeLabel = NULL; + } + DEBUG (( + DEBUG_INFO, + "OCB: Filesystem %u (%p) named %s (%r) has %u entries\n", + (UINT32) Index, + Handles[Index], + VolumeLabel != NULL ? VolumeLabel : L"", + Status, + (UINT32) EntryCount + )); + if (VolumeLabel != NULL) { + FreePool (VolumeLabel); + } + DEBUG_CODE_END (); EntryIndex += EntryCount; }