From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: chasel.chiu@intel.com) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by groups.io with SMTP; Mon, 19 Aug 2019 19:48:21 -0700 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; 19 Aug 2019 19:48:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,407,1559545200"; d="scan'208";a="183051341" Received: from kmsmsx154.gar.corp.intel.com ([172.21.73.14]) by orsmga006.jf.intel.com with ESMTP; 19 Aug 2019 19:48:20 -0700 Received: from pgsmsx111.gar.corp.intel.com ([169.254.2.22]) by KMSMSX154.gar.corp.intel.com ([169.254.12.93]) with mapi id 14.03.0439.000; Tue, 20 Aug 2019 10:44:45 +0800 From: "Chiu, Chasel" To: "Cheng, Ching JenX" , "devel@edk2.groups.io" CC: "Chan, Amy" , "Kubacki, Michael A" , "Desimone, Nathaniel L" , "Gao, Liming" Subject: Re: [edk2-platforms: PATCH v2] Python run fail if env variable PYTHON_HOME is not set Thread-Topic: [edk2-platforms: PATCH v2] Python run fail if env variable PYTHON_HOME is not set Thread-Index: AQHVVm/YyB7JVHUSOUalSQhB/6brFqcDVKFA Date: Tue, 20 Aug 2019 02:44:45 +0000 Message-ID: <3C3EFB470A303B4AB093197B6777CCEC50463E69@PGSMSX111.gar.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: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNjI4M2JiNTctOWExZC00OGY1LWEzMTYtNDhkYmFiYjk3MDNlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiTjFjZFhwRXJGTkNBR3EwODR0Zk5lNTg4MFE1WlRxR2hSVzFpT2JBRis0d0ZCaGttUU90WDhNSkVvcXRTYXRjNiJ9 x-ctpclassification: CTP_NT x-originating-ip: [172.30.20.206] MIME-Version: 1.0 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Pushed: https://github.com/tianocore/edk2-platforms/commit/05e9ca3abfcf8979= 5d90e31415bac28a9f350299 > -----Original Message----- > From: Cheng, Ching JenX > Sent: Monday, August 19, 2019 5:24 PM > To: devel@edk2.groups.io > Cc: Chan, Amy ; Kubacki, Michael A > ; Chiu, Chasel ; > Desimone, Nathaniel L ; Gao, Liming > > Subject: [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