public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Michael D Kinney" <michael.d.kinney@intel.com>
To: devel@edk2.groups.io
Cc: Konstantin Aladyshev <aladyshev22@gmail.com>,
	Bob Feng <bob.c.feng@intel.com>,
	Liming Gao <gaoliming@byosoft.com.cn>,
	Yuwei Chen <yuwei.chen@intel.com>
Subject: [Patch edk2-stable202208 1/2] BaseTools/Source/C/GenSec: Preserve prior behavior when no GUID provided
Date: Mon, 15 Aug 2022 18:49:27 -0700	[thread overview]
Message-ID: <20220816014928.2206-2-michael.d.kinney@intel.com> (raw)
In-Reply-To: <20220816014928.2206-1-michael.d.kinney@intel.com>

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


  reply	other threads:[~2022-08-16  1:49 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 ` Michael D Kinney [this message]
2022-08-16  3:27   ` [edk2-devel] [Patch edk2-stable202208 1/2] BaseTools/Source/C/GenSec: Preserve prior behavior when no GUID provided Bob Feng
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=20220816014928.2206-2-michael.d.kinney@intel.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