EmulatorPkg: Make the shell be the first boot option
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1649 Make the shell be the first boot option by default, So it can boot into UEFI Internal Shell directly Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Andrew Fish <afish@apple.com> Cc: Ray Ni <ray.ni@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
This commit is contained in:
parent
ad9df93770
commit
0e92957eaa
|
@ -332,6 +332,35 @@ PlatformBdsRegisterStaticBootOptions (
|
||||||
PrintXY (10, 50, &White, &Black, L"Enter to boot directly.");
|
PrintXY (10, 50, &White, &Black, L"Enter to boot directly.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Returns the priority number.
|
||||||
|
|
||||||
|
@param BootOption
|
||||||
|
**/
|
||||||
|
UINTN
|
||||||
|
BootOptionPriority (
|
||||||
|
CONST EFI_BOOT_MANAGER_LOAD_OPTION *BootOption
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Make sure Shell is first
|
||||||
|
//
|
||||||
|
if (StrCmp (BootOption->Description, L"UEFI Shell") == 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
INTN
|
||||||
|
EFIAPI
|
||||||
|
CompareBootOption (
|
||||||
|
CONST EFI_BOOT_MANAGER_LOAD_OPTION *Left,
|
||||||
|
CONST EFI_BOOT_MANAGER_LOAD_OPTION *Right
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return BootOptionPriority (Left) - BootOptionPriority (Right);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Do the platform specific action after the console is connected.
|
Do the platform specific action after the console is connected.
|
||||||
|
|
||||||
|
@ -377,6 +406,7 @@ PlatformBootManagerAfterConsole (
|
||||||
PlatformBdsRegisterStaticBootOptions ();
|
PlatformBdsRegisterStaticBootOptions ();
|
||||||
PlatformBdsConnectSequence ();
|
PlatformBdsConnectSequence ();
|
||||||
EfiBootManagerRefreshAllBootOption ();
|
EfiBootManagerRefreshAllBootOption ();
|
||||||
|
EfiBootManagerSortLoadOptionVariable (LoadOptionTypeBoot, (SORT_COMPARE)CompareBootOption);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue