From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.61]) by mx.groups.io with SMTP id smtpd.web11.8257.1590593060623697043 for ; Wed, 27 May 2020 08:24:21 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=K2//1aT+; spf=pass (domain: redhat.com, ip: 205.139.110.61, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590593059; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KdBPbhhlYqmsQfdh1EggqhWxZRkM7FigtY5rWYQqGcE=; b=K2//1aT+JiN+qF5JkrlKoxlchJSCdFxc3Fc8YS1GwD/0Y8ewTyIcOBd33WzKgElrDkdJ8P nJmN9/pJ15ZA4R8CtUpgAd147psbc/YbEolWtSyzudng9zhAizsVZ0kR89f4QXVwCJPgeW YKr0HhZ56GyNOF6fwrxE31vXbBZU1Qo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-102-5Aaxh8l_OBSLfpRgrtONpw-1; Wed, 27 May 2020 11:24:18 -0400 X-MC-Unique: 5Aaxh8l_OBSLfpRgrtONpw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1AD498005AA; Wed, 27 May 2020 15:24:17 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-113-77.ams2.redhat.com [10.36.113.77]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3960E1A8F1; Wed, 27 May 2020 15:24:16 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH 1/5] ArmPkg/PlatformBootManagerLib: register 's' as UEFI Shell hotkey To: devel@edk2.groups.io, ard.biesheuvel@arm.com Cc: jon@solid-run.com References: <20200526161359.4810-1-ard.biesheuvel@arm.com> <20200526161359.4810-2-ard.biesheuvel@arm.com> From: "Laszlo Ersek" Message-ID: <0145499a-73a1-5e06-7b49-b6bf02091aea@redhat.com> Date: Wed, 27 May 2020 17:24:15 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200526161359.4810-2-ard.biesheuvel@arm.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 05/26/20 18:13, Ard Biesheuvel wrote: > 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 > --- > ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) > > diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c > index 4aca1382b042..23c925bbdb9c 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 > ); > } > > Reviewed-by: Laszlo Ersek