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.24; helo=mga09.intel.com; envelope-from=yonghong.zhu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 9C12C2270D343 for ; Tue, 10 Apr 2018 23:33:25 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Apr 2018 23:33:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,434,1517904000"; d="scan'208";a="45970924" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga001.fm.intel.com with ESMTP; 10 Apr 2018 23:33:24 -0700 Received: from fmsmsx126.amr.corp.intel.com (10.18.125.43) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 10 Apr 2018 23:33:24 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX126.amr.corp.intel.com (10.18.125.43) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 10 Apr 2018 23:33:24 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.151]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.43]) with mapi id 14.03.0319.002; Wed, 11 Apr 2018 14:33:22 +0800 From: "Zhu, Yonghong" To: "Feng, YunhuaX" , "edk2-devel@lists.01.org" CC: "Gao, Liming" , "Zhu, Yonghong" Thread-Topic: [PATCH 3/3] BaseTools: fix --genfds-multi-thread generate makefile issue Thread-Index: AdPQaQpK5nH++x32S4+7mrlDlaLprAA7iugw Date: Wed, 11 Apr 2018 06:33:22 +0000 Message-ID: References: <47C64442C08CCD4089DC43B6B5E46BC484BAB6@shsmsx102.ccr.corp.intel.com> In-Reply-To: <47C64442C08CCD4089DC43B6B5E46BC484BAB6@shsmsx102.ccr.corp.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 3/3] BaseTools: fix --genfds-multi-thread generate makefile issue X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 06:33:25 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Yonghong Zhu Best Regards, Zhu Yonghong -----Original Message----- From: Feng, YunhuaX=20 Sent: Tuesday, April 10, 2018 9:13 AM To: edk2-devel@lists.01.org Cc: Zhu, Yonghong ; Gao, Liming Subject: [PATCH 3/3] BaseTools: fix --genfds-multi-thread generate makefile= issue 1. when inf file is binary module, not generate makefile, so need generate ffs with previous method. 2. generate Ui section maybe override and the string is not $(MODULE_NAME) like as: INF RuleOverride =3D UI MdeModulePkg/Application/UiApp/UiApp.inf 3. Trim generate incorrect Offset.raw when some vfr not generate .lst file in Debug directory, Trim get the VFR name with the .c files replacement. 4. fix some depex file not generate issue Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng --- BaseTools/Source/Python/GenFds/EfiSection.py | 12 ++++++++++-- BaseTools/Source/Python/GenFds/FfsInfStatement.py | 4 +++- BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py | 6 ++++-- BaseTools/Source/Python/GenFds/GuidSection.py | 2 ++ BaseTools/Source/Python/Trim/Trim.py | 2 +- 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/BaseTools/Source/Python/GenFds/EfiSection.py b/BaseTools/Sourc= e/Python/GenFds/EfiSection.py index 5029ec7a18..e6323c7879 100644 --- a/BaseTools/Source/Python/GenFds/EfiSection.py +++ b/BaseTools/Source/Python/GenFds/EfiSection.py @@ -62,10 +62,11 @@ class EfiSection (EfiSectionClassObject): InfFileName =3D FfsInf.InfFileName SectionType =3D FfsInf.__ExtendMacro__(self.SectionType) Filename =3D FfsInf.__ExtendMacro__(self.FileName) BuildNum =3D FfsInf.__ExtendMacro__(self.BuildNum) StringData =3D FfsInf.__ExtendMacro__(self.StringData) + ModuleNameStr =3D FfsInf.__ExtendMacro__('$(MODULE_NAME)') NoStrip =3D True if FfsInf.ModuleType in ('SEC', 'PEI_CORE', 'PEIM') and Sectio= nType in ('TE', 'PE32'): if FfsInf.KeepReloc !=3D None: NoStrip =3D FfsInf.KeepReloc elif FfsInf.KeepRelocFromRule !=3D None: @@ -89,12 +90,13 @@ class EfiSection (EfiSectionClassObject): =20 if not self.Optional: FileList.append(Filename) elif os.path.exists(Filename): FileList.append(Filename) - elif '.depex' in FfsInf.FinalTargetSuffixMap or FfsInf.Depex: - if IsMakefile: + elif IsMakefile: + SuffixMap =3D FfsInf.GetFinalTargetSuffixMap() + if '.depex' in SuffixMap: FileList.append(Filename) else: FileList, IsSect =3D Section.Section.GetFileList(FfsInf, self.= FileType, self.FileExtension, Dict, IsMakefile=3DIsMakefile) if IsSect : return FileList, self.Alignment @@ -177,10 +179,12 @@ clas= s EfiSection (EfiSectionClassObject): StringData =3D FfsInf.Ui InfOverrideUiString =3D True =20 if InfOverrideUiString: Num =3D SecNum + if IsMakefile and StringData =3D=3D ModuleNameStr: + StringData =3D "$(MODULE_NAME)" OutputFile =3D os.path.join( OutputPath, ModuleName + 'SEC= ' + str(Num) + Ffs.SectionSuffix.get(SectionType)) GenFdsGlobalVariable.GenerateSection(OutputFile, [], 'EFI_= SECTION_USER_INTERFACE', Ui=3DStringData, IsMa= kefile=3DIsMakefile) OutputFileList.append(OutputFile) =20 @@ -190,10 +194,12 @@ class EfiSection (EfiSectionClassObject): Num =3D '%s.%d' %(SecNum , Index) OutputFile =3D os.path.join(OutputPath, ModuleName + '= SEC' + Num + Ffs.SectionSuffix.get(SectionType)) f =3D open(File, 'r') UiString =3D f.read() f.close() + if IsMakefile and UiString =3D=3D ModuleNameStr: + UiString =3D "$(MODULE_NAME)" GenFdsGlobalVariable.GenerateSection(OutputFile, [], '= EFI_SECTION_USER_INTERFACE', Ui=3DUiString, IsM= akefile=3DIsMakefile) OutputFileList.append(OutputFile) else: if StringData !=3D None and len(StringData) > 0: @@ -206,10 +212,12 @@ class EfiSection (EfiSectionClassObject): return '', None else: EdkLogger.error("GenFds", GENFDS_ERROR, "File: %s = miss UI Section value" %InfFileName) =20 Num =3D SecNum + if IsMakefile and StringData =3D=3D ModuleNameStr: + StringData =3D "$(MODULE_NAME)" OutputFile =3D os.path.join( OutputPath, ModuleName + 'SEC= ' + str(Num) + Ffs.SectionSuffix.get(SectionType)) GenFdsGlobalVariable.GenerateSection(OutputFile, [], 'EFI_= SECTION_USER_INTERFACE', Ui=3DStringData, IsMa= kefile=3DIsMakefile) OutputFileList.append(OutputFile) =20 diff --git a/BaseTools/Source/Python/GenFds/FfsInfStatement.py b/BaseTools/= Source/Python/GenFds/FfsInfStatement.py index a348233911..84450ef3fe 100644 --- a/BaseTools/Source/Python/GenFds/FfsInfStatement.py +++ b/BaseTools/Source/Python/GenFds/FfsInfStatement.py @@ -500,13 +500,15 @@ class FfsInfStatement(FfsInfStatementClassObject): EdkLogger.error("GenFds", FORMAT_NOT_SUPPORTED, "Framework= SMM module doesn't support SMM or SMM_CORE FV file type", File=3Dself.InfF= ileName) # # For the rule only has simpleFile # MakefilePath =3D None + if self.IsBinaryModule: + IsMakefile =3D False if IsMakefile: MakefilePath =3D self.InfFileName, Arch - if isinstance (Rule, RuleSimpleFile.RuleSimpleFile) : + if isinstance (Rule, RuleSimpleFile.RuleSimpleFile): SectionOutputList =3D self.__GenSimpleFileSection__(Rule, IsMa= kefile=3DIsMakefile) FfsOutput =3D self.__GenSimpleFileFfs__(Rule, SectionOutputLis= t, MakefilePath=3DMakefilePath) return FfsOutput # # For Rule has ComplexFile diff --git a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py b/BaseT= ools/Source/Python/GenFds/GenFdsGlobalVariable.py index 97e20753ae..6437e5fa30 100644 --- a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py +++ b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py @@ -462,13 +462,15 @@ class GenFdsGlobalVariable: =20 CommandFile =3D Output + '.txt' if Ui not in [None, '']: #Cmd +=3D ["-n", '"' + Ui + '"'] if IsMakefile: - Cmd +=3D ["-n", "$(MODULE_NAME)"] + if Ui =3D=3D "$(MODULE_NAME)": + Cmd +=3D ['-n', Ui] + else: + Cmd +=3D ["-n", '"' + Ui + '"'] Cmd +=3D ["-o", Output] - #SaveFileOnChange(CommandFile, ' '.join(Cmd), False) if ' '.join(Cmd).strip() not in GenFdsGlobalVariable.SecCm= dList: GenFdsGlobalVariable.SecCmdList.append(' '.join(Cmd).s= trip()) else: SectionData =3D array.array('B', [0, 0, 0, 0]) SectionData.fromstring(Ui.encode("utf_16_le")) diff --git a/BaseTools/Source/Python/GenFds/GuidSection.py b/BaseTools/Sour= ce/Python/GenFds/GuidSection.py index ea737bb9a7..b8612be05f 100644 --- a/BaseTools/Source/Python/GenFds/GuidSection.py +++ b/BaseTools/Source/Python/GenFds/GuidSection.py @@ -270,9 +270,11 @@ class GuidSection(GuidSectionClassObject) : if 'PROCESSING_REQUIRED' in Attribute: # reset guided section alignment to none for the processed= required guided data self.Alignment =3D None self.IncludeFvSection =3D False self.ProcessRequired =3D "TRUE" + if IsMakefile and self.Alignment.strip() =3D=3D '0': + self.Alignment =3D '1' return OutputFileList, self.Alignment =20 =20 =20 diff --git a/BaseTools/Source/Python/Trim/Trim.py b/BaseTools/Source/Python= /Trim/Trim.py index d1e40b025c..b98c8ff779 100644 --- a/BaseTools/Source/Python/Trim/Trim.py +++ b/BaseTools/Source/Python/Trim/Trim.py @@ -435,11 +435,11 @@ def GenerateVfrBinSec(ModuleName, DebugDir, OutputFil= e): VfrNameList =3D [] if os.path.isdir(DebugDir): for CurrentDir, Dirs, Files in os.walk(DebugDir): for FileName in Files: Name, Ext =3D os.path.splitext(FileName) - if Ext =3D=3D '.lst': + if Ext =3D=3D '.c' and Name !=3D 'AutoGen': VfrNameList.append (Name + 'Bin') =20 VfrNameList.append (ModuleName + 'Strings') =20 EfiFileName =3D os.path.join(DebugDir, ModuleName + '.efi') -- 2.12.2.windows.2