From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.65; helo=mga03.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B530122280C29 for ; Thu, 28 Dec 2017 18:26:03 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Dec 2017 18:31:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,473,1508828400"; d="scan'208";a="6542299" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga006.jf.intel.com with ESMTP; 28 Dec 2017 18:31:00 -0800 Received: from fmsmsx154.amr.corp.intel.com (10.18.116.70) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 28 Dec 2017 18:31:00 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX154.amr.corp.intel.com (10.18.116.70) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 28 Dec 2017 18:30:59 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.152]) by shsmsx102.ccr.corp.intel.com ([169.254.2.189]) with mapi id 14.03.0319.002; Fri, 29 Dec 2017 10:30:58 +0800 From: "Gao, Liming" To: "Zhu, Yonghong" , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [Patch] BaseTools: Fix a bug for different FV use same FILE statement Guid Thread-Index: AQHTgAMNfCr0uPx2GkW33oPHbdpFq6NZmfCQ Date: Fri, 29 Dec 2017 02:30:57 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E19AF65@SHSMSX104.ccr.corp.intel.com> References: <1514482854-3892-1-git-send-email-yonghong.zhu@intel.com> In-Reply-To: <1514482854-3892-1-git-send-email-yonghong.zhu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] BaseTools: Fix a bug for different FV use same FILE statement Guid X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Dec 2017 02:26:04 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao >-----Original Message----- >From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of >Yonghong Zhu >Sent: Friday, December 29, 2017 1:41 AM >To: edk2-devel@lists.01.org >Subject: [edk2] [Patch] BaseTools: Fix a bug for different FV use same FIL= E >statement Guid > >We meet a case that different FV use same FILE statement Guid, but the >FILE content is different. current we use the Guid value as Ffs file >dir which cause the ffs file will be override. This patch use Guid >value and Fv name as ffs dir for FILE statement. > >Contributed-under: TianoCore Contribution Agreement 1.1 >Signed-off-by: Yonghong Zhu >--- > BaseTools/Source/Python/GenFds/FfsFileStatement.py | 7 +++++-- > BaseTools/Source/Python/GenFds/FfsInfStatement.py | 2 +- > BaseTools/Source/Python/GenFds/Fv.py | 2 +- > 3 files changed, 7 insertions(+), 4 deletions(-) > >diff --git a/BaseTools/Source/Python/GenFds/FfsFileStatement.py >b/BaseTools/Source/Python/GenFds/FfsFileStatement.py >index edb1312..12ec95b 100644 >--- a/BaseTools/Source/Python/GenFds/FfsFileStatement.py >+++ b/BaseTools/Source/Python/GenFds/FfsFileStatement.py >@@ -55,11 +55,11 @@ class FileStatement (FileStatementClassObject) : > # @param Dict dictionary contains macro and value pair > # @param FvChildAddr Array of the inside FvImage base address > # @param FvParentAddr Parent Fv base address > # @retval string Generated FFS file name > # >- def GenFfs(self, Dict =3D {}, FvChildAddr=3D[], FvParentAddr=3DNone, >IsMakefile=3DFalse): >+ def GenFfs(self, Dict =3D {}, FvChildAddr=3D[], FvParentAddr=3DNone, >IsMakefile=3DFalse, FvName=3DNone): > > if self.NameGuid !=3D None and self.NameGuid.startswith('PCD('): > PcdValue =3D GenFdsGlobalVariable.GetPcdValue(self.NameGuid) > if len(PcdValue) =3D=3D 0: > EdkLogger.error("GenFds", GENFDS_ERROR, '%s NOT defined.'= \ >@@ -70,11 +70,14 @@ class FileStatement (FileStatementClassObject) : > if len(RegistryGuidStr) =3D=3D 0: > EdkLogger.error("GenFds", GENFDS_ERROR, 'GUID value for %= s in >wrong format.' \ > % (self.NameGuid)) > self.NameGuid =3D RegistryGuidStr > >- OutputDir =3D os.path.join(GenFdsGlobalVariable.FfsDir, self.Name= Guid) >+ Str =3D self.NameGuid >+ if FvName: >+ Str +=3D FvName >+ OutputDir =3D os.path.join(GenFdsGlobalVariable.FfsDir, Str) > if not os.path.exists(OutputDir): > os.makedirs(OutputDir) > > Dict.update(self.DefineVarDict) > SectionAlignments =3D None >diff --git a/BaseTools/Source/Python/GenFds/FfsInfStatement.py >b/BaseTools/Source/Python/GenFds/FfsInfStatement.py >index 4b47817..baee543 100644 >--- a/BaseTools/Source/Python/GenFds/FfsInfStatement.py >+++ b/BaseTools/Source/Python/GenFds/FfsInfStatement.py >@@ -420,11 +420,11 @@ class FfsInfStatement(FfsInfStatementClassObject): > # @param Dict dictionary contains macro and value pair > # @param FvChildAddr Array of the inside FvImage base address > # @param FvParentAddr Parent Fv base address > # @retval string Generated FFS file name > # >- def GenFfs(self, Dict =3D {}, FvChildAddr =3D [], FvParentAddr=3DNone= , >IsMakefile=3DFalse): >+ def GenFfs(self, Dict =3D {}, FvChildAddr =3D [], FvParentAddr=3DNone= , >IsMakefile=3DFalse, FvName=3DNone): > # > # Parse Inf file get Module related information > # > > self.__InfParse__(Dict) >diff --git a/BaseTools/Source/Python/GenFds/Fv.py >b/BaseTools/Source/Python/GenFds/Fv.py >index d5922c0..a69abb3 100644 >--- a/BaseTools/Source/Python/GenFds/Fv.py >+++ b/BaseTools/Source/Python/GenFds/Fv.py >@@ -119,11 +119,11 @@ class FV (FvClassObject): > if Flag: > if isinstance(FfsFile, FfsFileStatement.FileStatement): > continue > if GenFdsGlobalVariable.EnableGenfdsMultiThread and >GenFdsGlobalVariable.ModuleFile and >GenFdsGlobalVariable.ModuleFile.Path.find(os.path.normpath(FfsFile.InfFile >Name)) =3D=3D -1: > continue >- FileName =3D FfsFile.GenFfs(MacroDict, FvParentAddr=3DBaseAdd= ress, >IsMakefile=3DFlag) >+ FileName =3D FfsFile.GenFfs(MacroDict, FvParentAddr=3DBaseAdd= ress, >IsMakefile=3DFlag, FvName=3Dself.UiFvName) > FfsFileList.append(FileName) > if not Flag: > self.FvInfFile.writelines("EFI_FILE_NAME =3D " + \ > FileName + \ > T_CHAR_LF) >-- >2.6.1.windows.1 > >_______________________________________________ >edk2-devel mailing list >edk2-devel@lists.01.org >https://lists.01.org/mailman/listinfo/edk2-devel