public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: Ashish Singhal <ashishsingha@nvidia.com>,
	"Ni, Ray" <ray.ni@intel.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>,
	"Wang, Jian J" <jian.j.wang@intel.com>,
	"Wu, Hao A" <hao.a.wu@intel.com>,
	"Gao, Zhichao" <zhichao.gao@intel.com>
Cc: "Kinney, Michael D" <michael.d.kinney@intel.com>
Subject: Re: [edk2-devel] [PATCH] Support skipping automatic BM enumeration
Date: Tue, 5 Nov 2019 10:33:45 +0100	[thread overview]
Message-ID: <7d8a36b2-a052-1d30-e5e2-72af00d67034@redhat.com> (raw)
In-Reply-To: <DM6PR12MB332406FB62323F3ADAA5ABCCBA7E0@DM6PR12MB3324.namprd12.prod.outlook.com>

On 11/05/19 04:24, Ashish Singhal wrote:
> Hi Ray,
> 
> I did not see any example with which one can tell BDS not to
> enumerate a boot option. Can you please point me to an example where
> a protocol (Block IO, Simple FS or Load File) does not get enumerated
> as a boot option?

(I'm going to state the same thing that's been said in this thread
already, just maybe with a different formulation.)

In order for you to end up with a particular auto-generated option in
the boot manager, two "kinds" of things are necessary.


(1) Producing the protocol instance:

(1a) Your PlatformBootManagerLib instance must actively *connect* the
device in question to a suitable UEFI driver that follows to the UEFI
driver model, such that the UEFI driver produce the LoadFile protocol
instance. For example, you could be calling the
EfiBootManagerConnectAll() API, from UefiBootManagerLib.

(1b) Alternatively, if the device is a platform device, then you might
need a DXE driver, built into your platform firmware, that produces
LoadFile on top of the device, running (directly or indirectly) in the
driver's entry point function.


(2) Creating a boot option for the protocol instance:

(2a) With the LoadFile protocol instance existing, your
PlatformBootManagerLib instance must actively call a UefiBootManagerLib
API -- such as EfiBootManagerRefreshAllBootOption() -- that scans the
UEFI protocol database for various "bootable" protocols, and
auto-generates UEFI Boot#### variables for them (and updates BootOrder too).

(2b) Alternatively, your PlatformBootManagerLib instance may be
auto-setting Boot#### / BootOrder, in response to the LoadFile instance
in question, in some different manner.

----

The point is that *all* of the above actions are under your control. If
you want to prevent the auto-generation of a particular boot option,
then break the dependency chain in any one spot above, and then the
option will not be auto-generated.

- do not connect the device to a driver in your PlatformBootManagerLib,
- or remove the platform DXE driver, if you have that,

or:

- do not call EfiBootManagerRefreshAllBootOption(),
- or stop manually creating Boot#### / BootOrder for the subject
LoadFile (if you do that currently).

(

I did not point out all this when I first responded to your posting,
because I assumed your next question would be:

  OK, but then what do I call *instead of*
  EfiBootManagerRefreshAllBootOption()? I do need the auto-generation of
  boot options, speaking generally, except for this one LoadFile
  instance. I don't want to rewrite all of
  EfiBootManagerRefreshAllBootOption() as a platform function, just for
  the sake of this one exception.

Anticipating that counter-argument, I was tempted to suggest a different
approach (which we've done in the past): namely, making some lower-level
functions in UefiBootManagerLib public, so that PlatformBootManagerLib
instances can reuse those utility functions with finer granularity.

However, that approach is not extremely far from controlling
UefiBootManagerLib by different means, and in this particular case, I
couldn't suggest any obvious low-level functions from
UefiBootManagerLib, for making public, and to call in place of
EfiBootManagerRefreshAllBootOption(). For that, I think quite a bit of
refactoring would be necessary too.

And so I figured I'd let Ray and others respond first, to your proposal.

)

Thanks
Laszlo


      parent reply	other threads:[~2019-11-05  9:33 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
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 [this message]

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=7d8a36b2-a052-1d30-e5e2-72af00d67034@redhat.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