public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Yang Jie" <jie.yang@intel.com>
To: devel@edk2.groups.io
Cc: bob.c.feng@intel.com, gaoliming@byosoft.com.cn,
	yuwei.chen@intel.com, "jie.yang" <jie.yang@intel.com>
Subject: [PATCH] [edk2-staging] [PATCH] BaseTools/Bfm: Fix "-g" input FV is not BFV issue
Date: Thu, 19 May 2022 16:21:37 +0800	[thread overview]
Message-ID: <20220519082137.2330-1-jie.yang@intel.com> (raw)

FCE tool provides "-g" parameter to indicate which FV to insert
binaries. Current code logic has some defects when this FV is
not the last BFV, this patch is to fix this issue and enhance
this tool.

Signed-off-by: jie.yang <jie.yang@intel.com>

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
---
 BaseTools/Source/C/BfmLib/BinFileManager.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Source/C/BfmLib/BinFileManager.c b/BaseTools/Source/C/BfmLib/BinFileManager.c
index 69521044b8..42953bfce5 100644
--- a/BaseTools/Source/C/BfmLib/BinFileManager.c
+++ b/BaseTools/Source/C/BfmLib/BinFileManager.c
@@ -2,7 +2,7 @@
 
  The main entry of BFM tool.
 
- Copyright (c) 2011-2019, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2011-2022, Intel Corporation. All rights reserved.<BR>
  SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -310,7 +310,10 @@ BfmImageAdd (
   do {
     if ((FvGuidExisted && mFvGuidIsSet && FvInFd->IsInputFvFlag) || ((!FvGuidExisted || (!mFvGuidIsSet)) && FvInFd->IsBfvFlag)) {
 
-      if (FvInFd->IsBfvFlag) {
+      if (FvInFd->IsBfvFlag && !FvGuidExisted) {
+        //
+        // No target FV is set, find the last BFV to insert Binary
+        //
         FvInFdTmp = FdData->Fv;
         while (FvInFdTmp != NULL) {
           if (FvInFdTmp->IsBfvFlag) {
-- 
2.26.2.windows.1


             reply	other threads:[~2022-05-19  8:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-19  8:21 Yang Jie [this message]
2022-05-26  1:56 ` [PATCH] [edk2-staging] [PATCH] BaseTools/Bfm: Fix "-g" input FV is not BFV issue 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=20220519082137.2330-1-jie.yang@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