From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.88, mailfrom: michael.a.kubacki@intel.com) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by groups.io with SMTP; Mon, 19 Aug 2019 15:04:38 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Aug 2019 15:04:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,406,1559545200"; d="scan'208";a="202463210" Received: from orsmsx106.amr.corp.intel.com ([10.22.225.133]) by fmsmga004.fm.intel.com with ESMTP; 19 Aug 2019 15:04:37 -0700 Received: from orsmsx162.amr.corp.intel.com (10.22.240.85) by ORSMSX106.amr.corp.intel.com (10.22.225.133) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 19 Aug 2019 15:04:37 -0700 Received: from orsmsx122.amr.corp.intel.com ([169.254.11.68]) by ORSMSX162.amr.corp.intel.com ([169.254.3.73]) with mapi id 14.03.0439.000; Mon, 19 Aug 2019 15:04:37 -0700 From: "Kubacki, Michael A" To: "devel@edk2.groups.io" , "Cheng, Ching JenX" CC: "Chan, Amy" , "Chiu, Chasel" , "Desimone, Nathaniel L" , "Gao, Liming" Subject: Re: [edk2-devel] [edk2-platforms: PATCH v2] Python run fail if env variable PYTHON_HOME is not set Thread-Topic: [edk2-devel] [edk2-platforms: PATCH v2] Python run fail if env variable PYTHON_HOME is not set Thread-Index: AQHVVm/TQvCKHXNmP0ucaaBRNd9UOqcDBV4A Date: Mon, 19 Aug 2019 22:04:36 +0000 Message-ID: <49AB4ACB9627B8468F29D589A27B745588A4FAC1@ORSMSX122.amr.corp.intel.com> References: <20190819092413.5752-1-ching.jenx.cheng@intel.com> In-Reply-To: <20190819092413.5752-1-ching.jenx.cheng@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMGUzNWI4MTYtYjQzNy00ZGNlLWE2YTMtMDkwNmQ5NmNhZjA0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoieERZeGswR3hVQTA4dDFta0Z4QzVHOUdIcWo4OXFTTTUxaEYrcXZyd09pNHdrMXBWNGVOdHJvdFVqRDJhTjRReSJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.22.254.139] MIME-Version: 1.0 Return-Path: michael.a.kubacki@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Michael Kubacki > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > Cheng, Ching JenX > Sent: Monday, August 19, 2019 2:24 AM > To: devel@edk2.groups.io > Cc: Chan, Amy ; Kubacki, Michael A > ; Chiu, Chasel ; > Desimone, Nathaniel L ; Gao, Liming > > Subject: [edk2-devel] [edk2-platforms: PATCH v2] Python run fail if env = variable > PYTHON_HOME is not set >=20 > BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2041 >=20 > [PATCH v2] Update related files >=20 > In Platform\Intel\MinPlatformPkg\Tools\Fsp\RebaseFspBinBaseAddress.py > It will run another python code. > But if the environment variable "PYTHON_HOME" is not exist and we didn't= add > any python's path to "PATH". > It will cause error because python command not found. >=20 > the error message as below: > 'python' is not recognized as an internal or external command, operable > program or batch file. >=20 > So we set the python's path from which execute the python code if > PYTHON_HOME was not exist. >=20 > Cc: Amy Chan > Cc: Michael Kubacki > Cc: Chasel Chiu > Cc: Nate DeSimone > Cc: Liming Gao > Signed-off-by: Ching JenX Cheng > --- > Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseFspBinBaseAddress.py | 2 = ++ > 1 file changed, 2 insertions(+) >=20 > diff --git > a/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseFspBinBaseAddress.py > b/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseFspBinBaseAddress.py > index a8165b08e6..fb4cf4f9b7 100644 > --- a/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseFspBinBaseAddress.py > +++ b/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseFspBinBaseAddress.py > @@ -68,6 +68,8 @@ file.close() > pythontool =3D 'python' > if 'PYTHON_HOME' in os.environ: > pythontool =3D os.environ['PYTHON_HOME'] + os.sep + 'python' > +else: > + pythontool =3D sys.executable > Process =3D subprocess.Popen([pythontool, splitFspBinPath, "info","- > f",fspBinFilePath], stdout=3Dsubprocess.PIPE) Output =3D > Process.communicate()[0] FsptInfo =3D Output.rsplit(b"FSP_M", 1); > -- > 2.21.0.windows.1 >=20 >=20 >=20