From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web12.8437.1660023233945531449 for ; Mon, 08 Aug 2022 22:33:54 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=LBRMBe2D; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: guo.dong@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660023233; x=1691559233; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=IfXvpuevlR2YG4QT8pO9xKQCb8Xj7ZO032Ub2RQfK3k=; b=LBRMBe2DXnyqv6c9ciFqwjYG7B83umNIgix8v6V00k7ykXk+xj0Ff9fK ruKxlwFOPk0URLE67a+JQi1HXSrHMWLcjhc4H7O45qSCVFi7hEleQziiA LgCGleU/otH+bJ9VGXvqwodeHK+pA/Xz1mFn2mdgUPsF/EMn4if3oTVCY 8e8SlJmn4lHKWCNuXenQRgG/1/ycKeL1O1/5amBUzD9h8AeK2XL5MdVAY 9IdEiki3cwdWVLd+Ok7m2mqQCVj0PvnNw+/ZAbfDghQdQGK+2J0Fkq2in iRX4+asw+yNQbxq41NsIoq+eB2KYa6Grgw5bv+hWWqE8B/HRSvG8XZa/Q A==; X-IronPort-AV: E=McAfee;i="6400,9594,10433"; a="354760343" X-IronPort-AV: E=Sophos;i="5.93,223,1654585200"; d="scan'208";a="354760343" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2022 22:33:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,223,1654585200"; d="scan'208";a="608094675" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga007.fm.intel.com with ESMTP; 08 Aug 2022 22:33:53 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Mon, 8 Aug 2022 22:33:51 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Mon, 8 Aug 2022 22:33:51 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28 via Frontend Transport; Mon, 8 Aug 2022 22:33:51 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.177) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.28; Mon, 8 Aug 2022 22:33:50 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AcGQWcBxEMMjuLZe5Npd4IeGOjdAiWZLfoAZD2x+HgqU+MtRHf3zOxMWpXLsRnpPTZnzVvfwH2NlTHL+GcAEU8lHuVOUM7LJfL9n0HLnEDCXwDpCgGILkdHcCAuKl48IrRkZYjn5i8OAiUFxsulzLI5pKx464SYeOdLOpVzvjM3dlRN43SgvoVxvADGHLgULeRl03cmL6Kq6xTMmBwcR8Ay5M1WI9a1m11ZZvcte7rolHSpwjXp7F5mLN8hpeuA2J+n58FoBG7EAF+bb83Cj5o6XymGELGXRMjI5ZVuh605fwi0Sgyrn1kA2qP2jhpHcHAt9AVOhsBu4ow715e/Egw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=DdzMY1a8hW/GRwZyZCf3C4ABWOi6F2IkpFfCsje66t4=; b=IL4NAY1IF2dk/6P5gieEe0CnH53bYFuC7xHdzkEBG9IMW9wji04nabGQyZKm1CgBazQO63tMxZtTt8+VY+iDEbvFaTHb6MIlqNDwEcNZpI7079FZbLzHTy5gBAd93FdbYlAyOII1C6S2Nvrza0cYt/pY8PSarqrmue51VvVXriX3ImoiZlm3LouxXf5okhyYU633fQT3DR+6sIaER5/Xp7NdY5ToEF5h3FOfSvY6BP9+yGlj8qkNjIDQwIDnATlCUA18oPzmQ2RuOzIoiJUnTRNo1RMHS1wkf7+Lo6zmNAMJqiO3Kf2pJtnvGPon67luFNveOiGvWo0GicaHmtCz/g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from CY5PR11MB6260.namprd11.prod.outlook.com (2603:10b6:930:23::16) by SJ0PR11MB4830.namprd11.prod.outlook.com (2603:10b6:a03:2d7::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.16; Tue, 9 Aug 2022 05:33:44 +0000 Received: from CY5PR11MB6260.namprd11.prod.outlook.com ([fe80::d51:f743:8ca2:8160]) by CY5PR11MB6260.namprd11.prod.outlook.com ([fe80::d51:f743:8ca2:8160%6]) with mapi id 15.20.5504.020; Tue, 9 Aug 2022 05:33:43 +0000 From: "Guo Dong" To: "Liu, KasimX" , "devel@edk2.groups.io" CC: "Ni, Ray" , "Lu, James" , "Guo, Gua" Subject: Re: [PATCH] UefiPayloadPkg: Backward support with python 3.6 Thread-Topic: [PATCH] UefiPayloadPkg: Backward support with python 3.6 Thread-Index: AQHYh3yjAhodQVY990eXxKbMWJ5hWq2mU+9w Date: Tue, 9 Aug 2022 05:33:43 +0000 Message-ID: References: <98515f996319d0fdef2c0e690cfa602c2a810b10.1656042140.git.kasimx.liu@intel.com> In-Reply-To: <98515f996319d0fdef2c0e690cfa602c2a810b10.1656042140.git.kasimx.liu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.500.17 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: cbeabce8-bbd2-438d-4cb7-08da79c8b982 x-ms-traffictypediagnostic: SJ0PR11MB4830:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 9nV5ohH3RFDBgEfF5r3TRgbbnxFJYUufh23j1Myhwq6xiWs5nCq66hhxNcdvaoGlMhtPGVEvHqkLoZ+I3qpqouJjF30MtLLgQbjYAx33rqVM39YPOrrK6KIn5jwwxf8qk8Z948kewMl8whhtwE6dotWWNdvrfOHf3ijwu4EJ0Abr7iPnrzEUTki/3oB/nuqZNNDi/VgXkya8HuWUITzvWbq0+BayqgZjTNe19EpMPCd2X3rtguFXeWNAcBg630mQ76XOHJ0WnIrhqbISkboTR4hsJyGcIfJLIJ4R5otCpDJ6BNrOv3OuO6fPvj868Khwo4is5tR5akT2u/3DKRDruzbJUPdB4cxwUqAhk7QuOa2nvS3VcuARy0FSA/Afq+5hDDzCD9Koru0lrmBuO36SHIdqVxrsc1JTIDStF/cVcMSVpoDVKiD9TOMYJf0XS88losvUzTPWg70sMQvzm+aLXo05aobtAm+BUAcukorNg3HP1NFDIMli7HFF+CdfoeXGx07wnlMlkUmAKNLz2PHVgQlRUhwzDvTcDCAvk0gjSl8bAjae7juC2ZRBTqqsGyGhMMVnMN+YGuWe/C7TIBtq2C6qBXHb3d+3T/UPetSSDN5TA7hC8lRdIpmw3hVvSBZrQ4wHh2fEw/2glb4qs8leRcDXWXIt2VHsOX1vxSQ2ZZl6dTCj1zEgFHH4S6Mg7qYzrlmERBkvo3EExm9pVBpStJnaPM/0Hta/qOJM1bk674DzhixCiQRctL+lCrS9ocGykvYv7kYFKRbUYgZpdQVLtnvhGoFqrXkc7jy5BU4WzAR0THfAxW/q8P2Huz7weUVu x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY5PR11MB6260.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(376002)(136003)(39860400002)(396003)(346002)(366004)(83380400001)(76116006)(4326008)(64756008)(66446008)(66556008)(66476007)(66946007)(38100700002)(82960400001)(8676002)(122000001)(2906002)(38070700005)(8936002)(52536014)(71200400001)(107886003)(9686003)(54906003)(110136005)(316002)(186003)(5660300002)(478600001)(7696005)(41300700001)(6506007)(53546011)(33656002)(55016003)(86362001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?UhIuk6N2BM0cOMJE1QWad6n5moeU8EdoQXfKNsiNHzIV1+erNkv+Ki3lGaEu?= =?us-ascii?Q?AqGpn9UAygtWvOX8VloukwBxdqlYNWTTgAresl7dKIdozjsnTOzxkg0I8vEr?= =?us-ascii?Q?T2sNVLNv1L7IEyGAYMmPjcgygGacAZ9CPzX4f0pM8JBP2YuF7agSq7uniCam?= =?us-ascii?Q?PrUdxWGWpwQGEmberEDd1n3HP1XAtrsLSn7FlGyjZ3N1WXT49NlJI8NosRBy?= =?us-ascii?Q?qoAv1ykyJ6alX2ErE3ABGextLRqx5FVeNruTABx3YI/J/5nJOOsrhj2lDsuK?= =?us-ascii?Q?6rYx6Zg3Lgu1K4IHaGbFLgzd28GBwsqGeRYzVCgtkMsHnDOdl/LmNeInV8YU?= =?us-ascii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pA2mFHSJVEMo8uWi5z6?= =?us-ascii?Q?K2zX73IvKmZhRGaCReLFxdACZ7mfMBD1L9QTGN0TqgEqe5Kd0HK5Ro8OaTNi?= =?us-ascii?Q?qzNu4cbIqh9Re+RfV45u0wnEnGAOGgbbVHHNsmRzVouNr7+40AcIdPXfLhZG?= =?us-ascii?Q?vJDIxkz2nr5/yA/q4/rbOiFb6hhbPFL/IDYC01mxPt92WvLF9SZWN61glZzn?= =?us-ascii?Q?z4JpxeLbXpfABXOQqmHJrszvuNxo/+A/5Uq+3k7XPcfFgYmvvrk6p41eOg2x?= =?us-ascii?Q?sy3vrRDzRtffcyRUtPF+aLmkqckjUS4eN0u6TWZWHNDbR5h3MNoTbiv4LmjE?= =?us-ascii?Q?m+jUneDFhSO5a0RTsNVd45UakiBKJE/c9nwruoEaMas63ZuqYCvjAAVqjFMY?= =?us-ascii?Q?M04vSVmCswpEhob4na6NkNMIVA+plHR5brGz6TSiLT4Z?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CY5PR11MB6260.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: cbeabce8-bbd2-438d-4cb7-08da79c8b982 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Aug 2022 05:33:43.8934 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: jFLcdLmfyn6MxnGkmqa6oKChBAB0Kx76G3yDVvCSBjH5CCw8/W7wq0AJQOMGBSv3tqtSUWXPM9gud0iGlqzy7A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB4830 Return-Path: guo.dong@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Guo Dong -----Original Message----- From: Liu, KasimX =20 Sent: Thursday, June 23, 2022 8:44 PM To: devel@edk2.groups.io Cc: Liu, KasimX ; Dong, Guo ; Ni,= Ray ; Lu, James ; Guo, Gua Subject: [PATCH] UefiPayloadPkg: Backward support with python 3.6 From: KasimX Liu REF: ttps://bugzilla.tianocore.org/show_bug.cgi?id=3D3960 Currently, UniversalPayloadBuild.py don't have support python3.6, we use py= thon3.6 will encounter f"" failure use the change to fix it to support pyth= on3.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': BuildArch =3D "X64" Ob= jCopyFlag =3D "elf64-x86-64"- EntryOutputDir =3D os.path.join(Bui= ldDir, f"{BuildTarget}_{ElfToolChain}", os.path.normpath("X64/UefiPayloadPk= g/UefiPayloadEntry/UniversalPayloadEntry/DEBUG/UniversalPayloadEntry.dll"))= + EntryOutputDir =3D os.path.join(BuildDir, "{}_{}".format (BuildTar= get, ElfToolChain), os.path.normpath("X64/UefiPayloadPkg/UefiPayloadEntry/U= niversalPayloadEntry/DEBUG/UniversalPayloadEntry.dll")) else: B= uildArch =3D "IA32 -a X64" ObjCopyFlag =3D "elf32-i386"- = EntryOutputDir =3D os.path.join(BuildDir, f"{BuildTarget}_{ElfToolChai= n}", os.path.normpath("IA32/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloa= dEntry/DEBUG/UniversalPayloadEntry.dll"))+ EntryOutputDir =3D os.pat= h.join(BuildDir, "{}_{}".format (BuildTarget, ElfToolChain), os.path.normpa= th("IA32/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry/DEBUG/Univer= salPayloadEntry.dll")) EntryModuleInf =3D os.path.normpath("UefiPayloa= dPkg/UefiPayloadEntry/UniversalPayloadEntry.inf") DscPath =3D os.path.n= ormpath("UefiPayloadPkg/UefiPayloadPkg.dsc")- FvOutputDir =3D os.path.jo= in(BuildDir, f"{BuildTarget}_{ToolChain}", os.path.normpath("FV/DXEFV.Fv"))= + FvOutputDir =3D os.path.join(BuildDir, "{}_{}".format (BuildTarget, To= olChain), os.path.normpath("FV/DXEFV.Fv")) PayloadReportPath =3D os.pat= h.join(BuildDir, "UefiUniversalPayload.txt") ModuleReportPath =3D os.pa= th.join(BuildDir, "UefiUniversalPayloadEntry.txt") UpldInfoFile =3D os.= path.join(BuildDir, "UniversalPayloadInfo.bin")@@ -94,14 +94,14 @@ def Buil= dUniversalPayload(Args, MacroList): # # Building DXE core and DXE drivers as DXEFV. #- BuildPay= load =3D f"build -p {DscPath} -b {BuildTarget} -a X64 -t {ToolChain} -y {Pa= yloadReportPath} {Quiet}"+ BuildPayload =3D "build -p {} -b {} -a X64 -t= {} -y {} {}".format (DscPath, BuildTarget, ToolChain, PayloadReportPath, Q= uiet) BuildPayload +=3D Pcds BuildPayload +=3D Defines RunComma= nd(BuildPayload) # # Building Universal Payload entry. #- Bu= ildModule =3D f"build -p {DscPath} -b {BuildTarget} -a {BuildArch} -m {Entr= yModuleInf} -t {ElfToolChain} -y {ModuleReportPath} {Quiet}"+ BuildModul= e =3D "build -p {} -b {} -a {} -m {} -t {} -y {} {}".format (DscPath, Build= Target, BuildArch, EntryModuleInf, ElfToolChain, ModuleReportPath, Quiet) = BuildModule +=3D Pcds BuildModule +=3D Defines RunCommand(BuildM= odule)@@ -118,9 +118,26 @@ def BuildUniversalPayload(Args, MacroList): # # Copy the DXEFV as a section in elf format Universal Payload en= try. #- remove_section =3D f'"{LlvmObjcopyPath}" -I {ObjCopyFlag} -O= {ObjCopyFlag} --remove-section .upld_info --remove-section .upld.uefi_fv {= EntryOutputDir}'- add_section =3D f'"{LlvmObjcopyPath}" -I {ObjCopyFl= ag} -O {ObjCopyFlag} --add-section .upld_info=3D{UpldInfoFile} --add-sectio= n .upld.uefi_fv=3D{FvOutputDir} {EntryOutputDir}'- set_section =3D f'= "{LlvmObjcopyPath}" -I {ObjCopyFlag} -O {ObjCopyFlag} --set-section-alignme= nt .upld.upld_info=3D16 --set-section-alignment .upld.uefi_fv=3D16 {EntryOu= tputDir}'+ remove_section =3D '"{}" -I {} -O {} --remove-section .upld_i= nfo --remove-section .upld.uefi_fv {}'.format (+ Llvm= ObjcopyPath,+ ObjCopyFlag,+ Obj= CopyFlag,+ EntryOutputDir+ )+ = add_section =3D '"{}" -I {} -O {} --add-section .upld_info=3D{} --add-= section .upld.uefi_fv=3D{} {}'.format (+ LlvmObjcopyP= ath,+ ObjCopyFlag,+ ObjCopyFlag= ,+ UpldInfoFile,+ FvOutputDir,+= EntryOutputDir+ )+ set_sect= ion =3D '"{}" -I {} -O {} --set-section-alignment .upld.upld_info=3D16 -= -set-section-alignment .upld.uefi_fv=3D16 {}'.format (+ = LlvmObjcopyPath,+ ObjCopyFlag,+ = ObjCopyFlag,+ EntryOutputDir+ = ) RunCommand(remove_section) RunCommand(add_section) RunComm= and(set_section)--=20 2.32.0.windows.2