]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPlatformPkg/Bds/BootMenu.c
ArmPkg/BdsLib: Replaced BdsLoadApplication() by LocateEfiApplicationInFv()
[mirror_edk2.git] / ArmPlatformPkg / Bds / BootMenu.c
index d2dccbc9f274782719efdef8b8e29823967cabdc..a304cc4ce916f39dbe060095d3f5cec06f12013d 100644 (file)
@@ -1069,17 +1069,27 @@ BootShell (
   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