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
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#92464): https://edk2.groups.io/g/devel/message/92464
Mute This Topic: https://groups.io/mt/93050981/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
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
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#92468): https://edk2.groups.io/g/devel/message/92468
Mute This Topic: https://groups.io/mt/93050981/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
© 2016 - 2026 Red Hat, Inc.