public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] [edk2-staging] [PATCH] BaseTools/Bfm: Fix "-g" input FV is not BFV issue
@ 2022-05-19  8:21 Yang Jie
  2022-05-26  1:56 ` Bob Feng
  0 siblings, 1 reply; 2+ messages in thread
From: Yang Jie @ 2022-05-19  8:21 UTC (permalink / raw)
  To: devel; +Cc: bob.c.feng, gaoliming, yuwei.chen, jie.yang

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-26  1:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-19  8:21 [PATCH] [edk2-staging] [PATCH] BaseTools/Bfm: Fix "-g" input FV is not BFV issue Yang Jie
2022-05-26  1:56 ` Bob Feng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox