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 <aladyshe...@gmail.com>
Cc: Bob Feng <bob.c.f...@intel.com>
Cc: Liming Gao <gaolim...@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.c...@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kin...@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/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to