Reviewed-by: Bob Feng <bob.c.f...@intel.com>

-----Original Message-----
From: Yang, Jie <jie.y...@intel.com> 
Sent: Thursday, May 19, 2022 4:22 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C <bob.c.f...@intel.com>; Gao, Liming <gaolim...@byosoft.com.cn>; 
Chen, Christine <yuwei.c...@intel.com>; Yang, Jie <jie.y...@intel.com>
Subject: [PATCH] [edk2-staging] [PATCH] BaseTools/Bfm: Fix "-g" input FV is not 
BFV issue

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.y...@intel.com>

Cc: Bob Feng <bob.c.f...@intel.com>
Cc: Liming Gao <gaolim...@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.c...@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



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#90028): https://edk2.groups.io/g/devel/message/90028
Mute This Topic: https://groups.io/mt/91204554/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to