From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web08.17234.1621818029044971005 for ; Sun, 23 May 2021 18:00:29 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: ianx.kuo@intel.com) IronPort-SDR: mNNfP3QCwf9u/VTA6eTS6g0OdT63LcrmxDXPCz+giAq7ud03z7Nu88o3RYpEHRRwkuU19CcGDH r9cq0TNvI3MA== X-IronPort-AV: E=McAfee;i="6200,9189,9993"; a="188953940" X-IronPort-AV: E=Sophos;i="5.82,319,1613462400"; d="scan'208";a="188953940" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 May 2021 18:00:27 -0700 IronPort-SDR: LRk/a8zr1LMLf+Fma9GgFtz+0/y2np1Re+v3gy3W0WaMdD5ruKUzZCo6gwYr4e0hpzyoL8yqzG Vwgi3v3ddS/Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,319,1613462400"; d="scan'208";a="545674513" Received: from ikuox-desk1.gar.corp.intel.com ([10.227.107.18]) by fmsmga001.fm.intel.com with ESMTP; 23 May 2021 18:00:26 -0700 From: "IanX Kuo" To: devel@edk2.groups.io Cc: ianx.kuo@intel.com, Chasel Chiu , Nate DeSimone Subject: [PATCH v2] MinPlatformPkg/Fsp: Rebase fail when python tools path exist whitespace Date: Mon, 24 May 2021 09:00:23 +0800 Message-Id: <7ba0ed4ad8bbeff173bfe767bb9525c21aca9da0.1621817960.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 | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBa= seAddress.py b/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBin= BaseAddress.py index 406e5ec130..a3d5263ad0 100644 --- a/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBaseAddre= ss.py +++ b/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBaseAddre= ss.py @@ -70,12 +70,16 @@ for line in flashmap.split("\n"): file.close()=0D =0D #=0D -# Get FSP-M Size, in order to calculate the FSP-T Base. Used SplitFspBin.p= y script =0D +# Get FSP-M Size, in order to calculate the FSP-T Base. Used SplitFspBin.p= y script=0D # to dump the header, and get the ImageSize in FSP-M section=0D #=0D 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..50e442a500 100644 --- a/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseFspBinBaseAddress.py +++ b/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseFspBinBaseAddress.py @@ -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.27.0.windows.1