From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web09.16860.1621816454959648826 for ; Sun, 23 May 2021 17:34:15 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: ianx.kuo@intel.com) IronPort-SDR: wgqmfKarN7I7xZnjyF6BUG44/sQMFRv8unZ7eE0tc1byJ07zSaf56peIK7HJ9U7wzVk7IqXxLz u9LG5AHalGHQ== X-IronPort-AV: E=McAfee;i="6200,9189,9993"; a="287391460" X-IronPort-AV: E=Sophos;i="5.82,319,1613462400"; d="scan'208";a="287391460" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 May 2021 17:34:12 -0700 IronPort-SDR: bNhSOMqAYjB/EoLTyg29crO9pLPkp1R7zsVuuUXitXJDIT2uqbgeEljRz/K7iPtQnChnXTGnPC rQA6O3mdg0QQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,319,1613462400"; d="scan'208";a="463422110" Received: from ikuox-desk1.gar.corp.intel.com ([10.227.107.18]) by fmsmga004.fm.intel.com with ESMTP; 23 May 2021 17:34:11 -0700 From: "IanX Kuo" To: devel@edk2.groups.io Cc: IanX Kuo , Chasel Chiu , Nate DeSimone Subject: [PATCH v1] MinPlatformPkg/Fsp: Rebase fail when python tools path exist whitespace Date: Sun, 23 May 2021 17:34:01 -0700 Message-Id: <291a5618caf2b6de85721cdfe6ae0342bd571ec1.1621816349.git.ianx.kuo@intel.com> X-Mailer: git-send-email 2.30.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: IanX Kuo (a) C:\Users\\AppData\Local\Program\Python\Python38 (b) C:\Python38 (c) C:\Program Files\Python38 Issue only happens on (a) and (c). (a) happen on have whitespace. Ex: Tony Chen (c) happen on "Program Files" have whitespace. Cc: Chasel Chiu Cc: Nate DeSimone Signed-off-by: IanX Kuo --- .../Tools/Fsp/RebaseAndPatchFspBinBaseAddress.py | 6 +++++- .../MinPlatformPkg/Tools/Fsp/RebaseFspBinBaseAddress.py | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBa= seAddress.py b/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBin= BaseAddress.py index 406e5ec130..de2d49d55e 100644 --- a/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBaseAddre= ss.py +++ b/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBaseAddre= ss.py @@ -1,6 +1,6 @@ ## @ RebaseAndPatchFspBinBaseAddress.py=0D #=0D -# Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.
=0D +# Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.
=0D # SPDX-License-Identifier: BSD-2-Clause-Patent=0D #=0D =0D @@ -76,6 +76,10 @@ file.close() pythontool =3D 'python'=0D if 'PYTHON_HOME' in os.environ:=0D pythontool =3D os.environ['PYTHON_HOME'] + os.sep + 'python'=0D +else:=0D + pythontool =3D sys.executable=0D +pythontool =3D "\"" + pythontool + "\""=0D +=0D Process =3D subprocess.Popen([pythontool, splitFspBinPath, "info","-f",fsp= BinFilePath], stdout=3Dsubprocess.PIPE)=0D Output =3D Process.communicate()[0]=0D FsptInfo =3D Output.rsplit(b"FSP_M", 1);=0D diff --git a/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseFspBinBaseAddres= s.py b/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseFspBinBaseAddress.py index fb4cf4f9b7..d9adb78ca2 100644 --- a/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseFspBinBaseAddress.py +++ b/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseFspBinBaseAddress.py @@ -1,6 +1,6 @@ ## @ RebaseFspBinBaseAddress.py=0D #=0D -# Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D +# Copyright (c) 2019 - 2021, Intel Corporation. All rights reserved.
=0D # SPDX-License-Identifier: BSD-2-Clause-Patent=0D #=0D =0D @@ -70,6 +70,8 @@ if 'PYTHON_HOME' in os.environ: pythontool =3D os.environ['PYTHON_HOME'] + os.sep + 'python'=0D else:=0D pythontool =3D sys.executable=0D +pythontool =3D "\"" + pythontool + "\""=0D +=0D Process =3D subprocess.Popen([pythontool, splitFspBinPath, "info","-f",fsp= BinFilePath], stdout=3Dsubprocess.PIPE)=0D Output =3D Process.communicate()[0]=0D FsptInfo =3D Output.rsplit(b"FSP_M", 1);=0D --=20 2.30.0.windows.1