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.100, mailfrom: nathaniel.l.desimone@intel.com) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by groups.io with SMTP; Mon, 19 Aug 2019 12:04:42 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Aug 2019 12:04:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,406,1559545200"; d="scan'208";a="377528591" Received: from orsmsx109.amr.corp.intel.com ([10.22.240.7]) by fmsmga005.fm.intel.com with ESMTP; 19 Aug 2019 12:04:41 -0700 Received: from orsmsx163.amr.corp.intel.com (10.22.240.88) by ORSMSX109.amr.corp.intel.com (10.22.240.7) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 19 Aug 2019 12:04:40 -0700 Received: from orsmsx114.amr.corp.intel.com ([169.254.8.96]) by ORSMSX163.amr.corp.intel.com ([169.254.9.208]) with mapi id 14.03.0439.000; Mon, 19 Aug 2019 12:04:40 -0700 From: "Nate DeSimone" To: "Cheng, Ching JenX" , "devel@edk2.groups.io" CC: "Chan, Amy" , "Kubacki, Michael A" , "Chiu, Chasel" , "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/WuUk840iKx0SoEUNxgQmInqcC1O3A Date: Mon, 19 Aug 2019 19:04:40 +0000 Message-ID: <02A34F284D1DA44BB705E61F7180EF0AAEE1AA87@ORSMSX114.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: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNDZiNjVhOWYtODA4ZS00MzNjLWJlMTAtMmU1OGZlYmJlZDJiIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiOVd4R1JodlFaUXp4TlNhZjhYODZnWWtXMTdhaldqYnVXb3FuamU5bEJjRE1OQXpPN1k1cGZPbGlHaFNrdlwvcTgifQ== x-ctpclassification: CTP_NT x-originating-ip: [10.22.254.139] MIME-Version: 1.0 Return-Path: nathaniel.l.desimone@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Nate DeSimone -----Original Message----- From: Cheng, Ching JenX=20 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-platforms: PATCH v2] Python run fail if env variable PYTHON_= HOME is not set BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2041 [PATCH v2] Update related files 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 ad= d any python's path to "PATH". It will cause error because python command not found. the error message as below: 'python' is not recognized as an internal or external command, operable pro= gram or batch file. So we set the python's path from which execute the python code if PYTHON_HO= ME was not exist. 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(+) diff --git a/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseFspBinBaseAddres= s.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",fsp= BinFilePath], stdout=3Dsubprocess.PIPE) Output =3D Process.communicate()[0= ] FsptInfo =3D Output.rsplit(b"FSP_M", 1); -- 2.21.0.windows.1