From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web09.3994.1581671677987520055 for ; Fri, 14 Feb 2020 01:14:38 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: yunhuax.feng@intel.com) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Feb 2020 01:14:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,440,1574150400"; d="dat'59?scan'59,208,59";a="406935782" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga005.jf.intel.com with ESMTP; 14 Feb 2020 01:14:37 -0800 Received: from shsmsx605.ccr.corp.intel.com (10.109.6.215) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 14 Feb 2020 01:14:36 -0800 Received: from shsmsx605.ccr.corp.intel.com (10.109.6.215) by SHSMSX605.ccr.corp.intel.com (10.109.6.215) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 14 Feb 2020 17:14:35 +0800 Received: from shsmsx605.ccr.corp.intel.com ([10.109.6.215]) by SHSMSX605.ccr.corp.intel.com ([10.109.6.215]) with mapi id 15.01.1713.004; Fri, 14 Feb 2020 17:14:35 +0800 From: yunhuax.feng@intel.com To: "devel@edk2.groups.io" CC: "Gao, Liming" , "Feng, Bob C" , "Zhang, Hongbin1" Subject: [edk2-staging/FceFmmt][PATCH] BaseTools/FCE: Fix multiple FVs with SEC module issue Thread-Topic: [edk2-staging/FceFmmt][PATCH] BaseTools/FCE: Fix multiple FVs with SEC module issue Thread-Index: AdXjFldz70Jm9uH1TiuqhkicdVOerg== Date: Fri, 14 Feb 2020 09:14:35 +0000 Message-ID: <5d0678bd8a4a47e0842523c28412ce8c@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: <5d0678bd8a4a47e0842523c28412ce8c@intel.com> x-originating-ip: [10.239.127.36] MIME-Version: 1.0 Return-Path: yunhuax.feng@intel.com X-Groupsio-MsgNum: 54457 Content-Type: multipart/mixed; boundary="_000_5d0678bd8a4a47e0842523c28412ce8cintelcom_" Content-Language: en-US --_000_5d0678bd8a4a47e0842523c28412ce8cintelcom_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2527 One BIOS image may have more than FVs with SEC module. FCE tool should find the latest FV with SEC module as BFV image. Cc: Bob Feng Cc: Liming Gao Signed-off-by: Yunhua Feng --- BaseTools/Source/C/BfmLib/BinFileManager.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/BaseTools/Source/C/BfmLib/BinFileManager.c b/BaseTools/Source/= C/BfmLib/BinFileManager.c index 9b4e0929f5..69521044b8 100644 --- a/BaseTools/Source/C/BfmLib/BinFileManager.c +++ b/BaseTools/Source/C/BfmLib/BinFileManager.c @@ -251,10 +251,11 @@ BfmImageAdd ( BOOLEAN FfsLevelFoundFlag; CHAR8 *OutputFileName; CHAR8 *FvId; BOOLEAN FirstInFlag; BOOLEAN FvGuidExisted; + FV_INFORMATION *FvInFdTmp; =20 NewFvLength =3D 0; FvEncapLevel =3D 0; NewAddedFfsLevel =3D 0; =20 @@ -269,10 +270,11 @@ BfmImageAdd ( TemDir =3D NULL; LocalEncapDataTemp =3D NULL; OutputFileName =3D NULL; FvId =3D NULL; FvGuidExisted =3D FALSE; + FvInFdTmp =3D NULL; =20 // // Get the size of ffs file to be inserted. // NewFfsLength =3D GetFileSize(NewFile); @@ -306,10 +308,19 @@ BfmImageAdd ( // FvInFd =3D FdData->Fv; do { if ((FvGuidExisted && mFvGuidIsSet && FvInFd->IsInputFvFlag) || ((!FvG= uidExisted || (!mFvGuidIsSet)) && FvInFd->IsBfvFlag)) { =20 + if (FvInFd->IsBfvFlag) { + FvInFdTmp =3D FdData->Fv; + while (FvInFdTmp !=3D NULL) { + if (FvInFdTmp->IsBfvFlag) { + FvInFd =3D FvInFdTmp; + } + FvInFdTmp =3D FvInFdTmp->FvNext; + } + } Status =3D LibLocateBfv (FdData, &FvId, &FvInFd); =20 if (EFI_ERROR (Status)) { printf("Error while locate BFV from FD.\n"); LibBfmFreeFd(FdData); --=20 2.12.2.windows.2 --_000_5d0678bd8a4a47e0842523c28412ce8cintelcom_ Content-Disposition: attachment; filename="winmail.dat" Content-Transfer-Encoding: base64 Content-Type: application/ms-tnef; name="winmail.dat" eJ8+ImFaAQaQCAAEAAAAAAABAAEAAQeQBgAIAAAA5AQAAAAAAADoAAEJgAEAIQAAAENGMzM1MjE0 MjJBMDkzNDc4NDM3QjQxMDhBNjkzOEQ5AOQGAQ2ABAACAAAAAgACAAEFgAMADgAAAOQHAgAOAAkA DgAjAAUAOgEBIIADAA4AAADkBwIADgAJAA4AIwAFADoBAQiABwAYAAAASVBNLk1pY3Jvc29mdCBN YWlsLk5vdGUAMQgBBIABAFQAAABbZWRrMi1zdGFnaW5nL0ZjZUZtbXRdW1BBVENIXSBCYXNlVG9v bHMvRkNFOiBGaXggbXVsdGlwbGUgRlZzIHdpdGggU0VDIG1vZHVsZSBpc3N1ZQDcHAELgAEAIQAA AENGMzM1MjE0MjJBMDkzNDc4NDM3QjQxMDhBNjkzOEQ5AOQGAQOQBgDcFQAARQAAAAIBfwABAAAA LQAAADw1ZDA2NzhiZDhhNGE0N2UwODQyNTIzYzI4NDEyY2U4Y0BpbnRlbC5jb20+AAAAAAsAHw4A AAAAAgEJEAEAAABQBQAATAUAAPUKAABMWkZ1eWyEaWEACmZiaWQEAABjY8BwZzEyNTIA/gND8HRl eHQB9wKkA+MCAARjaArAc2V0MCDvB20Cg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