From dd13250a7905c9955d9a242b00f4342f0fc48ae4 Mon Sep 17 00:00:00 2001 From: Oliver Smith-Denny Date: Wed, 10 Jul 2024 15:49:19 -0700 Subject: [PATCH] [CHERRY-PICK] 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 4a0d51fb..7863105c 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"));