From: "Bob Feng" <bob.c.feng@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
"Kinney, Michael D" <michael.d.kinney@intel.com>
Cc: Konstantin Aladyshev <aladyshev22@gmail.com>,
"Gao, Liming" <gaoliming@byosoft.com.cn>,
"Chen, Christine" <yuwei.chen@intel.com>
Subject: Re: [edk2-devel] [Patch edk2-stable202208 1/2] BaseTools/Source/C/GenSec: Preserve prior behavior when no GUID provided
Date: Tue, 16 Aug 2022 03:27:34 +0000 [thread overview]
Message-ID: <PH7PR11MB5863114082D07E911C2E18C5C96B9@PH7PR11MB5863.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20220816014928.2206-2-michael.d.kinney@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Michael D Kinney
Sent: Tuesday, August 16, 2022 9:49 AM
To: devel@edk2.groups.io
Cc: Konstantin Aladyshev <aladyshev22@gmail.com>; Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Chen, Christine <yuwei.chen@intel.com>
Subject: [edk2-devel] [Patch edk2-stable202208 1/2] BaseTools/Source/C/GenSec: Preserve prior behavior when no GUID provided
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4022
If no GUID value is provided with EFI_SECTION_FREEFORM_SUBTYPE_GUID then preserve the prior behavior until all downstream platforms are updated to pass in a GUID value.
Cc: Konstantin Aladyshev <aladyshev22@gmail.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
BaseTools/Source/C/GenSec/GenSec.c | 29 ++++++++++++++++++++---------
1 file changed, 20 insertions(+), 9 deletions(-)
diff --git a/BaseTools/Source/C/GenSec/GenSec.c b/BaseTools/Source/C/GenSec/GenSec.c
index d86cc197cc26..191a49d99228 100644
--- a/BaseTools/Source/C/GenSec/GenSec.c
+++ b/BaseTools/Source/C/GenSec/GenSec.c
@@ -1752,8 +1752,7 @@ Routine Description:
// Check whether there is GUID for the SubtypeGuid section
//
if ((SectType == EFI_SECTION_FREEFORM_SUBTYPE_GUID) && (CompareGuid (&VendorGuid, &mZeroGuid) == 0)) {
- Error (NULL, 0, 1001, "Missing options", "GUID");
- goto Finish;
+ fprintf (stdout, "Warning: input guid value is required for section
+ type %s\n", SectionName);
}
//
@@ -1825,13 +1824,25 @@ Routine Description:
break;
case EFI_SECTION_FREEFORM_SUBTYPE_GUID:
- Status = GenSectionSubtypeGuidSection (
- InputFileName,
- InputFileAlign,
- InputFileNum,
- &VendorGuid,
- &OutFileBuffer
- );
+ if (CompareGuid (&VendorGuid, &mZeroGuid) == 0) {
+ //
+ // Preserve existing behavior when no GUID value is provided
+ //
+ Status = GenSectionCommonLeafSection (
+ InputFileName,
+ InputFileNum,
+ SectType,
+ &OutFileBuffer
+ );
+ } else {
+ Status = GenSectionSubtypeGuidSection (
+ InputFileName,
+ InputFileAlign,
+ InputFileNum,
+ &VendorGuid,
+ &OutFileBuffer
+ );
+ }
break;
case EFI_SECTION_VERSION:
--
2.37.1.windows.1
next prev parent reply other threads:[~2022-08-16 3:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-16 1:49 [Patch edk2-stable202208 0/2] Fix GenSec EFI_SECTION_FREEFORM_SUBTYPE_GUID Michael D Kinney
2022-08-16 1:49 ` [Patch edk2-stable202208 1/2] BaseTools/Source/C/GenSec: Preserve prior behavior when no GUID provided Michael D Kinney
2022-08-16 3:27 ` Bob Feng [this message]
2022-08-16 1:49 ` [Patch edk2-stable202208 2/2] BaseTools/Source/C/GenSec: Fix EFI_SECTION_FREEFORM_SUBTYPE_GUID header Michael D Kinney
2022-08-16 3:16 ` Bob Feng
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=PH7PR11MB5863114082D07E911C2E18C5C96B9@PH7PR11MB5863.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