IN LIST_ENTRY *BootOptionsList\r
)\r
{\r
- EFI_STATUS Status;\r
+ EFI_STATUS Status;\r
+ EFI_DEVICE_PATH* EfiShellDevicePath;\r
\r
- // Start EFI Shell\r
- Status = BdsLoadApplication (gImageHandle, L"Shell", 0, NULL);\r
+ // Find the EFI Shell\r
+ Status = LocateEfiApplicationInFvByName (L"Shell", &EfiShellDevicePath);\r
if (Status == EFI_NOT_FOUND) {\r
Print (L"Error: EFI Application not found.\n");\r
- } else if (EFI_ERROR(Status)) {\r
- Print (L"Error: Status Code: 0x%X\n",(UINT32)Status);\r
- }\r
+ return Status;\r
+ } else if (EFI_ERROR (Status)) {\r
+ Print (L"Error: Status Code: 0x%X\n", (UINT32)Status);\r
+ return Status;\r
+ } else {\r
+ // Need to connect every drivers to ensure no dependencies are missing for the application\r
+ Status = BdsConnectAllDrivers ();\r
+ if (EFI_ERROR (Status)) {\r
+ DEBUG ((EFI_D_ERROR, "FAIL to connect all drivers\n"));\r
+ return Status;\r
+ }\r
\r
- return Status;\r
+ return BdsStartEfiApplication (gImageHandle, EfiShellDevicePath, 0, NULL);\r
+ }\r
}\r
\r
struct BOOT_MAIN_ENTRY {\r