From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smarthost01b.sbp.mail.zen.net.uk (smarthost01b.sbp.mail.zen.net.uk [212.23.1.3]) by mx.groups.io with SMTP id smtpd.web09.28807.1647857036159178672 for ; Mon, 21 Mar 2022 03:03:56 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=permerror, err=parse error for token &{10 18 sdn.klaviyomail.com}: permanent DNS error (domain: starlabs.systems, ip: 212.23.1.3, mailfrom: sean@starlabs.systems) Received: from [51.148.147.4] (helo=sean-StarBook.lan) by smarthost01b.sbp.mail.zen.net.uk with esmtp (Exim 4.90_1) (envelope-from ) id 1nWEtD-0004Ov-L3; Mon, 21 Mar 2022 10:03:51 +0000 From: "Sean Rhodes" To: devel@edk2.groups.io Cc: Matt DeVillier , Jian J Wang , Liming Gao , Sean Rhodes Subject: [PATCH 1/2] MdeModulePkg/UefiBootManagerLib: Add Pcd to prioritize internal devices Date: Mon, 21 Mar 2022 10:03:48 +0000 Message-Id: <86c451b6b340264ab6b78cb7f98d18b58e9c8bee.1647857029.git.sean@starlabs.systems> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-Originating-smarthost01b-IP: [51.148.147.4] Feedback-ID: 51.148.147.4 Content-Transfer-Encoding: quoted-printable From: Matt DeVillier 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 Cc: Liming Gao Signed-off-by: Matt DeVillier Signed-off-by: Sean Rhodes --- 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/MdeModulePk= g/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 ( //=0D // Skip the fixed block io then the removable block io=0D //=0D - if (BlkIo->Media->RemovableMedia =3D=3D ((Removable =3D=3D 0) ? FALS= E : TRUE)) {=0D - continue;=0D + if (FixedPcdGetBool (PcdPrioritizeInternal)) {=0D + if (BlkIo->Media->RemovableMedia =3D=3D (Removable =3D=3D 0)) {=0D + continue;=0D + }=0D + } else {=0D + if (BlkIo->Media->RemovableMedia =3D=3D ((Removable =3D=3D 0) ? FA= LSE : TRUE)) {=0D + continue;=0D + }=0D }=0D =0D Description =3D BmGetBootDescription (Handles[Index]);=0D 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=0D gEfiMdeModulePkgTokenSpaceGuid.PcdDriverHealthConfigureForm = ## SOMETIMES_CONSUMES=0D gEfiMdeModulePkgTokenSpaceGuid.PcdMaxRepairCount = ## CONSUMES=0D + gEfiMdeModulePkgTokenSpaceGuid.PcdPrioritizeInternal=0D 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).=0D gEfiMdeModulePkgTokenSpaceGuid.PcdSdMmcGenericTimeoutValue|1000000|UINT3= 2|0x00000031=0D =0D + ## Inditicates if internal devices will be prioritized over external dev= ices.=0D + # @prompt Prioritize internal devices.=0D + gEfiMdeModulePkgTokenSpaceGuid.PcdPrioritizeInternal|FALSE|BOOLEAN|0x000= 00032=0D +=0D [PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]=0D ## This PCD defines the Console output row. The default value is 25 acco= rding to UEFI spec.=0D # This PCD could be set to 0 then console output would be at max column= and max row.=0D 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 @@ =0D #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSdMmcGenericTimeoutValue_HEL= P #language en-US "Indicates the default timeout value for SD/MMC Host Co= ntroller operations in microseconds."=0D =0D +#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdPrioritizeInternal_PROMPT #l= anguage en-US "Enable booting from internal devices before external devices= ."=0D +=0D +#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdPrioritizeInternal_HELP #l= anguage en-US "Indicates the if internal devices will be prioritized in boo= t order."=0D +=0D #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdCodRelocationDevPath_PROMPT = #language en-US "Capsule On Disk relocation device path."=0D =0D #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdCodRelocationDevPath_HELP #= language en-US "Full device path of platform specific device to store Cap= sule On Disk temp relocation file.
"=0D --=20 2.32.0