From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web11.3633.1656042220576800180 for ; Thu, 23 Jun 2022 20:43:40 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=MfP1MyOv; spf=pass (domain: intel.com, ip: 192.55.52.120, mailfrom: kasimx.liu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656042220; x=1687578220; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=m2FkyM0n73S5TCEd2BB+hY/HucHVIVt8F20WtQnjSas=; b=MfP1MyOv+ze2SB7hPTXJGGSTjyVwKIvstY6pgsp8ITi42dpepcAP6DE+ fTY/Zi4WQJ5IpGM46rfUDP74r+zostecRccu+WjU0vP7delqVyYsFbNRo 2CK6YXi3p4vIPgMl+wxbCte/95aIK1WcHl38g2LaQDgBZOZnjwtpebKws hDeglN6YBB7XTXSBE0QC27oKO+DfXPeEurp36bmcOMLozCc6ulC5UnXyy HzlX+yfYvf/IiUkVrwFHEKewIEWreDcUiMruzdANP7fguPQiUXs4PWi/+ 10kGBND0V+fFl+rLhoOdWx0LMrUMH4hMKeN2OgqBDZPAw8m4tGbJyWh6a g==; X-IronPort-AV: E=McAfee;i="6400,9594,10387"; a="279680392" X-IronPort-AV: E=Sophos;i="5.92,217,1650956400"; d="scan'208";a="279680392" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jun 2022 20:43:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,217,1650956400"; d="scan'208";a="678371052" Received: from jenkailx-win10.gar.corp.intel.com ([10.227.107.9]) by FMSMGA003.fm.intel.com with ESMTP; 23 Jun 2022 20:43:38 -0700 From: kasimx.liu@intel.com To: devel@edk2.groups.io Cc: KasimX Liu , Guo Dong , Ray Ni , James Lu , Gua Guo Subject: [PATCH] UefiPayloadPkg: Backward support with python 3.6 Date: Fri, 24 Jun 2022 11:43:31 +0800 Message-Id: <98515f996319d0fdef2c0e690cfa602c2a810b10.1656042140.git.kasimx.liu@intel.com> X-Mailer: git-send-email 2.32.0.windows.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: KasimX Liu REF: ttps://bugzilla.tianocore.org/show_bug.cgi?id=3D3960 Currently, UniversalPayloadBuild.py don't have support python3.6, we use python3.6 will encounter f"" failure use the change to fix it to support python3.6/3.7/3.8. Cc: Guo Dong Cc: Ray Ni Cc: James Lu Reviewed-by: Gua Guo Signed-off-by: KasimX Liu --- UefiPayloadPkg/UniversalPayloadBuild.py | 33 +++++++++++++++++++------ 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/UefiPayloadPkg/UniversalPayloadBuild.py b/UefiPayloadPkg/Unive= rsalPayloadBuild.py index c71526e0a6..ab4c977ba5 100644 --- a/UefiPayloadPkg/UniversalPayloadBuild.py +++ b/UefiPayloadPkg/UniversalPayloadBuild.py @@ -59,15 +59,15 @@ def BuildUniversalPayload(Args, MacroList): if Args.Arch =3D=3D 'X64':=0D BuildArch =3D "X64"=0D ObjCopyFlag =3D "elf64-x86-64"=0D - EntryOutputDir =3D os.path.join(BuildDir, f"{BuildTarget}_{ElfTool= Chain}", os.path.normpath("X64/UefiPayloadPkg/UefiPayloadEntry/UniversalPay= loadEntry/DEBUG/UniversalPayloadEntry.dll"))=0D + EntryOutputDir =3D os.path.join(BuildDir, "{}_{}".format (BuildTar= get, ElfToolChain), os.path.normpath("X64/UefiPayloadPkg/UefiPayloadEntry/U= niversalPayloadEntry/DEBUG/UniversalPayloadEntry.dll"))=0D else:=0D BuildArch =3D "IA32 -a X64"=0D ObjCopyFlag =3D "elf32-i386"=0D - EntryOutputDir =3D os.path.join(BuildDir, f"{BuildTarget}_{ElfTool= Chain}", os.path.normpath("IA32/UefiPayloadPkg/UefiPayloadEntry/UniversalPa= yloadEntry/DEBUG/UniversalPayloadEntry.dll"))=0D + EntryOutputDir =3D os.path.join(BuildDir, "{}_{}".format (BuildTar= get, ElfToolChain), os.path.normpath("IA32/UefiPayloadPkg/UefiPayloadEntry/= UniversalPayloadEntry/DEBUG/UniversalPayloadEntry.dll"))=0D =0D EntryModuleInf =3D os.path.normpath("UefiPayloadPkg/UefiPayloadEntry/U= niversalPayloadEntry.inf")=0D DscPath =3D os.path.normpath("UefiPayloadPkg/UefiPayloadPkg.dsc")=0D - FvOutputDir =3D os.path.join(BuildDir, f"{BuildTarget}_{ToolChain}", o= s.path.normpath("FV/DXEFV.Fv"))=0D + FvOutputDir =3D os.path.join(BuildDir, "{}_{}".format (BuildTarget, To= olChain), os.path.normpath("FV/DXEFV.Fv"))=0D PayloadReportPath =3D os.path.join(BuildDir, "UefiUniversalPayload.txt= ")=0D ModuleReportPath =3D os.path.join(BuildDir, "UefiUniversalPayloadEntry= .txt")=0D UpldInfoFile =3D os.path.join(BuildDir, "UniversalPayloadInfo.bin")=0D @@ -94,14 +94,14 @@ def BuildUniversalPayload(Args, MacroList): #=0D # Building DXE core and DXE drivers as DXEFV.=0D #=0D - BuildPayload =3D f"build -p {DscPath} -b {BuildTarget} -a X64 -t {Tool= Chain} -y {PayloadReportPath} {Quiet}"=0D + BuildPayload =3D "build -p {} -b {} -a X64 -t {} -y {} {}".format (Dsc= Path, BuildTarget, ToolChain, PayloadReportPath, Quiet)=0D BuildPayload +=3D Pcds=0D BuildPayload +=3D Defines=0D RunCommand(BuildPayload)=0D #=0D # Building Universal Payload entry.=0D #=0D - BuildModule =3D f"build -p {DscPath} -b {BuildTarget} -a {BuildArch} -= m {EntryModuleInf} -t {ElfToolChain} -y {ModuleReportPath} {Quiet}"=0D + BuildModule =3D "build -p {} -b {} -a {} -m {} -t {} -y {} {}".format = (DscPath, BuildTarget, BuildArch, EntryModuleInf, ElfToolChain, ModuleRepor= tPath, Quiet)=0D BuildModule +=3D Pcds=0D BuildModule +=3D Defines=0D RunCommand(BuildModule)=0D @@ -118,9 +118,26 @@ def BuildUniversalPayload(Args, MacroList): #=0D # Copy the DXEFV as a section in elf format Universal Payload entry.=0D #=0D - remove_section =3D f'"{LlvmObjcopyPath}" -I {ObjCopyFlag} -O {ObjCopyF= lag} --remove-section .upld_info --remove-section .upld.uefi_fv {EntryOutpu= tDir}'=0D - add_section =3D f'"{LlvmObjcopyPath}" -I {ObjCopyFlag} -O {ObjCopyF= lag} --add-section .upld_info=3D{UpldInfoFile} --add-section .upld.uefi_fv= =3D{FvOutputDir} {EntryOutputDir}'=0D - set_section =3D f'"{LlvmObjcopyPath}" -I {ObjCopyFlag} -O {ObjCopyF= lag} --set-section-alignment .upld.upld_info=3D16 --set-section-alignment .= upld.uefi_fv=3D16 {EntryOutputDir}'=0D + remove_section =3D '"{}" -I {} -O {} --remove-section .upld_info --rem= ove-section .upld.uefi_fv {}'.format (=0D + LlvmObjcopyPath,=0D + ObjCopyFlag,=0D + ObjCopyFlag,=0D + EntryOutputDir=0D + )=0D + add_section =3D '"{}" -I {} -O {} --add-section .upld_info=3D{} --a= dd-section .upld.uefi_fv=3D{} {}'.format (=0D + LlvmObjcopyPath,=0D + ObjCopyFlag,=0D + ObjCopyFlag,=0D + UpldInfoFile,=0D + FvOutputDir,=0D + EntryOutputDir=0D + )=0D + set_section =3D '"{}" -I {} -O {} --set-section-alignment .upld.upl= d_info=3D16 --set-section-alignment .upld.uefi_fv=3D16 {}'.format (=0D + LlvmObjcopyPath,=0D + ObjCopyFlag,=0D + ObjCopyFlag,=0D + EntryOutputDir=0D + )=0D RunCommand(remove_section)=0D RunCommand(add_section)=0D RunCommand(set_section)=0D --=20 2.32.0.windows.2