From 0c72676d371f8a2988f1fae958da696444e70672 Mon Sep 17 00:00:00 2001 From: Olivier Martin Date: Tue, 14 Jul 2015 14:30:08 +0000 Subject: ArmPkg/BdsLib: Replaced BdsLoadApplication() by LocateEfiApplicationInFv() Replaced the function BdsLoadApplication() by two explicit functions that load the EFI application either by its GUID or its Name. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin Reviewed-by: Ronald Cron git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17966 6f19259b-4bc3-4df7-8a09-765794883524 --- ArmPlatformPkg/Bds/Bds.inf | 3 +++ ArmPlatformPkg/Bds/BootMenu.c | 24 +++++++++++++++++------- 2 files changed, 20 insertions(+), 7 deletions(-) (limited to 'ArmPlatformPkg/Bds') diff --git a/ArmPlatformPkg/Bds/Bds.inf b/ArmPlatformPkg/Bds/Bds.inf index f4c0f1c55d..76a45e03e5 100644 --- a/ArmPlatformPkg/Bds/Bds.inf +++ b/ArmPlatformPkg/Bds/Bds.inf @@ -37,6 +37,7 @@ ArmPkg/ArmPkg.dec ArmPlatformPkg/ArmPlatformPkg.dec EmbeddedPkg/EmbeddedPkg.dec + IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec [LibraryClasses] BdsLib @@ -79,5 +80,7 @@ gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths + gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile + [Depex] TRUE diff --git a/ArmPlatformPkg/Bds/BootMenu.c b/ArmPlatformPkg/Bds/BootMenu.c index d2dccbc9f2..a304cc4ce9 100644 --- a/ArmPlatformPkg/Bds/BootMenu.c +++ b/ArmPlatformPkg/Bds/BootMenu.c @@ -1069,17 +1069,27 @@ BootShell ( IN LIST_ENTRY *BootOptionsList ) { - EFI_STATUS Status; + EFI_STATUS Status; + EFI_DEVICE_PATH* EfiShellDevicePath; - // Start EFI Shell - Status = BdsLoadApplication (gImageHandle, L"Shell", 0, NULL); + // Find the EFI Shell + Status = LocateEfiApplicationInFvByName (L"Shell", &EfiShellDevicePath); if (Status == EFI_NOT_FOUND) { Print (L"Error: EFI Application not found.\n"); - } else if (EFI_ERROR(Status)) { - Print (L"Error: Status Code: 0x%X\n",(UINT32)Status); - } + return Status; + } else if (EFI_ERROR (Status)) { + Print (L"Error: Status Code: 0x%X\n", (UINT32)Status); + return Status; + } else { + // Need to connect every drivers to ensure no dependencies are missing for the application + Status = BdsConnectAllDrivers (); + if (EFI_ERROR (Status)) { + DEBUG ((EFI_D_ERROR, "FAIL to connect all drivers\n")); + return Status; + } - return Status; + return BdsStartEfiApplication (gImageHandle, EfiShellDevicePath, 0, NULL); + } } struct BOOT_MAIN_ENTRY { -- cgit v1.2.3