public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ashish Singhal" <ashishsingha@nvidia.com>
To: Andrew Fish <afish@apple.com>, Laszlo Ersek <lersek@redhat.com>
Cc: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	"Ni, Ray" <ray.ni@intel.com>,
	"Wang, Jian J" <jian.j.wang@intel.com>,
	"Wu, Hao A" <hao.a.wu@intel.com>,
	"Gao, Zhichao" <zhichao.gao@intel.com>,
	Mike Kinney <michael.d.kinney@intel.com>
Subject: Re: [edk2-devel] [PATCH] Support skipping automatic BM enumeration
Date: Tue, 5 Nov 2019 18:00:00 +0000	[thread overview]
Message-ID: <DM6PR12MB3324C021FE6B4EEB8B3AFAB8BA7E0@DM6PR12MB3324.namprd12.prod.outlook.com> (raw)
In-Reply-To: <37D801DD-41E8-452E-9F24-ADF52BFDB676@apple.com>

[-- Attachment #1: Type: text/plain, Size: 4384 bytes --]

Hello Andrew/Laszlo,

Thank you for walking me through the steps that happen and what I can do in terms of modifying variables. I think I did not do a good job stating the exact issue I see when I try these options so I will try to explain it here.

First of all, I do want the boot option to be created for the load file protocol I am installing, but I need specific optional data for my platform.

Right now, UefiBootManagerLib looks for all instances of Block IO, Simple FS and Load File protocol handles and creates a boot option for them with mBmAutoCreateBootOptionGuid being the optional data. This GUID as optional data is used to keep track of whether the boot option is an auto-created one from the library or not. Because of this, however, there is no way right now for a platform to have its own optional data for the boot option. Now I agree that I can use the platform boot manager protocol to modify the boot variable and give the custom optional data I need, but that would not stop UefiBootManagerLib from creating another boot option with mBmAutoCreateBootOptionGuid as the optional data on the next bootup which I would have to delete every time in the platform boot manager driver. With the patch that I have proposed, UefiBootManagerLib would never create a boot option automatically if the platform wants it not to do it and it can be dealt with in the platform boot manager driver.

Alternatively, we can have platform boot manager driver change the attribute of such a boot option to be hidden and not active, and add a new boot option with the specific optional data we want. This would require changing EfiBootMangerFindLoadOption function to ignore differences in Attributes as otherwise, the system will recreate a new option with the active attribute set and delete the hidden one.

Thanks
Ashish
________________________________
From: afish@apple.com <afish@apple.com> on behalf of Andrew Fish <afish@apple.com>
Sent: Tuesday, November 5, 2019 9:52 AM
To: Laszlo Ersek <lersek@redhat.com>
Cc: devel@edk2.groups.io <devel@edk2.groups.io>; Ashish Singhal <ashishsingha@nvidia.com>; Ni, Ray <ray.ni@intel.com>; Wang, Jian J <jian.j.wang@intel.com>; Wu, Hao A <hao.a.wu@intel.com>; Gao, Zhichao <zhichao.gao@intel.com>; Mike Kinney <michael.d.kinney@intel.com>
Subject: Re: [edk2-devel] [PATCH] Support skipping automatic BM enumeration



> On Nov 5, 2019, at 3:54 AM, Laszlo Ersek <lersek@redhat.com> wrote:
>
> On 11/05/19 07:15, Andrew Fish via Groups.Io wrote:
>
>> You could also edit any existing variables that point to your Load File to make sure they follow the rules you care about?
>>
>> It is legal from an UEFI spec point of view for a platform to edit the nvram boot variables based on platform boot policy.
>
> Good point; for example OVMF and ArmVirtQemu* do this, with the help of
> QemuBootOrderLib. In essence:
>
> - connect a particular set of devices ("ConnectDevicesFromQemu")
>  - if that fails, call EfiBootManagerConnectAll()
>
> - call EfiBootManagerRefreshAllBootOption()
>
> - register UEFI Shell boot option manually
>
> - filter and reorder boot options in a platform specific way
>  ("RemoveStaleFvFileOptions", "SetBootOrderFromQemu")
>
> All this happens in PlatformBootManagerAfterConsole().
>


The intent of the EFI Boot Variables was generally for the OS Installer to write the nvram boot variable with the EFI_LOAD_OPTION (BootXXXX variable name, XXXX is the UINT16 hex value in BootoOrder) info. The reasons being the EFI code may not know the path to the OS Loader, or the arguments that should be passed to the OS Loader.

I'd also point out EFI_LOAD_OPTION.Attributes has LOAD_OPTION_ACTIVE  and LOAD_OPTION_HIDDEN bits that give you more control of how the Boot Manager/BDS will deal with the existing nvram boot option.

Thanks,

Andrew Fish


> Thanks,
> Laszlo
>


-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------

[-- Attachment #2: Type: text/html, Size: 9135 bytes --]

  reply	other threads:[~2019-11-05 18:00 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-30  3:47 [PATCH] Support skipping automatic BM enumeration Ashish Singhal
2019-10-30  3:47 ` [PATCH] MdeModulePkg/UefiBootManagerLib: Support skipping " Ashish Singhal
2019-10-31 10:14 ` [edk2-devel] [PATCH] Support skipping automatic " Laszlo Ersek
     [not found]   ` <DM6PR12MB33249A87560B32B0155D4FE0BA630@DM6PR12MB3324.namprd12.prod.outlook.com>
2019-11-01 21:42     ` Laszlo Ersek
2019-11-01 22:05       ` Ashish Singhal
2019-11-01 22:57         ` Laszlo Ersek
2019-11-04 17:51           ` Ashish Singhal
2019-11-05  2:42   ` Ni, Ray
2019-11-05  3:24     ` Ashish Singhal
2019-11-05  5:00       ` Andrew Fish
2019-11-05  5:06         ` Ashish Singhal
2019-11-05  5:21           ` Andrew Fish
2019-11-05  5:42             ` Ashish Singhal
2019-11-05  6:15               ` Andrew Fish
2019-11-05  9:54                 ` Laszlo Ersek
2019-11-05 16:52                   ` Andrew Fish
2019-11-05 18:00                     ` Ashish Singhal [this message]
2019-11-05 19:23                       ` Laszlo Ersek
2019-11-05 23:19                         ` Jeff Brasen
2019-11-06  0:20                           ` Andrew Fish
2019-11-06  9:56                           ` Laszlo Ersek
2019-11-06 16:15                             ` Andrew Fish
2019-11-06 19:58                               ` Laszlo Ersek
2019-11-06  1:07                         ` Ashish Singhal
2019-11-06  1:34                           ` Jeff Brasen
2019-11-06  2:47                             ` Andrew Fish
2019-11-06  3:20                               ` Ni, Ray
2019-11-06 16:19                                 ` Andrew Fish
2019-11-07  4:12                                   ` Jeff Brasen
2019-11-07  6:59                                     ` Ni, Ray
2019-11-07  7:02                                       ` Jeff Brasen
2019-11-07  7:21                                         ` Ni, Ray
2019-11-07 17:46                                           ` Jeff Brasen
2019-11-08 16:37                                             ` Laszlo Ersek
2019-11-11 22:57                                               ` Jeff Brasen
2019-11-11 23:58                                                 ` Ni, Ray
2019-11-12  0:00                                                   ` Jeff Brasen
2019-11-13 18:42                                                     ` Jeff Brasen
2019-11-14  2:09                                                       ` Ni, Ray
2019-11-14 17:04                                                         ` Jeff Brasen
2019-12-10 20:46                                                           ` Jeff Brasen
2019-12-11  9:54                                                             ` [edk2-discuss] " Wang, Sunny (HPS SW)
2019-12-11 14:00                                                             ` Ni, Ray
2019-12-12 17:52                                                               ` Jeff Brasen
2019-12-17 20:15                                                                 ` Ashish Singhal
2019-12-18  3:54                                                                   ` [edk2-discuss] " Wang, Sunny (HPS SW)
2019-12-18  8:43                                                                     ` Ni, Ray
2019-11-07  7:01                                   ` Ni, Ray
2019-11-05  9:33       ` Laszlo Ersek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM6PR12MB3324C021FE6B4EEB8B3AFAB8BA7E0@DM6PR12MB3324.namprd12.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox