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>
PlatformRegisterFvBootOption (\r
CONST EFI_GUID *FileGuid,\r
CHAR16 *Description,\r
PlatformRegisterFvBootOption (\r
CONST EFI_GUID *FileGuid,\r
CHAR16 *Description,\r
+ UINT32 Attributes,\r
+ EFI_INPUT_KEY *Key\r
)\r
{\r
EFI_STATUS Status;\r
)\r
{\r
EFI_STATUS Status;\r
if (OptionIndex == -1) {\r
Status = EfiBootManagerAddLoadOptionVariable (&NewOption, MAX_UINTN);\r
ASSERT_EFI_ERROR (Status);\r
if (OptionIndex == -1) {\r
Status = EfiBootManagerAddLoadOptionVariable (&NewOption, MAX_UINTN);\r
ASSERT_EFI_ERROR (Status);\r
+ Status = EfiBootManagerAddKeyOptionVariable (NULL,\r
+ (UINT16)NewOption.OptionNumber, 0, Key, NULL);\r
+ ASSERT (Status == EFI_SUCCESS || Status == EFI_ALREADY_STARTED);\r
}\r
EfiBootManagerFreeLoadOption (&NewOption);\r
EfiBootManagerFreeLoadOptions (BootOptions, BootOptionCount);\r
}\r
EfiBootManagerFreeLoadOption (&NewOption);\r
EfiBootManagerFreeLoadOptions (BootOptions, BootOptionCount);\r
UINTN FirmwareVerLength;\r
UINTN PosX;\r
UINTN PosY;\r
UINTN FirmwareVerLength;\r
UINTN PosX;\r
UINTN PosY;\r
\r
FirmwareVerLength = StrLen (PcdGetPtr (PcdFirmwareVersionString));\r
\r
\r
FirmwareVerLength = StrLen (PcdGetPtr (PcdFirmwareVersionString));\r
\r
//\r
// Register UEFI Shell\r
//\r
//\r
// Register UEFI Shell\r
//\r
+ Key.ScanCode = SCAN_NULL;\r
+ Key.UnicodeChar = L's';\r
PlatformRegisterFvBootOption (\r
PlatformRegisterFvBootOption (\r
- &gUefiShellFileGuid, L"UEFI Shell", LOAD_OPTION_ACTIVE\r
+ &gUefiShellFileGuid, L"UEFI Shell", LOAD_OPTION_ACTIVE, &Key\r