From 14b2ebc30c8bc98f668fa78171b659e2cdc33aa5 Mon Sep 17 00:00:00 2001 From: Gary Lin Date: Wed, 11 May 2016 16:40:49 +0800 Subject: [PATCH] OvmfPkg/PlatformBootManagerLib: Postpone the shell registration We currently register the shell before creating the boot options for the block devices and the network devices, so the boot manager boots into the internal shell if the user doesn't specify the boot order. However, Xen doesn't support fw_cfg, so there is no way to change the boot order with the external command, and the firmware will always boot into the internal shell if the user doesn't interfere the boot process. This patch postpones the shell registration after MdeModulePkg/BDS creates all the boot options for the block and network devices, so that firmware will try to boot the block/network devices first. Cc: Laszlo Ersek Cc: Jordan Justen Cc: Ruiyu Ni Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Gary Lin Reviewed-by: Laszlo Ersek Reviewed-by: Ruiyu Ni --- .../Library/PlatformBootManagerLib/BdsPlatform.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c index cf774a16a7..a16453d289 100644 --- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c +++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c @@ -184,12 +184,6 @@ PlatformRegisterOptionsAndKeys ( NULL, (UINT16) BootOption.OptionNumber, 0, &Esc, NULL ); ASSERT (Status == EFI_SUCCESS || Status == EFI_ALREADY_STARTED); - // - // Register UEFI Shell - // - PlatformRegisterFvBootOption ( - PcdGetPtr (PcdShellFile), L"EFI Internal Shell", LOAD_OPTION_ACTIVE - ); } EFI_STATUS @@ -1304,6 +1298,13 @@ Routine Description: EfiBootManagerRefreshAllBootOption (); + // + // Register UEFI Shell + // + PlatformRegisterFvBootOption ( + PcdGetPtr (PcdShellFile), L"EFI Internal Shell", LOAD_OPTION_ACTIVE + ); + SetBootOrderFromQemu (NULL); } -- 2.39.2