public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Yao, Jiewen" <jiewen.yao@intel.com>
To: "Gao, Liming" <liming.gao@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Re: [PATCH edk2-platforms\devel-MinPlatform] MinPlatform: Update batch file to call python.exe
Date: Fri, 6 Jul 2018 14:57:34 +0000	[thread overview]
Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503AC8E4E4@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <1530863149-9232-2-git-send-email-liming.gao@intel.com>

Reviewed-by: Jiewen.yao@intel.com

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Liming
> Gao
> Sent: Thursday, July 5, 2018 11:46 PM
> To: edk2-devel@lists.01.org
> Cc: Yao, Jiewen <jiewen.yao@intel.com>
> Subject: [edk2] [PATCH edk2-platforms\devel-MinPlatform] MinPlatform:
> Update batch file to call python.exe
> 
> Use python.exe from PYTHON_HOME
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Liming Gao <liming.gao@intel.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> ---
>  Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/bld.bat   |  2 +-
>  .../Tools/Fsp/RebaseAndPatchFspBinBaseAddress.py           |  7 ++++---
>  .../Intel/PurleyOpenBoardPkg/BoardMtOlympus/postbuild.bat  | 14
> +++++++-------
>  3 files changed, 12 insertions(+), 11 deletions(-)
> 
> diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/bld.bat
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/bld.bat
> index 6b0918c..e0ad5ee 100644
> --- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/bld.bat
> +++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/bld.bat
> @@ -50,7 +50,7 @@ del
> /f %WORKSPACE_FSP_BIN%\KabylakeFspBinPkg\Fsp_Rebased*.fd
>  cd %WORKSPACE%
> 
>  if exist %WORKSPACE_PLATFORM%\%PROJECT%\OpenBoardPkgPcd.dsc attrib
> -r %WORKSPACE_PLATFORM%\%PROJECT%\OpenBoardPkgPcd.dsc
> -@call
> python %WORKSPACE_PLATFORM%\%PLATFORM_PACKAGE%\Tools\Fsp\Rebas
> eAndPatchFspBinBaseAddress.py %WORKSPACE_PLATFORM%\%PLATFORM_BO
> ARD_PACKAGE%\Include\Fdf\FlashMapInclude.fdf %WORKSPACE_FSP_BIN%\K
> abylakeFspBinPkg
> Fsp.fd %WORKSPACE_PLATFORM%\%PROJECT%\OpenBoardPkgPcd.dsc 0x0
> +@call %PYTHON_HOME%\python.exe %WORKSPACE_PLATFORM%\%PLATFOR
> M_PACKAGE%\Tools\Fsp\RebaseAndPatchFspBinBaseAddress.py %WORKSPACE
> _PLATFORM%\%PLATFORM_BOARD_PACKAGE%\Include\Fdf\FlashMapInclude.
> fdf %WORKSPACE_FSP_BIN%\KabylakeFspBinPkg
> Fsp.fd %WORKSPACE_PLATFORM%\%PROJECT%\OpenBoardPkgPcd.dsc 0x0
> 
>  @if %ERRORLEVEL% NEQ 0 (
>    @echo !!! ERROR:RebaseAndPatchFspBinBaseAddress failed!!!
> diff --git
> a/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBaseAddress
> .py
> b/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBaseAddress
> .py
> index 7fe26df..35f3f8c 100644
> ---
> a/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBaseAddress
> .py
> +++
> b/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBaseAddress
> .py
> @@ -71,7 +71,8 @@ file.close()
>  # Get FSP-M Size, in order to calculate the FSP-T Base. Used SplitFspBin.py
> script
>  # to dump the header, and get the ImageSize in FSP-M section
>  #
> -Process = subprocess.Popen("python edk2\IntelFsp2Pkg\Tools\SplitFspBin.py
> info -f" + fspBinFilePath, stdout=subprocess.PIPE)
> +pythontool = os.environ['PYTHON_HOME'] + '\python.exe'
> +Process = subprocess.Popen(pythontool + "
> edk2\IntelFsp2Pkg\Tools\SplitFspBin.py info -f" + fspBinFilePath,
> stdout=subprocess.PIPE)
>  Output = Process.communicate()[0]
>  FsptInfo = Output.rsplit("FSP_M", 1);
>  for line in FsptInfo[1].split("\n"):
> @@ -88,13 +89,13 @@ fspTBaseAddress = flashBase + fspTBaseOffset
>  # Re-base FSP bin file to new address and save it as fspBinFileRebased using
> SplitFspBin.py
>  #
>  rebaseArguments = fspBinFilePath + " -c s m t -b " +
> str(hex(fspSBaseAddress).rstrip("L")) + " " +
> str(hex(fspMBaseAddress).rstrip("L")) + " " +
> str(hex(fspTBaseAddress).rstrip("L")) + " -o" + fspBinPath + " -n " +
> fspBinFileRebased
> -os.system("python edk2\IntelFsp2Pkg\Tools\SplitFspBin.py rebase -f" +
> rebaseArguments)
> +os.system(pythontool + " edk2\IntelFsp2Pkg\Tools\SplitFspBin.py rebase -f" +
> rebaseArguments)
> 
>  #
>  # Split FSP bin to FSP-S/M/T segments
>  #
>  splitArguments = fspBinPath +"\\" + fspBinFileRebased + " -o " + fspBinPath + "
> -n Fsp_Rebased.fd"
> -os.system("python edk2\IntelFsp2Pkg\Tools\SplitFspBin.py split -f" +
> splitArguments)
> +os.system(pythontool + " edk2\IntelFsp2Pkg\Tools\SplitFspBin.py split -f" +
> splitArguments)
> 
>  #
>  # Patch dsc file with the re-based FSP-S/M/T address, so internally build will use
> the same.
> diff --git a/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/postbuild.bat
> b/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/postbuild.bat
> index 807b942..5c787bb 100644
> --- a/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/postbuild.bat
> +++ b/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/postbuild.bat
> @@ -18,28 +18,28 @@ set /a postbuildstep=0
>  @echo BoardPostBuild.%postbuildstep% python PatchBinFv.py
>  @set /a postbuildstep=%postbuildstep%+1
>  echo
> python %WORKSPACE%\edk2-platforms\Platform\Intel\MinPlatformPkg\Tools\
> PatchFv\PatchBinFv.py %TARGET% %WORKSPACE%\edk2-non-osi\Silicon\Intel\
> PurleySiliconBinPkg %WORKSPACE%\Build\BuildReport.txt
> FvTempMemorySilicon
> -call
> python %WORKSPACE%\edk2-platforms\Platform\Intel\MinPlatformPkg\Tools\
> PatchFv\PatchBinFv.py %TARGET% %WORKSPACE%\edk2-non-osi\Silicon\Intel\
> PurleySiliconBinPkg %WORKSPACE%\Build\BuildReport.txt
> FvTempMemorySilicon
> +call %PYTHON_HOME%\python.exe %WORKSPACE%\edk2-platforms\Platform
> \Intel\MinPlatformPkg\Tools\PatchFv\PatchBinFv.py %TARGET% %WORKSPACE
> %\edk2-non-osi\Silicon\Intel\PurleySiliconBinPkg %WORKSPACE%\Build\BuildRe
> port.txt FvTempMemorySilicon
>  if %ERRORLEVEL% NEQ 0 (
>    set SCRIPT_ERROR=1
>    echo PatchBinFv Error. Exit
>    goto :EOF
>  )
>  echo
> python %WORKSPACE%\edk2-platforms\Platform\Intel\MinPlatformPkg\Tools\
> PatchFv\PatchBinFv.py %TARGET% %WORKSPACE%\edk2-non-osi\Silicon\Intel\
> PurleySiliconBinPkg %WORKSPACE%\Build\BuildReport.txt FvPreMemorySilicon
> -call
> python %WORKSPACE%\edk2-platforms\Platform\Intel\MinPlatformPkg\Tools\
> PatchFv\PatchBinFv.py %TARGET% %WORKSPACE%\edk2-non-osi\Silicon\Intel\
> PurleySiliconBinPkg %WORKSPACE%\Build\BuildReport.txt FvPreMemorySilicon
> +call %PYTHON_HOME%\python.exe %WORKSPACE%\edk2-platforms\Platform
> \Intel\MinPlatformPkg\Tools\PatchFv\PatchBinFv.py %TARGET% %WORKSPACE
> %\edk2-non-osi\Silicon\Intel\PurleySiliconBinPkg %WORKSPACE%\Build\BuildRe
> port.txt FvPreMemorySilicon
>  if %ERRORLEVEL% NEQ 0 (
>    set SCRIPT_ERROR=1
>    echo PatchBinFv Error. Exit
>    goto :EOF
>  )
>  echo
> python %WORKSPACE%\edk2-platforms\Platform\Intel\MinPlatformPkg\Tools\
> PatchFv\PatchBinFv.py %TARGET% %WORKSPACE%\edk2-non-osi\Silicon\Intel\
> PurleySiliconBinPkg %WORKSPACE%\Build\BuildReport.txt FvPostMemorySilicon
> -call
> python %WORKSPACE%\edk2-platforms\Platform\Intel\MinPlatformPkg\Tools\
> PatchFv\PatchBinFv.py %TARGET% %WORKSPACE%\edk2-non-osi\Silicon\Intel\
> PurleySiliconBinPkg %WORKSPACE%\Build\BuildReport.txt FvPostMemorySilicon
> +call %PYTHON_HOME%\python.exe %WORKSPACE%\edk2-platforms\Platform
> \Intel\MinPlatformPkg\Tools\PatchFv\PatchBinFv.py %TARGET% %WORKSPACE
> %\edk2-non-osi\Silicon\Intel\PurleySiliconBinPkg %WORKSPACE%\Build\BuildRe
> port.txt FvPostMemorySilicon
>  if %ERRORLEVEL% NEQ 0 (
>    set SCRIPT_ERROR=1
>    echo PatchBinFv Error. Exit
>    goto :EOF
>  )
>  echo
> python %WORKSPACE%\edk2-platforms\Platform\Intel\MinPlatformPkg\Tools\
> PatchFv\PatchBinFv.py %TARGET% %WORKSPACE%\edk2-non-osi\Silicon\Intel\
> PurleySiliconBinPkg %WORKSPACE%\Build\BuildReport.txt FvLateSilicon
> -call
> python %WORKSPACE%\edk2-platforms\Platform\Intel\MinPlatformPkg\Tools\
> PatchFv\PatchBinFv.py %TARGET% %WORKSPACE%\edk2-non-osi\Silicon\Intel\
> PurleySiliconBinPkg %WORKSPACE%\Build\BuildReport.txt FvLateSilicon
> +call %PYTHON_HOME%\python.exe %WORKSPACE%\edk2-platforms\Platform
> \Intel\MinPlatformPkg\Tools\PatchFv\PatchBinFv.py %TARGET% %WORKSPACE
> %\edk2-non-osi\Silicon\Intel\PurleySiliconBinPkg %WORKSPACE%\Build\BuildRe
> port.txt FvLateSilicon
>  if %ERRORLEVEL% NEQ 0 (
>    set SCRIPT_ERROR=1
>    echo PatchBinFv Error. Exit
> @@ -50,7 +50,7 @@ if %ERRORLEVEL% NEQ 0 (
>  @echo BoardPostBuild.%postbuildstep% python RebaseBinFv.py
>  @set /a postbuildstep=%postbuildstep%+1
>  echo
> python %WORKSPACE%\edk2-platforms\Platform\Intel\MinPlatformPkg\Tools\
> PatchFv\RebaseBinFv.py %TARGET% %WORKSPACE%\edk2-non-osi\Silicon\Intel
> \PurleySiliconBinPkg %WORKSPACE%\Build\BuildReport.txt FvPreMemorySilicon
> gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMBase
> -call
> python %WORKSPACE%\edk2-platforms\Platform\Intel\MinPlatformPkg\Tools\
> PatchFv\RebaseBinFv.py %TARGET% %WORKSPACE%\edk2-non-osi\Silicon\Intel
> \PurleySiliconBinPkg %WORKSPACE%\Build\BuildReport.txt FvPreMemorySilicon
> gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMBase
> +call %PYTHON_HOME%\python.exe %WORKSPACE%\edk2-platforms\Platform
> \Intel\MinPlatformPkg\Tools\PatchFv\RebaseBinFv.py %TARGET% %WORKSPAC
> E%\edk2-non-osi\Silicon\Intel\PurleySiliconBinPkg %WORKSPACE%\Build\BuildR
> eport.txt FvPreMemorySilicon
> gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMBase
>  if %ERRORLEVEL% NEQ 0 (
>    set SCRIPT_ERROR=1
>    echo RebaseBinFv Error. Exit
> @@ -58,7 +58,7 @@ if %ERRORLEVEL% NEQ 0 (
>  )
> 
>  echo
> python %WORKSPACE%\edk2-platforms\Platform\Intel\MinPlatformPkg\Tools\
> PatchFv\RebaseBinFv.py %TARGET% %WORKSPACE%\edk2-non-osi\Silicon\Intel
> \PurleySiliconBinPkg %WORKSPACE%\Build\BuildReport.txt
> FvPostMemorySilicon gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSBase
> -call
> python %WORKSPACE%\edk2-platforms\Platform\Intel\MinPlatformPkg\Tools\
> PatchFv\RebaseBinFv.py %TARGET% %WORKSPACE%\edk2-non-osi\Silicon\Intel
> \PurleySiliconBinPkg %WORKSPACE%\Build\BuildReport.txt
> FvPostMemorySilicon gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSBase
> +call %PYTHON_HOME%\python.exe %WORKSPACE%\edk2-platforms\Platform
> \Intel\MinPlatformPkg\Tools\PatchFv\RebaseBinFv.py %TARGET% %WORKSPAC
> E%\edk2-non-osi\Silicon\Intel\PurleySiliconBinPkg %WORKSPACE%\Build\BuildR
> eport.txt FvPostMemorySilicon
> gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSBase
>  if %ERRORLEVEL% NEQ 0 (
>    set SCRIPT_ERROR=1
>    echo RebaseBinFv Error. Exit
> @@ -80,7 +80,7 @@ if %ERRORLEVEL% NEQ 0 (
>  @echo BoardPostBuild.%postbuildstep% python PatchBfv.py
>  @set /a postbuildstep=%postbuildstep%+1
>  echo
> python %WORKSPACE%\edk2-platforms\Platform\Intel\MinPlatformPkg\Tools\
> PatchFv\PatchBfv.py %WORKSPACE%\Build\%BOARD_PKG%\%BOARD_NAME%
> \%TARGET%_%TOOL_CHAIN_TAG%\FV\PLATFORM.fd %WORKSPACE%\Build\Bu
> ildReport.txt gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemoryBase
> -call
> python %WORKSPACE%\edk2-platforms\Platform\Intel\MinPlatformPkg\Tools\
> PatchFv\PatchBfv.py %WORKSPACE%\Build\%BOARD_PKG%\%BOARD_NAME%
> \%TARGET%_%TOOL_CHAIN_TAG%\FV\PLATFORM.fd %WORKSPACE%\Build\Bu
> ildReport.txt gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemoryBase
> +call %PYTHON_HOME%\python.exe %WORKSPACE%\edk2-platforms\Platform
> \Intel\MinPlatformPkg\Tools\PatchFv\PatchBfv.py %WORKSPACE%\Build\%BOA
> RD_PKG%\%BOARD_NAME%\%TARGET%_%TOOL_CHAIN_TAG%\FV\PLATFOR
> M.fd %WORKSPACE%\Build\BuildReport.txt
> gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemoryBase
>  if %ERRORLEVEL% NEQ 0 (
>    set SCRIPT_ERROR=1
>    echo PatchBfv Error. Exit
> --
> 2.10.0.windows.1
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


  reply	other threads:[~2018-07-06 14:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-06  7:45 [PATCH edk2-platforms\devel-MinPlatform] MinPlatformPkg: Enable PatchFv tool supports PCD value format in build report Liming Gao
2018-07-06  7:45 ` [PATCH edk2-platforms\devel-MinPlatform] MinPlatform: Update batch file to call python.exe Liming Gao
2018-07-06 14:57   ` Yao, Jiewen [this message]
2018-07-06  7:45 ` [PATCH edk2-platforms\devel-MinPlatform] MinPlatform: update ReadMe.md to correct branch name Liming Gao
2018-07-06 14:56   ` Yao, Jiewen
2018-07-06  7:45 ` [PATCH edk2-platforms\devel-MinPlatform] PurleyOpenBoardPkg: Remove unnecessary Link16 and IASL override Liming Gao
2018-07-06 14:56   ` Yao, Jiewen
2018-07-06 14:57 ` [PATCH edk2-platforms\devel-MinPlatform] MinPlatformPkg: Enable PatchFv tool supports PCD value format in build report Yao, Jiewen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=74D8A39837DF1E4DA445A8C0B3885C503AC8E4E4@shsmsx102.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox