From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web11.5089.1652948520951221834 for ; Thu, 19 May 2022 01:22:01 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=dCo49uBh; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: jie.yang@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652948521; x=1684484521; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=E/9wvyizymZz3Nbpl4atjWTAU85kDgLSrMRdA/IaGR0=; b=dCo49uBht6FlISkhJcg7gy+XgAq+BLGkQk8+3l7ctWz4qgRxcUhZeETV J/uE9242hqM0jG5JsXVFZ3+iXAickZWtPYLeZAI3vJ0aEGHmiJWzF7tPw rk3RR08YpzQxHiG/gSAj+o8owBJdC3At06blgG1Xjvgc9jNHOyT3w4X+s 2LR1TKUpXzu/aV50APeqpIQAvDQAPJzbwUHC6T0jCN6J1e2Ix5uor86JW GYLY8AwPYI1l/fHWShg13ahpElb6TJOyVRNFH8fGk0Ka7AL4rFHrxXmA1 hgfV8Q3pAT0qhnd6VtmSFE/I7x08mtyKQBrBS1Z5kD1+lvktU+1bIV4r2 A==; X-IronPort-AV: E=McAfee;i="6400,9594,10351"; a="271786542" X-IronPort-AV: E=Sophos;i="5.91,237,1647327600"; d="scan'208";a="271786542" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 May 2022 01:22:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,237,1647327600"; d="scan'208";a="742794150" Received: from desktop-yang.ccr.corp.intel.com ([10.239.158.131]) by orsmga005.jf.intel.com with ESMTP; 19 May 2022 01:21:58 -0700 From: "Yang Jie" To: devel@edk2.groups.io Cc: bob.c.feng@intel.com, gaoliming@byosoft.com.cn, yuwei.chen@intel.com, "jie.yang" Subject: [PATCH] [edk2-staging] [PATCH] BaseTools/Bfm: Fix "-g" input FV is not BFV issue Date: Thu, 19 May 2022 16:21:37 +0800 Message-Id: <20220519082137.2330-1-jie.yang@intel.com> X-Mailer: git-send-email 2.26.2.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 Cc: Bob Feng Cc: Liming Gao Cc: Yuwei Chen --- 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 @@ =0D The main entry of BFM tool.=0D =0D - Copyright (c) 2011-2019, Intel Corporation. All rights reserved.
=0D + Copyright (c) 2011-2022, Intel Corporation. All rights reserved.
=0D SPDX-License-Identifier: BSD-2-Clause-Patent=0D =0D **/=0D @@ -310,7 +310,10 @@ BfmImageAdd ( do {=0D if ((FvGuidExisted && mFvGuidIsSet && FvInFd->IsInputFvFlag) || ((!FvG= uidExisted || (!mFvGuidIsSet)) && FvInFd->IsBfvFlag)) {=0D =0D - if (FvInFd->IsBfvFlag) {=0D + if (FvInFd->IsBfvFlag && !FvGuidExisted) {=0D + //=0D + // No target FV is set, find the last BFV to insert Binary=0D + //=0D FvInFdTmp =3D FdData->Fv;=0D while (FvInFdTmp !=3D NULL) {=0D if (FvInFdTmp->IsBfvFlag) {=0D --=20 2.26.2.windows.1