LoaderType = ReadUnaligned32 ((CONST UINT32*)&OptionalData->Header.LoaderType);\r
\r
if (LoaderType == BDS_LOADER_EFI_APPLICATION) {\r
- // Need to connect every drivers to ensure no dependencies are missing for the application\r
- BdsConnectAllDrivers();\r
+ if ((BootOption->Attributes & LOAD_OPTION_CATEGORY_BOOT) == 0) {\r
+ // Need to connect every drivers to ensure no dependencies are missing for the application\r
+ BdsConnectAllDrivers ();\r
+ }\r
\r
Status = BdsStartEfiApplication (mImageHandle, BootOption->FilePathList, 0, NULL);\r
} else if (LoaderType == BDS_LOADER_KERNEL_LINUX_ATAG) {\r
FreePool (FdtDevicePath);\r
}\r
} else {\r
+ // Connect all the drivers if the EFI Application is not a EFI OS Loader\r
+ if ((BootOption->Attributes & LOAD_OPTION_CATEGORY_BOOT) == 0) {\r
+ BdsConnectAllDrivers ();\r
+ }\r
+\r
// Set BootCurrent variable\r
LoadOptionIndexSize = sizeof(UINT16);\r
gRT->SetVariable (L"BootCurrent", &gEfiGlobalVariableGuid,\r