From: "Ni, Ray" <ray.ni@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
"Rhodes, Sean" <sean@starlabs.systems>
Cc: Matt DeVillier <matt.devillier@gmail.com>,
"Wang, Jian J" <jian.j.wang@intel.com>,
"Gao, Liming" <gaoliming@byosoft.com.cn>
Subject: Re: [edk2-devel] [PATCH 1/2] MdeModulePkg/UefiBootManagerLib: Add Pcd to prioritize internal devices
Date: Tue, 17 May 2022 14:01:25 +0000 [thread overview]
Message-ID: <MWHPR11MB1631F32016AFDB5EDDB2D38B8CCE9@MWHPR11MB1631.namprd11.prod.outlook.com> (raw)
In-Reply-To: <86c451b6b340264ab6b78cb7f98d18b58e9c8bee.1647857029.git.sean@starlabs.systems>
Sean,
Can you use EfiBootManagerSortLoadOptionVariable() to sort the boot options from PlatformBootManagerLib?
> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Sean Rhodes
> Sent: Monday, March 21, 2022 6:04 PM
> To: devel@edk2.groups.io
> Cc: Matt DeVillier <matt.devillier@gmail.com>; Wang, Jian J <jian.j.wang@intel.com>; Gao, Liming
> <gaoliming@byosoft.com.cn>; Rhodes, Sean <sean@starlabs.systems>
> Subject: [edk2-devel] [PATCH 1/2] MdeModulePkg/UefiBootManagerLib: Add Pcd to prioritize internal devices
>
> From: Matt DeVillier <matt.devillier@gmail.com>
>
> Add Pcd to allow configuring internal devices to be prioritized over
> internally-attached USB devices, such as card readers, over SATA, NVMe
> and eMMC drives.
>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
> Signed-off-by: Sean Rhodes <sean@starlabs.systems>
> ---
> MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 10 ++++++++--
> .../Library/UefiBootManagerLib/UefiBootManagerLib.inf | 1 +
> MdeModulePkg/MdeModulePkg.dec | 4 ++++
> MdeModulePkg/MdeModulePkg.uni | 4 ++++
> 4 files changed, 17 insertions(+), 2 deletions(-)
>
> diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> index 962892d38f..28c3cff471 100644
> --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> @@ -2214,8 +2214,14 @@ BmEnumerateBootOptions (
> //
>
> // Skip the fixed block io then the removable block io
>
> //
>
> - if (BlkIo->Media->RemovableMedia == ((Removable == 0) ? FALSE : TRUE)) {
>
> - continue;
>
> + if (FixedPcdGetBool (PcdPrioritizeInternal)) {
>
> + if (BlkIo->Media->RemovableMedia == (Removable == 0)) {
>
> + continue;
>
> + }
>
> + } else {
>
> + if (BlkIo->Media->RemovableMedia == ((Removable == 0) ? FALSE : TRUE)) {
>
> + continue;
>
> + }
>
> }
>
>
>
> Description = BmGetBootDescription (Handles[Index]);
>
> diff --git a/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
> b/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
> index fe05d5f1cc..207420e334 100644
> --- a/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
> +++ b/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
> @@ -119,3 +119,4 @@
> gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile ## CONSUMES
>
> gEfiMdeModulePkgTokenSpaceGuid.PcdDriverHealthConfigureForm ## SOMETIMES_CONSUMES
>
> gEfiMdeModulePkgTokenSpaceGuid.PcdMaxRepairCount ## CONSUMES
>
> + gEfiMdeModulePkgTokenSpaceGuid.PcdPrioritizeInternal
>
> diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
> index 40601c9583..8b8b1f7033 100644
> --- a/MdeModulePkg/MdeModulePkg.dec
> +++ b/MdeModulePkg/MdeModulePkg.dec
> @@ -1563,6 +1563,10 @@
> # @Prompt SD/MMC Host Controller Operations Timeout (us).
>
> gEfiMdeModulePkgTokenSpaceGuid.PcdSdMmcGenericTimeoutValue|1000000|UINT32|0x00000031
>
>
>
> + ## Inditicates if internal devices will be prioritized over external devices.
>
> + # @prompt Prioritize internal devices.
>
> + gEfiMdeModulePkgTokenSpaceGuid.PcdPrioritizeInternal|FALSE|BOOLEAN|0x00000032
>
> +
>
> [PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
>
> ## This PCD defines the Console output row. The default value is 25 according to UEFI spec.
>
> # This PCD could be set to 0 then console output would be at max column and max row.
>
> diff --git a/MdeModulePkg/MdeModulePkg.uni b/MdeModulePkg/MdeModulePkg.uni
> index b070f15ff2..7b8606f091 100644
> --- a/MdeModulePkg/MdeModulePkg.uni
> +++ b/MdeModulePkg/MdeModulePkg.uni
> @@ -1177,6 +1177,10 @@
>
>
> #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSdMmcGenericTimeoutValue_HELP #language en-US "Indicates the
> default timeout value for SD/MMC Host Controller operations in microseconds."
>
>
>
> +#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdPrioritizeInternal_PROMPT #language en-US "Enable booting from
> internal devices before external devices."
>
> +
>
> +#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdPrioritizeInternal_HELP #language en-US "Indicates the if internal
> devices will be prioritized in boot order."
>
> +
>
> #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdCodRelocationDevPath_PROMPT #language en-US "Capsule On Disk
> relocation device path."
>
>
>
> #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdCodRelocationDevPath_HELP #language en-US "Full device path of
> platform specific device to store Capsule On Disk temp relocation file.<BR>"
>
> --
> 2.32.0
>
>
>
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#87789): https://edk2.groups.io/g/devel/message/87789
> Mute This Topic: https://groups.io/mt/89924426/1712937
> Group Owner: devel+owner@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [ray.ni@intel.com]
> -=-=-=-=-=-=
>
prev parent reply other threads:[~2022-05-17 14:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-21 10:03 [PATCH 1/2] MdeModulePkg/UefiBootManagerLib: Add Pcd to prioritize internal devices Sean Rhodes
2022-03-21 10:03 ` [PATCH 2/2] UefiPayloadPkg: Hookup Prioritise Internal build option Sean Rhodes
2022-05-17 12:02 ` [edk2-devel] [PATCH 1/2] MdeModulePkg/UefiBootManagerLib: Add Pcd to prioritize internal devices Sheng Lean Tan
2022-05-17 14:01 ` Ni, Ray [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=MWHPR11MB1631F32016AFDB5EDDB2D38B8CCE9@MWHPR11MB1631.namprd11.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