From c024ed1e61108d71e7e8fa4693c2d55839f87ac0 Mon Sep 17 00:00:00 2001 From: Oliver Smith-Denny Date: Wed, 10 Jul 2024 15:49:19 -0700 Subject: [PATCH] AdvLoggerPkg: Remove NVMe Check from File Logger File Creation Currently, File Logger will only create the UefiLogs directory on the ESP if the device is an NVMe device. This is an unneccesary restriction and is removed in this patch. --- AdvLoggerPkg/AdvancedFileLogger/FileAccess.c | 44 -------------------- 1 file changed, 44 deletions(-) diff --git a/AdvLoggerPkg/AdvancedFileLogger/FileAccess.c b/AdvLoggerPkg/AdvancedFileLogger/FileAccess.c index 4a0d51fb98..7863105c9b 100644 --- a/AdvLoggerPkg/AdvancedFileLogger/FileAccess.c +++ b/AdvLoggerPkg/AdvancedFileLogger/FileAccess.c @@ -23,43 +23,6 @@ STATIC DEBUG_LOG_FILE_INFO mLogFiles[] = { }; #define DEBUG_LOG_FILE_COUNT ARRAY_SIZE(mLogFiles) -/** - CheckIfNVME - - Checks if the device path is an NVME device path. - - @param Handle Handle with Device Path protocol - - @retval TRUE Device is NVME - @retval FALSE Device is NOT NVME or Unable to get Device Path. - - **/ -STATIC -BOOLEAN -CheckIfNVME ( - IN EFI_HANDLE Handle - ) -{ - EFI_DEVICE_PATH_PROTOCOL *DevicePath; - - DevicePath = DevicePathFromHandle (Handle); - if (DevicePath == NULL) { - return FALSE; - } - - while (!IsDevicePathEnd (DevicePath)) { - if ((MESSAGING_DEVICE_PATH == DevicePathType (DevicePath)) && - (MSG_NVME_NAMESPACE_DP == DevicePathSubType (DevicePath))) - { - return TRUE; - } - - DevicePath = NextDevicePathNode (DevicePath); - } - - return FALSE; -} - /** VolumeFromFileSystemHandle @@ -141,13 +104,6 @@ VolumeFromFileSystemHandle ( ); if (EFI_ERROR (Status)) { - // Logs directory doesn't exist. If NVME, allow forced logging - if (!CheckIfNVME (LogDevice->Handle)) { - DEBUG ((DEBUG_INFO, "Logs directory not found on device. No logging.\n")); - Volume->Close (Volume); - return NULL; - } - // Logs directory doesn't exist, see if we can create the Logs directory. if (!FeaturePcdGet (PcdAdvancedFileLoggerForceEnable)) { DEBUG ((DEBUG_INFO, "Creating the Logs directory is not allowed.\n"));