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: ching.jenx.cheng@intel.com) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by groups.io with SMTP; Mon, 19 Aug 2019 02:23:54 -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 orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Aug 2019 02:23:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,403,1559545200"; d="scan'208";a="182815972" Received: from chingjex-mobl.gar.corp.intel.com ([10.5.246.20]) by orsmga006.jf.intel.com with ESMTP; 19 Aug 2019 02:23:52 -0700 From: "Cheng, Ching JenX" To: devel@edk2.groups.io Cc: Amy Chan , Michael Kubacki , Chasel Chiu , Nate DeSimone , Liming Gao Subject: [edk2-platforms: PATCH v2] Python run fail if env variable PYTHON_HOME is not set Date: Mon, 19 Aug 2019 17:24:13 +0800 Message-Id: <20190819092413.5752-1-ching.jenx.cheng@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=2041 [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 add 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 program or batch file. So we set the python's path from which execute the python code if PYTHON_HOME 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/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 = 'python' if 'PYTHON_HOME' in os.environ: pythontool = os.environ['PYTHON_HOME'] + os.sep + 'python' +else: + pythontool = sys.executable Process = subprocess.Popen([pythontool, splitFspBinPath, "info","-f",fspBinFilePath], stdout=subprocess.PIPE) Output = Process.communicate()[0] FsptInfo = Output.rsplit(b"FSP_M", 1); -- 2.21.0.windows.1