diff options
author | Ard Biesheuvel <ard.biesheuvel@arm.com> | 2020-05-28 11:17:37 +0200 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2020-06-06 07:49:42 +0000 |
commit | 321b07888973fd089337656fd975c0527c275b35 (patch) | |
tree | 102639fa9041a8b0327818833d0a3e4748943d01 /ArmPkg | |
parent | 0ae52d4fd157f7d6047b466f4cf69942dd83232b (diff) | |
download | edk2-321b07888973fd089337656fd975c0527c275b35.zip edk2-321b07888973fd089337656fd975c0527c275b35.tar.gz edk2-321b07888973fd089337656fd975c0527c275b35.tar.bz2 |
ArmPkg/PlatformBootManagerLib: register 's' as UEFI Shell hotkey
In preparation of hiding the UEFI Shell boot option as an ordinary
boot option, make sure we can invoke it directly using the 's'
hotkey. Without ConnectAll() having been called, this results in
a shell that may have no block devices or other things connected,
so don't advertise the 's' in the console string that is printed
at boot - for novice users, we will go through the UiApp which
connects everything first. For advanced use, having the ability
to invoke the UEFI shell without any devices connected may be an
advantage, so let's keep this behavior as is for now.
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Leif Lindholm <leif@nuviainc.com>
Diffstat (limited to 'ArmPkg')
-rw-r--r-- | ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c index 4aca138..23c925b 100644 --- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c +++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c @@ -357,7 +357,8 @@ VOID PlatformRegisterFvBootOption (
CONST EFI_GUID *FileGuid,
CHAR16 *Description,
- UINT32 Attributes
+ UINT32 Attributes,
+ EFI_INPUT_KEY *Key
)
{
EFI_STATUS Status;
@@ -409,6 +410,9 @@ PlatformRegisterFvBootOption ( if (OptionIndex == -1) {
Status = EfiBootManagerAddLoadOptionVariable (&NewOption, MAX_UINTN);
ASSERT_EFI_ERROR (Status);
+ Status = EfiBootManagerAddKeyOptionVariable (NULL,
+ (UINT16)NewOption.OptionNumber, 0, Key, NULL);
+ ASSERT (Status == EFI_SUCCESS || Status == EFI_ALREADY_STARTED);
}
EfiBootManagerFreeLoadOption (&NewOption);
EfiBootManagerFreeLoadOptions (BootOptions, BootOptionCount);
@@ -721,6 +725,7 @@ PlatformBootManagerAfterConsole ( UINTN FirmwareVerLength;
UINTN PosX;
UINTN PosY;
+ EFI_INPUT_KEY Key;
FirmwareVerLength = StrLen (PcdGetPtr (PcdFirmwareVersionString));
@@ -770,8 +775,10 @@ PlatformBootManagerAfterConsole ( //
// Register UEFI Shell
//
+ Key.ScanCode = SCAN_NULL;
+ Key.UnicodeChar = L's';
PlatformRegisterFvBootOption (
- &gUefiShellFileGuid, L"UEFI Shell", LOAD_OPTION_ACTIVE
+ &gUefiShellFileGuid, L"UEFI Shell", LOAD_OPTION_ACTIVE, &Key
);
}
|