From nobody Sat May 4 19:06:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+46025+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+46025+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1566199269; cv=none; d=zoho.com; s=zohoarc; b=CKlERvyuL+S0aojwMieYSsrMlKsQLDiisZ24V/8dpuo4vSJNqpOF8h80fzk9glZxmc58ZciZfsDC9TbSol4xzQ7bqRM3O2MJJDyZoztJxTqGEXC7TnC5qfr6wEntfDg8GEsyhynkboakbLd4SDZPSYiJBc0AOgWCYMgXrGeXlYI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566199269; h=Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To:ARC-Authentication-Results; bh=8eN2NcLrYBr3qKAgXdO+AdgE1YZpGzZAieSPduPZkl4=; b=XP5R0g6oZgF/PUdoW3DSQgmp6km5lq2RULVK6vjvvpW8keep4Jtmm2h6wzymAw3rnkpz9ZSluHRYYrRkGASw9y/DkmRJpADm/kN0+wJ/dSKe1k96kRsXWf3iYIve7OftjG1tiZEkESuUWV3vu2C1ibNGKMN090emYN0VP6hbQFU= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+46025+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1566199269919828.6558822208528; Mon, 19 Aug 2019 00:21:09 -0700 (PDT) Return-Path: X-Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by groups.io with SMTP; Mon, 19 Aug 2019 00:21:09 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Aug 2019 00:21:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,403,1559545200"; d="scan'208";a="353161344" X-Received: from unknown (HELO chingjex-MOBL.gar.corp.intel.com) ([10.5.246.20]) by orsmga005.jf.intel.com with ESMTP; 19 Aug 2019 00:21:07 -0700 From: "Cheng, Ching JenX" To: devel@edk2.groups.io Cc: Amy Chan , Michael Kubacki , Chasel Chiu , Nate DeSimone , Liming Gao Subject: [edk2-devel] [PATCH] Python run fail if env variable PYTHON_HOME is not set Date: Mon, 19 Aug 2019 15:21:28 +0800 Message-Id: <20190819072128.15400-1-ching.jenx.cheng@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ching.jenx.cheng@intel.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1566199269; bh=jobaXO+GCb05ZCsMIRvB+UVh0GJ3gxbmWPviNVvqD2U=; h=Cc:Date:From:Reply-To:Subject:To; b=P+ASyUjLYYemGKsHKwVK4ret7vwvtLtIrtERGsBF9ahFK3gBLDVK/P1Aeohlp4wpr0j K4l+8eIMIqPVygwXjwmHMEFFk5sSfxL9wIkfor+rLaMfq4aDuUYq8453tw86QyKyi8fs6 glslgcV8eFpNKIiztJbim5xOkNKWc16/KVs= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2041 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/RebaseAndPatchFspBinBaseAddress.py= | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBa= seAddress.py b/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBin= BaseAddress.py index 406e5ec130..1d72b4112f 100644 --- a/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBaseAddre= ss.py +++ b/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBaseAddre= ss.py @@ -76,6 +76,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); --=20 2.21.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#46025): https://edk2.groups.io/g/devel/message/46025 Mute This Topic: https://groups.io/mt/32941571/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-