Re: [edk2] RFC: Proposal to halt automatic builds of Windows BaseTools executables

2018-03-08 Thread Bjorge, Erik C
Tim,

I see this as more immediately usable.  I now only have to pull and monitor a 
single repo that already has all the source for the build tools.  I can also 
easily checkout a release branch and build the matching tools for that version 
of UDK.  It also simplifies debugging and development of tools.  I also like 
the fact that I can update python to include the latest security patches as 
needed.

To help with the process on Windows edksetup.bat has the ability to build the 
tools using the Rebuild and ForceRebuild options.

Thanks,
-Erik
 
-Original Message-
From: af...@apple.com [mailto:af...@apple.com] 
Sent: Thursday, March 8, 2018 10:37 AM
To: Tim Lewis 
Cc: Bjorge, Erik C ; edk2-devel@lists.01.org
Subject: Re: [edk2] RFC: Proposal to halt automatic builds of Windows BaseTools 
executables


> On Mar 8, 2018, at 10:05 AM, Tim Lewis  wrote:
> 
> Erik --
> 
> What is the justification? Moving from more immediately usable to less 
> immediately usable doesn't seem, on the surface, to be  a good direction.
> Why not go the other direction and pre-build the binaries for the 
> other environments?
> 

Tim,

I'm not a big fan of the prebuilt tools. In a production environment it is 
usually preferable to have source and to NOT check in binaries. Given the other 
environments have Python by default I don't see the value of pre-building the 
tools on Unix systems? 

I think the ease of use issue is really a different issue (other than having to 
install Python).  Most projects you start from the root and type make (nmake). 
A top level makefile would abstract the building of the tools and the need to 
setup environment variables. 

Why can't I pull a git repo and do:
$ make OvmfPkgX64

I grant it may be hard to automagically pick the compiler but you can do things 
like:
$ make OvmfPkgX64 BUILD_FLAGS="-n 1 -t XCODE"

As long as build.py acts like a compiler and the last version of a given flag 
wins this should be easy to do. 

Thanks,

Andrew Fish

> Thanks,
> 
> Tim
> 
> -----Original Message-
> From: edk2-devel  On Behalf Of 
> Bjorge, Erik C
> Sent: Wednesday, March 7, 2018 9:57 AM
> To: edk2-devel@lists.01.org
> Subject: [edk2] RFC: Proposal to halt automatic builds of Windows 
> BaseTools executables
> 
> I would like to propose that the automatic builds of Windows BaseTools 
> executables be halted.  This implies there will no longer be updates 
> to the
> edk2-BaseTools-win32 repository.
> 
> With this change, developers using Windows must install Python 2.7.x 
> and configure their environment to build C tools  and run python 
> scripts from sources.  This matches the development experience for 
> non-Windows environments.
> 
> Please respond with comments by 03/23/2018.
> 
> Thanks,
> -Erik
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] RFC: Proposal to halt automatic builds of Windows BaseTools executables

2018-03-07 Thread Bjorge, Erik C
I would like to propose that the automatic builds of Windows BaseTools 
executables be halted.  This implies there will no longer be updates to the 
edk2-BaseTools-win32 repository.

With this change, developers using Windows must install Python 2.7.x and 
configure their environment to build C tools  and run python scripts from 
sources.  This matches the development experience for non-Windows environments.

Please respond with comments by 03/23/2018.

Thanks,
-Erik

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch 4/4] BaseTools: Update toolsetup.bat to set PYTHONPATH env to run python source

2016-09-12 Thread Bjorge, Erik C
Reviewed-by: Erik Bjorge 

> -Original Message-
> From: Gao, Liming
> Sent: Monday, September 12, 2016 9:04 AM
> To: edk2-devel@lists.01.org
> Cc: Zhu, Yonghong ; Kinney, Michael D
> ; Bjorge, Erik C 
> Subject: [Patch 4/4] BaseTools: Update toolsetup.bat to set PYTHONPATH
> env to run python source
> 
> When python tool exe doesn't exist, toolsetup.bat will set up
> PYTHONPATH,
> and set python tool dos script directory into system PATH.
> 
> Cc: Yonghong Zhu 
> Cc: Michael Kinney 
> Cc: Erik Bjorge 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Liming Gao 
> ---
>  BaseTools/toolsetup.bat | 101 +
> ---
>  1 file changed, 44 insertions(+), 57 deletions(-)
> 
> diff --git a/BaseTools/toolsetup.bat b/BaseTools/toolsetup.bat
> index a64938d..6d416d4 100755
> --- a/BaseTools/toolsetup.bat
> +++ b/BaseTools/toolsetup.bat
> @@ -247,39 +247,38 @@ if defined FORCE_REBUILD goto
> check_build_environment
>  if defined REBUILD goto check_build_environment
>  if not exist "%EDK_TOOLS_PATH%" goto check_build_environment
> 
> -IF NOT EXIST "%EDK_TOOLS_BIN%\BootSectImage.exe" goto
> check_build_environment
> +IF NOT EXIST "%EDK_TOOLS_BIN%\BootSectImage.exe" goto check_c_tools
> +IF NOT EXIST "%EDK_TOOLS_BIN%\EfiLdrImage.exe" goto check_c_tools
> +IF NOT EXIST "%EDK_TOOLS_BIN%\EfiRom.exe" goto check_c_tools
> +IF NOT EXIST "%EDK_TOOLS_BIN%\GenBootSector.exe" goto check_c_tools
> +IF NOT EXIST "%EDK_TOOLS_BIN%\GenFfs.exe" goto check_c_tools
> +IF NOT EXIST "%EDK_TOOLS_BIN%\GenFv.exe" goto check_c_tools
> +IF NOT EXIST "%EDK_TOOLS_BIN%\GenFw.exe" goto check_c_tools
> +IF NOT EXIST "%EDK_TOOLS_BIN%\GenPage.exe" goto check_c_tools
> +IF NOT EXIST "%EDK_TOOLS_BIN%\GenSec.exe" goto check_c_tools
> +IF NOT EXIST "%EDK_TOOLS_BIN%\GenVtf.exe" goto check_c_tools
> +IF NOT EXIST "%EDK_TOOLS_BIN%\Split.exe" goto check_c_tools
> +IF NOT EXIST "%EDK_TOOLS_BIN%\TianoCompress.exe" goto check_c_tools
> +IF NOT EXIST "%EDK_TOOLS_BIN%\VfrCompile.exe" goto check_c_tools
> +IF NOT EXIST "%EDK_TOOLS_BIN%\VolInfo.exe" goto check_c_tools
> +
> +goto check_python_tools
> +
> +:check_c_tools
> +  echo.
> +  echo Binary C tools are missing. They are requried to be built from
> BaseTools Source.
> +  echo.
> +
> +:check_python_tools
>  IF NOT EXIST "%EDK_TOOLS_BIN%\build.exe" goto check_build_environment
> -IF NOT EXIST "%EDK_TOOLS_BIN%\EfiLdrImage.exe" goto
> check_build_environment
> -IF NOT EXIST "%EDK_TOOLS_BIN%\EfiRom.exe" goto check_build_environment
> -IF NOT EXIST "%EDK_TOOLS_BIN%\GenBootSector.exe" goto
> check_build_environment
>  IF NOT EXIST "%EDK_TOOLS_BIN%\GenFds.exe" goto check_build_environment
> -IF NOT EXIST "%EDK_TOOLS_BIN%\GenFfs.exe" goto check_build_environment
> -IF NOT EXIST "%EDK_TOOLS_BIN%\GenFv.exe" goto check_build_environment
> -IF NOT EXIST "%EDK_TOOLS_BIN%\GenFw.exe" goto check_build_environment
> -IF NOT EXIST "%EDK_TOOLS_BIN%\GenPage.exe" goto check_build_environment
> -IF NOT EXIST "%EDK_TOOLS_BIN%\GenSec.exe" goto check_build_environment
> -IF NOT EXIST "%EDK_TOOLS_BIN%\GenVtf.exe" goto check_build_environment
> -IF NOT EXIST "%EDK_TOOLS_BIN%\Split.exe" goto check_build_environment
>  IF NOT EXIST "%EDK_TOOLS_BIN%\TargetTool.exe" goto
> check_build_environment
> -IF NOT EXIST "%EDK_TOOLS_BIN%\TianoCompress.exe" goto
> check_build_environment
>  IF NOT EXIST "%EDK_TOOLS_BIN%\Trim.exe" goto check_build_environment
> -IF NOT EXIST "%EDK_TOOLS_BIN%\VfrCompile.exe" goto
> check_build_environment
> -IF NOT EXIST "%EDK_TOOLS_BIN%\VolInfo.exe" goto check_build_environment
> 
>  goto end
> 
>  :check_build_environment
> -
> -  if not defined FORCE_REBUILD (
> -echo.
> -echo Rebuilding of tools is not required.  Binaries of the latest,
> -echo tested versions of the tools have been tested and included in
> the
> -echo EDK II repository.
> -echo.
> -echo If you really want to build the tools, use the ForceRebuild
> option.
> -echo.
> -goto end
> -  )
> +  if defined BASETOOLS_PYTHON_SOURCE goto VisualStudioAvailable
> 
>if not defined BASE_TOOLS_PATH (
>   if not exist "Source\C\Makefile" (
> @@ -289,10 +288,6 @@ goto end
> set BASE_TOOLS_PATH=%CD%
>   )
>)
> -  set PATH=%BASE_TOOLS_PATH%\Bin\Win32;%PATH%
> -
> -  set BASETOOLS_P

Re: [edk2] [Patch 3/4] BaseTools: Update Python Makefile not to depend on PYTHON_FREEZER_PATH

2016-09-12 Thread Bjorge, Erik C
Reviewed-by: Erik Bjorge 

> -Original Message-
> From: Gao, Liming
> Sent: Monday, September 12, 2016 9:03 AM
> To: edk2-devel@lists.01.org
> Cc: Zhu, Yonghong ; Kinney, Michael D
> ; Bjorge, Erik C 
> Subject: [Patch 3/4] BaseTools: Update Python Makefile not to depend on
> PYTHON_FREEZER_PATH
> 
> If PYTHON_FREEZER_PATH is not set, Python tools will not be freeze.
> 
> Cc: Yonghong Zhu 
> Cc: Michael Kinney 
> Cc: Erik Bjorge 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Liming Gao 
> ---
>  BaseTools/Source/Python/Makefile | 17 +
>  1 file changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/Makefile
> b/BaseTools/Source/Python/Makefile
> index 28be671..e7755cd 100644
> --- a/BaseTools/Source/Python/Makefile
> +++ b/BaseTools/Source/Python/Makefile
> @@ -11,16 +11,17 @@
>  # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
> IMPLIED.
>  #
> 
> -!IFNDEF PYTHON_FREEZER_PATH
> -!ERROR PYTHON_FREEZER_PATH must be defined!
> +!IFNDEF PYTHON_HOME
> +!ERROR PYTHON_HOME must be defined!
>  !ENDIF
> 
> +!IFDEF PYTHON_FREEZER_PATH
>  !IF EXIST ($(PYTHON_FREEZER_PATH)\cxfreeze)
>  # Using cx_Freeze 4.2.3 with Python 2.7.2
>  FREEZE=$(PYTHON_HOME)\python $(PYTHON_FREEZER_PATH)\cxfreeze
>  !ELSE
> -# Using cx_Freeze 3.0.3 with Python 2.5.4
> -FREEZE=$(PYTHON_FREEZER_PATH)\FreezePython.exe
> +!ERROR PYTHON_FREEZER_PATH does not exist!
> +!ENDIF
>  !ENDIF
> 
> 
> MODULES=encodings.cp437,encodings.gbk,encodings.utf_16,encodings.utf_8,e
> ncodings.utf_16_le,encodings.latin_1,encodings.ascii
> @@ -236,7 +237,14 @@
> CMD_UPT=$(BASE_TOOLS_PATH)\Source\Python\UPT\Core\DependencyRules.py \
>  $(BASE_TOOLS_PATH)\Source\Python\UPT\Xml\XmlParser.py \
>  $(BASE_TOOLS_PATH)\Source\Python\UPT\Xml\XmlParserMisc.py
> 
> +!IFDEF PYTHON_FREEZER_PATH
>  all: SetPythonPath $(APPLICATIONS)
> +!ELSE
> +all:
> +  @echo.
> +  @echo !!! WARNING !!! PYTHON_FREEZER_PATH is not set.
> +  @echo Cannot make executable from Python code, executing python
> scripts instead !!!
> +!ENDIF
> 
>  SetPythonPath:
>set PYTHONPATH=$(BASE_TOOLS_PATH)\Source\Python
> @@ -310,5 +318,6 @@ $(BIN_DIR)\TestRoot.pub.pem:
> $(BASE_TOOLS_PATH)\Source\Python\Pkcs7Sign\TestRoot
>  clean:
>  cleanall:
>@del /f /q $(BIN_DIR)\*.pyd $(BIN_DIR)\*.dll
> +  @del /f /q $(BASE_TOOLS_PATH)\Source\Python\*.pyc
>@for %%i in ($(APPLICATIONS)) do @del /f /q %%i
> 
> --
> 2.8.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch 2/4] BaseTools: Update python tool to call external tools with shell true mode

2016-09-12 Thread Bjorge, Erik C
Reviewed-by: Erik Bjorge 

> -Original Message-
> From: Gao, Liming
> Sent: Monday, September 12, 2016 9:03 AM
> To: edk2-devel@lists.01.org
> Cc: Zhu, Yonghong ; Kinney, Michael D
> ; Bjorge, Erik C 
> Subject: [Patch 2/4] BaseTools: Update python tool to call external
> tools with shell true mode
> 
> Python tool may run from source as the dos batch files. So, update
> python
> code to call external tools with shell true mode.
> 
> Cc: Yonghong Zhu 
> Cc: Michael Kinney 
> Cc: Erik Bjorge 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Liming Gao 
> ---
>  BaseTools/Source/Python/Common/VpdInfoFile.py | 7 ---
>  BaseTools/Source/Python/build/build.py| 5 ++---
>  2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/Common/VpdInfoFile.py
> b/BaseTools/Source/Python/Common/VpdInfoFile.py
> index cc79ee2..d45fb4c 100644
> --- a/BaseTools/Source/Python/Common/VpdInfoFile.py
> +++ b/BaseTools/Source/Python/Common/VpdInfoFile.py
> @@ -233,14 +233,15 @@ def CallExtenalBPDGTool(ToolPath, VpdFileName):
>  OutputBinFileName = os.path.join(OutputDir, "%s.bin" % BaseName)
> 
>  try:
> -PopenObject = subprocess.Popen([ToolPath,
> +PopenObject = subprocess.Popen(' '.join([ToolPath,
>  '-o', OutputBinFileName,
>  '-m', OutputMapFileName,
>  '-q',
>  '-f',
> -VpdFileName],
> +VpdFileName]),
>  stdout=subprocess.PIPE,
> -stderr= subprocess.PIPE)
> +stderr= subprocess.PIPE,
> +shell=True)
>  except Exception, X:
>  EdkLogger.error("BPDG", BuildToolError.COMMAND_FAILURE,
> ExtraData="%s" % (str(X)))
>  (out, error) = PopenObject.communicate()
> diff --git a/BaseTools/Source/Python/build/build.py
> b/BaseTools/Source/Python/build/build.py
> index be02119..20f726f 100644
> --- a/BaseTools/Source/Python/build/build.py
> +++ b/BaseTools/Source/Python/build/build.py
> @@ -266,14 +266,13 @@ def LaunchCommand(Command, WorkingDir):
>  # ubuntu may fail with an error message that the command is not
> found.
>  # So here we may need convert command from string to list instance.
>  if not isinstance(Command, list):
> -if platform.system() != 'Windows':
> -Command = Command.split()
> +Command = Command.split()
> 
>  Proc = None
>  EndOfProcedure = None
>  try:
>  # launch the command
> -Proc = Popen(Command, stdout=PIPE, stderr=PIPE, env=os.environ,
> cwd=WorkingDir, bufsize=-1)
> +Proc = Popen(' '.join(Command), stdout=PIPE, stderr=PIPE,
> env=os.environ, cwd=WorkingDir, bufsize=-1, shell=True)
> 
>  # launch two threads to read the STDOUT and STDERR
>  EndOfProcedure = Event()
> --
> 2.8.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch 1/4] BaseTools: Add Windows batch files to run python tool from Source

2016-09-12 Thread Bjorge, Erik C
Reviewed-by: Erik Bjorge 

> -Original Message-
> From: Gao, Liming
> Sent: Monday, September 12, 2016 9:03 AM
> To: edk2-devel@lists.01.org
> Cc: Zhu, Yonghong ; Kinney, Michael D
> ; Bjorge, Erik C 
> Subject: [Patch 1/4] BaseTools: Add Windows batch files to run python
> tool from Source
> 
> Add 13 windows batch files for every python tool.
> 
> Cc: Yonghong Zhu 
> Cc: Michael Kinney 
> Cc: Erik Bjorge 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Liming Gao 
> ---
>  BaseTools/BinWrappers/WindowsLike/BPDG.bat  | 3 +++
>  BaseTools/BinWrappers/WindowsLike/Ecc.bat   | 3 +++
>  BaseTools/BinWrappers/WindowsLike/GenDepex.bat  | 3 +++
>  BaseTools/BinWrappers/WindowsLike/GenFds.bat| 3 +++
>  BaseTools/BinWrappers/WindowsLike/GenPatchPcdTable.bat  | 3 +++
>  BaseTools/BinWrappers/WindowsLike/PatchPcdValue.bat | 3 +++
>  BaseTools/BinWrappers/WindowsLike/Pkcs7Sign.bat | 3 +++
>  BaseTools/BinWrappers/WindowsLike/Rsa2048Sha256GenerateKeys.bat | 1 +
>  BaseTools/BinWrappers/WindowsLike/Rsa2048Sha256Sign.bat | 3 +++
>  BaseTools/BinWrappers/WindowsLike/TargetTool.bat| 3 +++
>  BaseTools/BinWrappers/WindowsLike/Trim.bat  | 3 +++
>  BaseTools/BinWrappers/WindowsLike/UPT.bat   | 3 +++
>  BaseTools/BinWrappers/WindowsLike/build.bat | 3 +++
>  13 files changed, 37 insertions(+)
>  create mode 100644 BaseTools/BinWrappers/WindowsLike/BPDG.bat
>  create mode 100644 BaseTools/BinWrappers/WindowsLike/Ecc.bat
>  create mode 100644 BaseTools/BinWrappers/WindowsLike/GenDepex.bat
>  create mode 100644 BaseTools/BinWrappers/WindowsLike/GenFds.bat
>  create mode 100644
> BaseTools/BinWrappers/WindowsLike/GenPatchPcdTable.bat
>  create mode 100644 BaseTools/BinWrappers/WindowsLike/PatchPcdValue.bat
>  create mode 100644 BaseTools/BinWrappers/WindowsLike/Pkcs7Sign.bat
>  create mode 100644
> BaseTools/BinWrappers/WindowsLike/Rsa2048Sha256GenerateKeys.bat
>  create mode 100644
> BaseTools/BinWrappers/WindowsLike/Rsa2048Sha256Sign.bat
>  create mode 100644 BaseTools/BinWrappers/WindowsLike/TargetTool.bat
>  create mode 100644 BaseTools/BinWrappers/WindowsLike/Trim.bat
>  create mode 100644 BaseTools/BinWrappers/WindowsLike/UPT.bat
>  create mode 100644 BaseTools/BinWrappers/WindowsLike/build.bat
> 
> diff --git a/BaseTools/BinWrappers/WindowsLike/BPDG.bat
> b/BaseTools/BinWrappers/WindowsLike/BPDG.bat
> new file mode 100644
> index 000..9fbb704
> --- /dev/null
> +++ b/BaseTools/BinWrappers/WindowsLike/BPDG.bat
> @@ -0,0 +1,3 @@
> +@setlocal
> +@set ToolName=%~n0%
> +@%PYTHON_HOME%\python.exe
> %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %*
> diff --git a/BaseTools/BinWrappers/WindowsLike/Ecc.bat
> b/BaseTools/BinWrappers/WindowsLike/Ecc.bat
> new file mode 100644
> index 000..9fbb704
> --- /dev/null
> +++ b/BaseTools/BinWrappers/WindowsLike/Ecc.bat
> @@ -0,0 +1,3 @@
> +@setlocal
> +@set ToolName=%~n0%
> +@%PYTHON_HOME%\python.exe
> %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %*
> diff --git a/BaseTools/BinWrappers/WindowsLike/GenDepex.bat
> b/BaseTools/BinWrappers/WindowsLike/GenDepex.bat
> new file mode 100644
> index 000..9fbb704
> --- /dev/null
> +++ b/BaseTools/BinWrappers/WindowsLike/GenDepex.bat
> @@ -0,0 +1,3 @@
> +@setlocal
> +@set ToolName=%~n0%
> +@%PYTHON_HOME%\python.exe
> %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %*
> diff --git a/BaseTools/BinWrappers/WindowsLike/GenFds.bat
> b/BaseTools/BinWrappers/WindowsLike/GenFds.bat
> new file mode 100644
> index 000..9fbb704
> --- /dev/null
> +++ b/BaseTools/BinWrappers/WindowsLike/GenFds.bat
> @@ -0,0 +1,3 @@
> +@setlocal
> +@set ToolName=%~n0%
> +@%PYTHON_HOME%\python.exe
> %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %*
> diff --git a/BaseTools/BinWrappers/WindowsLike/GenPatchPcdTable.bat
> b/BaseTools/BinWrappers/WindowsLike/GenPatchPcdTable.bat
> new file mode 100644
> index 000..9fbb704
> --- /dev/null
> +++ b/BaseTools/BinWrappers/WindowsLike/GenPatchPcdTable.bat
> @@ -0,0 +1,3 @@
> +@setlocal
> +@set ToolName=%~n0%
> +@%PYTHON_HOME%\python.exe
> %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %*
> diff --git a/BaseTools/BinWrappers/WindowsLike/PatchPcdValue.bat
> b/BaseTools/BinWrappers/WindowsLike/PatchPcdValue.bat
> new file mode 100644
> index 000..9fbb704
> --- /dev/null
> +++ b/BaseTools/BinWrappers/WindowsLike/PatchPcdValue.bat
> @@ -0,0 +1,3 @@
> +@setlocal
> +@set ToolName=%~n0%
> +@%PYTHON_HOME%\python.exe
> 

Re: [edk2] [Patch] BaseTools: update BinaryFiles.txt file to add Pkcs7Sign Tool

2016-08-22 Thread Bjorge, Erik C
Reviewed-by: Erik Bjorge 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Yonghong Zhu
> Sent: Monday, August 22, 2016 4:46 PM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming ; Bjorge, Erik C
> 
> Subject: [edk2] [Patch] BaseTools: update BinaryFiles.txt file to add
> Pkcs7Sign Tool
> 
> add Pkcs7Sign.exe and related pem file into BinaryFiles.txt for build
> server to automatically build the binary win32 files.
> 
> Cc: Liming Gao 
> Cc: Erik Bjorge 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Yonghong Zhu 
> ---
>  BaseTools/Source/BinaryFiles.txt | 9 -
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/BaseTools/Source/BinaryFiles.txt
> b/BaseTools/Source/BinaryFiles.txt
> index ec66cdf..7b014a7 100644
> --- a/BaseTools/Source/BinaryFiles.txt
> +++ b/BaseTools/Source/BinaryFiles.txt
> @@ -9,11 +9,11 @@
>  # [ExtraFiles.Win32] section.
>  # The [CxFreeze.Win32] section is maintained by the owner of the Build
> Server who
>  # must ensure that files that are required by the cx_freeze frozen
> binaries are
>  # present in the Bin\Win32 directory.
>  #
> -# Copyright (c) 2014, Intel Corporation. All rights reserved.
> +# Copyright (c) 2014 - 2016, Intel Corporation. All rights
> reserved.
>  #
>  # This program and the accompanying materials are licensed and made
> available under
>  # the terms and conditions of the BSD License which accompanies this
> distribution.
>  # The full text of the license may be found at:
>  #   http://opensource.org/licenses/bsd-license.php
> @@ -56,15 +56,22 @@ TargetTool.exe
>  TianoCompress.exe
>  Trim.exe
>  UPT.exe
>  VfrCompile.exe
>  VolInfo.exe
> +Pkcs7Sign.exe
> 
>  [ExtraFiles.Win32]
>  TestSigningPrivateKey.pem
>  config.ini
>  exception.xml
> +TestCert.pem
> +TestCert.pub.pem
> +TestRoot.pem
> +TestRoot.pub.pem
> +TestSub.pem
> +TestSub.pub.pem
> 
>  [CxFreeze.Win32]
>  _ctypes.pyd
>  _hashlib.pyd
>  _socket.pyd
> --
> 2.6.1.windows.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] Use a local variable to cache the pointer.

2016-05-12 Thread Bjorge, Erik C
Reviewed-by: Erik Bjorge 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Jaben Carsey
> Sent: Thursday, May 12, 2016 3:10 PM
> To: edk2-devel@lists.01.org
> Cc: Qiu, Shumin 
> Subject: [edk2] [Patch] Use a local variable to cache the pointer.
> 
> CC: Qiu Shumin 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jaben Carsey 
> ---
>  ShellPkg/Application/Shell/Shell.c | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/ShellPkg/Application/Shell/Shell.c
> b/ShellPkg/Application/Shell/Shell.c
> index b06c1ef..47b3118 100644
> --- a/ShellPkg/Application/Shell/Shell.c
> +++ b/ShellPkg/Application/Shell/Shell.c
> @@ -2499,6 +2499,7 @@ SetupAndRunCommandOrFile(
>SHELL_FILE_HANDLE OriginalStdOut;
>SHELL_FILE_HANDLE OriginalStdErr;
>SYSTEM_TABLE_INFO OriginalSystemTableInfo;
> +  CONST SCRIPT_FILE *ConstScriptFile;
> 
>//
>// Update the StdIn, StdOut, and StdErr for redirection to
> environment variables, files, etc... unicode and ASCII
> @@ -2518,10 +2519,11 @@ SetupAndRunCommandOrFile(
>// Now print errors
>//
>if (EFI_ERROR(Status)) {
> -if (ShellCommandGetCurrentScriptFile() == NULL ||
> ShellCommandGetCurrentScriptFile()->CurrentCommand == NULL) {
> +ConstScriptFile = ShellCommandGetCurrentScriptFile();
> +if (ConstScriptFile == NULL || ConstScriptFile->CurrentCommand ==
> NULL) {
>ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_ERROR),
> ShellInfoObject.HiiHandle, (VOID*)(Status));
>  } else {
> -  ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN
> (STR_SHELL_ERROR_SCRIPT), ShellInfoObject.HiiHandle, (VOID*)(Status),
> ShellCommandGetCurrentScriptFile()->CurrentCommand->Line);
> +  ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN
> (STR_SHELL_ERROR_SCRIPT), ShellInfoObject.HiiHandle, (VOID*)(Status),
> ConstScriptFile->CurrentCommand->Line);
>  }
>}
> 
> --
> 2.7.2.windows.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch v2] report line number for command errors in a script.

2016-05-10 Thread Bjorge, Erik C
Reviewed-by: Erik Bjorge 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Jaben Carsey
> Sent: Tuesday, May 10, 2016 2:02 PM
> To: edk2-devel@lists.01.org
> Cc: Qiu, Shumin 
> Subject: [edk2] [Patch v2] report line number for command errors in a
> script.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jaben Carsey 
> 
> ---
>  ShellPkg/Application/Shell/Shell.c   | 6 +-
>  ShellPkg/Application/Shell/Shell.uni | 1 +
>  2 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/ShellPkg/Application/Shell/Shell.c
> b/ShellPkg/Application/Shell/Shell.c
> index 12daff9..b06c1ef 100644
> --- a/ShellPkg/Application/Shell/Shell.c
> +++ b/ShellPkg/Application/Shell/Shell.c
> @@ -2518,7 +2518,11 @@ SetupAndRunCommandOrFile(
>// Now print errors
>//
>if (EFI_ERROR(Status)) {
> -ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_ERROR),
> ShellInfoObject.HiiHandle, (VOID*)(Status));
> +if (ShellCommandGetCurrentScriptFile() == NULL ||
> ShellCommandGetCurrentScriptFile()->CurrentCommand == NULL) {
> +  ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_ERROR),
> ShellInfoObject.HiiHandle, (VOID*)(Status));
> +} else {
> +  ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN
> (STR_SHELL_ERROR_SCRIPT), ShellInfoObject.HiiHandle, (VOID*)(Status),
> ShellCommandGetCurrentScriptFile()->CurrentCommand->Line);
> +}
>}
> 
>//
> diff --git a/ShellPkg/Application/Shell/Shell.uni
> b/ShellPkg/Application/Shell/Shell.uni
> index 3947d01..ef69f89 100644
> --- a/ShellPkg/Application/Shell/Shell.uni
> +++ b/ShellPkg/Application/Shell/Shell.uni
> @@ -40,6 +40,7 @@
>  #string STR_SHELL_CRLF#language en-US "\r\n"
> 
>  #string STR_SHELL_ERROR   #language en-US  "%NCommand Error
> Status: %r\r\n"
> +#string STR_SHELL_ERROR_SCRIPT#language en-US  "%NScript Error
> Status: %r (line number %d)\r\n"
> 
>  #string STR_SHELL_INVALID_MAPPING #language en-US "%N'%B%s%N' is
> not a valid mapping.\r\n"
>  #string STR_SHELL_INVALID_SPLIT   #language en-US "Invalid use of
> pipe (%B|%N).\r\n"
> --
> 2.7.2.windows.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [review]Please review changes to UNI file format document

2016-04-29 Thread Bjorge, Erik C
Reviewed-by: Erik Bjorge 

From: Carsey, Jaben
Sent: Friday, April 29, 2016 10:53 AM
To: edk2-devel@lists.01.org; Bjorge, Erik C ; Qiu, 
Shumin 
Cc: Carsey, Jaben 
Subject: [review]Please review changes to UNI file format document

Updated UNI spec to remove info specific to some consumers, not format.
Updated UNI spec to allow non-ascii characters in strings.


Cc: Qiu Shumin mailto:shumin@intel.com>>

Cc: Erik Bjorge mailto:erik.c.bjo...@intel.com>>

Contributed-under: TianoCore Contribution Agreement 1.0

Signed-off-by: Jaben Carsey 
mailto:jaben.car...@intel.com>>



There are 3 sections here.  The table of changes, the beginning of chapter 2, 
and chapter 4.





1.3


Added:

*  Syntax for non-ascii characters inside quoted strings

Removed:

*  Info on specific consumers (.INF & .DEC) removed.


April 2016




2
Unicode Strings File Format
EDK II Unicode files are used for mapping token names to localized strings that 
are identified by an RFC4646 language code. The format for storing EDK II 
Unicode files is UTF-16LE. The character content must be UCS-2.
The UNI files contain UCS-2 characters stored in either UTF-8 or UTF-16LE 
format on disk.
Strings ends are determined by the first of the following items found:

*  a control character

*  a comment

*  the end of the file

*  a blank line
Comments may appear anywhere within the string file.
All the files must begin with a Unicode BOM character.

Note:  Please make sure you select an editor that supports UCS-2 characters 
that can be stored in a UTF-8 or UTF-16LE file.

2.1Common EBNF
The following EBNF uses quoted (double quotes) encapsulated characters to 
represent UCS-2 string literals. In the following definitions, the semi-colon 
is used to denote a comment.


::=  " "

::=  {(\u0041-\u005A)} ; Characters A - Z
 {(\u0061-\u007A)} ; Characters a - z

 ::=  (\u0030-\u0039)   ; Characters 0 - 9

::=  +

::=  {} {}

   ::=  "//" *  

 ::=  

 ::=  (\u0001-\uF6FF)



::=  (\u0021-\uF6FF){(\u0020-\uF6FF)} {}



   ::=  "\x" [{}]{4} "\"



::=  (\u0021-\uF6FF)








4  Redacted

Formerly "Meta-Data UNI Files". This chapter intentionally removed.

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v2] BaseTools ConvertMasmToNasm: Support Python 3

2016-03-10 Thread Bjorge, Erik C
Reviewed-by: Erik Bjorge 

> -Original Message-
> From: Justen, Jordan L
> Sent: Wednesday, March 9, 2016 5:46 PM
> To: edk2-devel@lists.01.org
> Cc: Justen, Jordan L ; Zhu, Yonghong
> ; Gao, Liming ; Bjorge,
> Erik C 
> Subject: [PATCH v2] BaseTools ConvertMasmToNasm: Support Python 3
> 
> The script is updated to support both python 2.7 and python 3.
> 
> v2:
>  * Use io.open() rather than open() (Jaben)
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jordan Justen 
> Cc: Yonghong Zhu 
> Cc: Liming Gao 
> Cc: Erik Bjorge 
> ---
>  BaseTools/Scripts/ConvertMasmToNasm.py | 90 ++-
> ---
>  1 file changed, 47 insertions(+), 43 deletions(-)
> 
> diff --git a/BaseTools/Scripts/ConvertMasmToNasm.py
> b/BaseTools/Scripts/ConvertMasmToNasm.py
> index 8288972..6a0d27d 100755
> --- a/BaseTools/Scripts/ConvertMasmToNasm.py
> +++ b/BaseTools/Scripts/ConvertMasmToNasm.py
> @@ -12,13 +12,15 @@
>  #  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
> IMPLIED.
>  #
> 
> +from __future__ import print_function
> +
>  #
>  # Import Modules
>  #
>  import argparse
> +import io
>  import os.path
>  import re
> -import StringIO
>  import subprocess
>  import sys
> 
> @@ -152,12 +154,12 @@ class CommonUtils:
>  (stdout, stderr) = p.communicate(pipeIn)
>  if checkExitCode:
>  if p.returncode != 0:
> -print 'command:', ' '.join(cmd)
> -print 'stdout:', stdout
> -print 'stderr:', stderr
> -print 'return:', p.returncode
> +print('command:', ' '.join(cmd))
> +print('stdout:', stdout)
> +print('stderr:', stderr)
> +print('return:', p.returncode)
>  assert p.returncode == 0
> -return stdout
> +return stdout.decode('utf-8', 'ignore')
> 
>  def FileUpdated(self, path):
>  if not self.git or not self.gitdir:
> @@ -181,7 +183,7 @@ class CommonUtils:
>  return
> 
>  if not self.args.quiet:
> -print 'Committing: Conversion of', dst
> +print('Committing: Conversion of', dst)
> 
>  prefix = ' '.join(filter(lambda a: a, [pkg, module]))
>  message = ''
> @@ -195,6 +197,7 @@ class CommonUtils:
>  message += 'Contributed-under: TianoCore Contribution Agreement
> 1.0\n'
>  assert(self.gitemail is not None)
>  message += 'Signed-off-by: %s\n' % self.gitemail
> +message = message.encode('utf-8', 'ignore')
> 
>  cmd = ('git', 'commit', '-F', '-')
>  self.RunAndCaptureOutput(cmd, pipeIn=message)
> @@ -226,23 +229,22 @@ class ConvertAsmFile(CommonUtils):
> 
>  self.inputFileBase = os.path.basename(self.inputFilename)
>  self.outputFileBase = os.path.basename(self.outputFilename)
> -if self.outputFilename == '-' and not self.diff:
> -self.output = sys.stdout
> -else:
> -self.output = StringIO.StringIO()
> +self.output = io.BytesIO()
>  if not self.args.quiet:
>  dirpath, src = os.path.split(self.inputFilename)
>  dirpath = self.RootRelative(dirpath)
>  dst = os.path.basename(self.outputFilename)
> -print 'Converting:', dirpath, src, '->', dst
> -lines = open(self.inputFilename).readlines()
> +print('Converting:', dirpath, src, '->', dst)
> +lines = io.open(self.inputFilename).readlines()
>  self.Convert(lines)
> -if self.outputFilename == '-':
> -if self.diff:
> -sys.stdout.write(self.output.getvalue())
> -self.output.close()
> +if self.outputFilename == '-' and not self.diff:
> +output_data = self.output.getvalue()
> +if sys.version_info >= (3, 0):
> +output_data = output_data.decode('utf-8', 'ignore')
> +sys.stdout.write(output_data)
> +self.output.close()
>  else:
> -f = open(self.outputFilename, 'wb')
> +f = io.open(self.outputFilename, 'wb')
>  f.write(self.output.getvalue())
>  f.close()
>  self.output.close()
> @@ -

Re: [edk2] [PATCH 8/9] QuarkPkg: Move baud rate setting to top of .dsc file

2016-03-04 Thread Bjorge, Erik C
Reviewed-by: Erik Bjorge 

> -Original Message-
> From: Leahy, Leroy P
> Sent: Friday, March 4, 2016 2:19 PM
> To: Kinney, Michael D ; Steele, Kelly
> ; edk2-devel@lists.01.org; Bjorge, Erik C
> 
> Cc: Leahy, Leroy P 
> Subject: [PATCH 8/9] QuarkPkg: Move baud rate setting to top of .dsc
> file
> 
> Move the baud rate setting to the top of the .dsc file.  Use a single
> setting for each board.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Lee Leahy 
> ---
>  QuarkPlatformPkg/Quark.dsc| 25 -
>  QuarkPlatformPkg/QuarkMin.dsc | 25 -
>  2 files changed, 24 insertions(+), 26 deletions(-)
> 
> diff --git a/QuarkPlatformPkg/Quark.dsc b/QuarkPlatformPkg/Quark.dsc
> index c87bb17..2b8038e 100644
> --- a/QuarkPlatformPkg/Quark.dsc
> +++ b/QuarkPlatformPkg/Quark.dsc
> @@ -46,6 +46,16 @@
>DEFINE GALILEO  = GEN2
> 
>#
> +  # Specify the maximum baud rate for the board
> +  #
> +!if $(GALILEO) == GEN1
> +  DEFINE BAUD_RATE = 460800
> +!endif
> +!if $(GALILEO) == GEN2
> +  DEFINE BAUD_RATE = 921600
> +!endif
> +
> +  #
># TPM 1.2 Hardware.  Options are [NONE, LPC, ATMEL_I2C, INFINEON_I2C]
>#
>DEFINE TPM_12_HARDWARE  = NONE
> @@ -342,12 +352,7 @@
>  !endif
>gEfiMdePkgTokenSpaceGuid.PcdPostCodePropertyMask|0x18
>gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xE000
> -!if $(GALILEO) == GEN1
> -  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|460800
> -!endif
> -!if $(GALILEO) == GEN2
> -  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|921600
> -!endif
> +  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|$(BAUD_RATE)
>gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits|8
>gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity|1
>gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits|1
> @@ -382,14 +387,8 @@
> 
>gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio|TRUE
>gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x9000B000
> -!if $(GALILEO) == GEN1
> -  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialBaudRate|460800
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialBaudRate|$(BAUD_RATE)
>gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseHardwareFlowControl|FALSE
> -!endif
> -!if $(GALILEO) == GEN2
> -  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialBaudRate|921600
> -  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseHardwareFlowControl|FALSE
> -!endif
>gEfiMdeModulePkgTokenSpaceGuid.PcdSerialLineControl|0x03
>gEfiMdeModulePkgTokenSpaceGuid.PcdSerialFifoControl|0x07
>gEfiMdeModulePkgTokenSpaceGuid.PcdSerialDetectCable|FALSE
> diff --git a/QuarkPlatformPkg/QuarkMin.dsc
> b/QuarkPlatformPkg/QuarkMin.dsc
> index f8a656e..7d89767 100644
> --- a/QuarkPlatformPkg/QuarkMin.dsc
> +++ b/QuarkPlatformPkg/QuarkMin.dsc
> @@ -40,6 +40,16 @@
>DEFINE PERFORMANCE_ENABLE  = FALSE
>DEFINE LOGGING = FALSE
> 
> +  #
> +  # Specify the maximum baud rate for the board
> +  #
> +!if $(GALILEO) == GEN1
> +  DEFINE BAUD_RATE = 460800
> +!endif
> +!if $(GALILEO) == GEN2
> +  DEFINE BAUD_RATE = 921600
> +!endif
> +
>!if $(TARGET) == "DEBUG"
>  DEFINE LOGGING = TRUE
>!endif
> @@ -311,12 +321,7 @@
>  !endif
>gEfiMdePkgTokenSpaceGuid.PcdPostCodePropertyMask|0x18
>gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xE000
> -!if $(GALILEO) == GEN1
> -  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|460800
> -!endif
> -!if $(GALILEO) == GEN2
> -  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|921600
> -!endif
> +  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|$(BAUD_RATE)
>gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits|8
>gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity|1
>gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits|1
> @@ -351,14 +356,8 @@
> 
>gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio|TRUE
>gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x9000B000
> -!if $(GALILEO) == GEN1
> -  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialBaudRate|460800
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialBaudRate|$(BAUD_RATE)
>gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseHardwareFlowControl|FALSE
> -!endif
> -!if $(GALILEO) == GEN2
> -  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialBaudRate|921600
> -  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseHardwareFlowControl|FALSE
> -!endif
>gEfiMdeModulePkgTokenSpaceGuid.PcdSerialLineControl|0x03
>gEfiMdeModulePkgTokenSpaceGuid.PcdSerialFifoControl|0x07
>gEfiMdeModulePkgTokenSpaceGuid.PcdSerialDetectCable|FALSE
> --
> 1.9.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 8/9] QuarkPkg: Move baud rate setting to top of .dsc file

2016-03-04 Thread Bjorge, Erik C
Reviewed-by: Erik Bjorge 

> -Original Message-
> From: Leahy, Leroy P
> Sent: Friday, March 4, 2016 9:03 AM
> To: Kinney, Michael D ; Steele, Kelly
> ; edk2-devel@lists.01.org; Bjorge, Erik C
> 
> Cc: Leahy, Leroy P 
> Subject: [PATCH 8/9] QuarkPkg: Move baud rate setting to top of .dsc
> file
> 
> Move the baud rate setting to the top of the .dsc file.  Use a single
> setting for each board.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Lee Leahy 
> ---
>  QuarkPlatformPkg/Quark.dsc | 28 +++-
>  1 file changed, 15 insertions(+), 13 deletions(-)
> 
> diff --git a/QuarkPlatformPkg/Quark.dsc b/QuarkPlatformPkg/Quark.dsc
> index c87bb17..c8952d8 100644
> --- a/QuarkPlatformPkg/Quark.dsc
> +++ b/QuarkPlatformPkg/Quark.dsc
> @@ -46,6 +46,19 @@
>DEFINE GALILEO  = GEN2
> 
>#
> +  # Specify the maximum baud rate for the board
> +  #
> +  DEFINE GEN1_BAUD_RATE   = 460800
> +  DEFINE GEN2_BAUD_RATE   = 921600
> +
> +!if $(GALILEO) == GEN1
> +  BAUD_RATE = $(GEN1_BAUD_RATE)
> +!endif
> +!if $(GALILEO) == GEN2
> +  BAUD_RATE = $(GEN2_BAUD_RATE)
> +!endif
> +
> +  #
># TPM 1.2 Hardware.  Options are [NONE, LPC, ATMEL_I2C, INFINEON_I2C]
>#
>DEFINE TPM_12_HARDWARE  = NONE
> @@ -342,12 +355,7 @@
>  !endif
>gEfiMdePkgTokenSpaceGuid.PcdPostCodePropertyMask|0x18
>gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xE000
> -!if $(GALILEO) == GEN1
> -  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|460800
> -!endif
> -!if $(GALILEO) == GEN2
> -  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|921600
> -!endif
> +  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|$(BAUD_RATE)
>gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits|8
>gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity|1
>gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits|1
> @@ -382,14 +390,8 @@
> 
>gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio|TRUE
>gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x9000B000
> -!if $(GALILEO) == GEN1
> -  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialBaudRate|460800
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialBaudRate|$(BAUD_RATE)
>gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseHardwareFlowControl|FALSE
> -!endif
> -!if $(GALILEO) == GEN2
> -  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialBaudRate|921600
> -  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseHardwareFlowControl|FALSE
> -!endif
>gEfiMdeModulePkgTokenSpaceGuid.PcdSerialLineControl|0x03
>gEfiMdeModulePkgTokenSpaceGuid.PcdSerialFifoControl|0x07
>gEfiMdeModulePkgTokenSpaceGuid.PcdSerialDetectCable|FALSE
> --
> 1.9.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 7/9] QuarkPlatformPkg/PlatformBootManagerLib: No non-countdown msgs

2016-03-04 Thread Bjorge, Erik C
Reviewed-by: Erik Bjorge 

> -Original Message-
> From: Leahy, Leroy P
> Sent: Friday, March 4, 2016 9:03 AM
> To: Kinney, Michael D ; Steele, Kelly
> ; edk2-devel@lists.01.org; Bjorge, Erik C
> 
> Cc: Leahy, Leroy P 
> Subject: [PATCH 7/9] QuarkPlatformPkg/PlatformBootManagerLib: No non-
> countdown msgs
> 
> Disable the countdown messages which are displayed every second when the
> timeout is specified as infinite (0x).
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Lee Leahy 
> ---
>  QuarkPlatformPkg/Library/PlatformBootManagerLib/PlatformBootManager.c |
> 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git
> a/QuarkPlatformPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
> b/QuarkPlatformPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
> index 19ff3d0..fff1c80 100644
> ---
> a/QuarkPlatformPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
> +++
> b/QuarkPlatformPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
> @@ -333,5 +333,7 @@ PlatformBootManagerWaitCallback (
>UINT16  TimeoutRemain
>)
>  {
> -  Print (L"\r%-2d seconds remained...", TimeoutRemain);
> +  if (TimeoutRemain != 0x) {
> +Print (L"\r%-2d seconds remained...", TimeoutRemain);
> +  }
>  }
> --
> 1.9.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 6/9] MdeModulePkg/BdsDxe: Eliminate non-countdown messages

2016-03-04 Thread Bjorge, Erik C
Reviewed-by: Erik Bjorge 

> -Original Message-
> From: Leahy, Leroy P
> Sent: Friday, March 4, 2016 9:01 AM
> To: Tian, Feng ; Zeng, Star ;
> edk2-devel@lists.01.org; Bjorge, Erik C 
> Cc: Leahy, Leroy P 
> Subject: [PATCH 6/9] MdeModulePkg/BdsDxe: Eliminate non-countdown
> messages
> 
> Eliminate the message every one second when the timeout is specified
> as infinite (0x).
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Lee Leahy 
> ---
>  MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
> b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
> index 3734ff9..dbe2cd6 100644
> --- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
> +++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
> @@ -233,7 +233,9 @@ BdsWait (
> 
>TimeoutRemain = PcdGet16 (PcdPlatformBootTimeOut);
>while (TimeoutRemain != 0) {
> -DEBUG ((EFI_D_INFO, "[Bds]BdsWait(%d)..Zzzz...\n", (UINTN)
> TimeoutRemain));
> +if (TimeoutRemain != 0x) {
> +  DEBUG ((EFI_D_INFO, "[Bds]BdsWait(%d)..Zzzz...\n", (UINTN)
> TimeoutRemain));
> +}
>  PlatformBootManagerWaitCallback (TimeoutRemain);
> 
>  BdsReadKeys (); // BUGBUG: Only reading can signal HotkeyTriggered
> --
> 1.9.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 5/9] MdeModulePkg/PciSioSerialDxe: Set RTS and DTR by default

2016-03-04 Thread Bjorge, Erik C
Reviewed-by: Erik Bjorge 

> -Original Message-
> From: Leahy, Leroy P
> Sent: Friday, March 4, 2016 9:01 AM
> To: Tian, Feng ; Zeng, Star ;
> edk2-devel@lists.01.org; Bjorge, Erik C 
> Cc: Leahy, Leroy P 
> Subject: [PATCH 5/9] MdeModulePkg/PciSioSerialDxe: Set RTS and DTR by
> default
> 
> Usually the debug serial connection only uses two wires.  However when
> the controller at the other end is honoring hardware flow control
> signals, it is necessary for the PciSioSerialDxe to properly generate
> the necessary signals.  Turn on DTR and RTS during reset.  Allow the
> higher level application control these signals after the fact with the
> SetControl interface.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Lee Leahy 
> ---
>  MdeModulePkg/Bus/Pci/PciSioSerialDxe/SerialIo.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/MdeModulePkg/Bus/Pci/PciSioSerialDxe/SerialIo.c
> b/MdeModulePkg/Bus/Pci/PciSioSerialDxe/SerialIo.c
> index f1870f3..07ee424 100644
> --- a/MdeModulePkg/Bus/Pci/PciSioSerialDxe/SerialIo.c
> +++ b/MdeModulePkg/Bus/Pci/PciSioSerialDxe/SerialIo.c
> @@ -574,7 +574,7 @@ SerialReset (
>//
>// Go set the current control bits
>//
> -  Control = 0;
> +  Control = EFI_SERIAL_REQUEST_TO_SEND |
> EFI_SERIAL_DATA_TERMINAL_READY;
>if (SerialDevice->HardwareFlowControl) {
>  Control |= EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE;
>}
> --
> 1.9.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 4/9] DuetPkg/PciBusNoEnumerationDxe: Skip disabled devices

2016-03-04 Thread Bjorge, Erik C
Reviewed-by: Erik Bjorge 

> -Original Message-
> From: Leahy, Leroy P
> Sent: Friday, March 4, 2016 8:59 AM
> To: Ni, Ruiyu ; edk2-devel@lists.01.org; Bjorge,
> Erik C 
> Cc: Leahy, Leroy P 
> Subject: [PATCH 4/9] DuetPkg/PciBusNoEnumerationDxe: Skip disabled
> devices
> 
> Skip non-bridge devices which are not enabled either for memory or I/O
> access.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Lee Leahy 
> ---
>  DuetPkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c | 9 +
>  1 file changed, 9 insertions(+)
> 
> diff --git a/DuetPkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c
> b/DuetPkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c
> index ca300cf..3802424 100644
> --- a/DuetPkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c
> +++ b/DuetPkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c
> @@ -227,6 +227,15 @@ Returns:
>if (!EFI_ERROR (Status)) {
> 
>  //
> +// Skip non-bridge devices which are not enabled
> +//
> +if (((Pci.Hdr.Command & (EFI_PCI_COMMAND_IO_SPACE
> +  | EFI_PCI_COMMAND_MEMORY_SPACE)) ==
> 0)
> +  && (!(IS_PCI_BRIDGE (&Pci) || IS_CARDBUS_BRIDGE (&Pci {
> +  continue;
> +}
> +
> +//
>  // Collect all the information about the PCI device discovered
>  //
>  Status = PciSearchDevice (
> --
> 1.9.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 3/9] CorebootPayloadPkg/PlatformBdsLib: Fix spelling error

2016-03-04 Thread Bjorge, Erik C
Reviewed-by: Erik Bjorge 

> -Original Message-
> From: Leahy, Leroy P
> Sent: Friday, March 4, 2016 8:58 AM
> To: Ni, Ruiyu ; edk2-devel@lists.01.org; Bjorge,
> Erik C 
> Cc: Leahy, Leroy P 
> Subject: [PATCH 3/9] CorebootPayloadPkg/PlatformBdsLib: Fix spelling
> error
> 
> Change vender to vendor
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Lee Leahy 
> ---
>  CorebootPayloadPkg/Library/PlatformBdsLib/BdsPlatform.c  | 2 +-
>  CorebootPayloadPkg/Library/PlatformBdsLib/BdsPlatform.h  | 4 ++--
>  CorebootPayloadPkg/Library/PlatformBdsLib/PlatformData.c | 2 +-
>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/CorebootPayloadPkg/Library/PlatformBdsLib/BdsPlatform.c
> b/CorebootPayloadPkg/Library/PlatformBdsLib/BdsPlatform.c
> index fec14a3..a5027e5 100644
> --- a/CorebootPayloadPkg/Library/PlatformBdsLib/BdsPlatform.c
> +++ b/CorebootPayloadPkg/Library/PlatformBdsLib/BdsPlatform.c
> @@ -123,7 +123,7 @@ Returns:
>//
>// Register COM1
>//
> -  DevicePath = AppendDevicePathNode ((EFI_DEVICE_PATH_PROTOCOL *)NULL,
> (EFI_DEVICE_PATH_PROTOCOL *)&gUartDeviceVenderNode);
> +  DevicePath = AppendDevicePathNode ((EFI_DEVICE_PATH_PROTOCOL *)NULL,
> (EFI_DEVICE_PATH_PROTOCOL *)&gUartDeviceVendorNode);
>DevicePath = AppendDevicePathNode (DevicePath,
> (EFI_DEVICE_PATH_PROTOCOL *)&gUartDeviceNode);
>DevicePath = AppendDevicePathNode (DevicePath,
> (EFI_DEVICE_PATH_PROTOCOL *)&gTerminalTypeDeviceNode);
> 
> diff --git a/CorebootPayloadPkg/Library/PlatformBdsLib/BdsPlatform.h
> b/CorebootPayloadPkg/Library/PlatformBdsLib/BdsPlatform.h
> index 641e1cb..b8a241c 100644
> --- a/CorebootPayloadPkg/Library/PlatformBdsLib/BdsPlatform.h
> +++ b/CorebootPayloadPkg/Library/PlatformBdsLib/BdsPlatform.h
> @@ -38,7 +38,7 @@ extern EFI_DEVICE_PATH_PROTOCOL
> *gPlatformRootBridges[];
>  extern ACPI_HID_DEVICE_PATH   gPnp16550ComPortDeviceNode;
>  extern UART_DEVICE_PATH   gUartDeviceNode;
>  extern VENDOR_DEVICE_PATH gTerminalTypeDeviceNode;
> -extern VENDOR_DEVICE_PATH gUartDeviceVenderNode;
> +extern VENDOR_DEVICE_PATH gUartDeviceVendorNode;
> 
>  //
>  //
> @@ -83,7 +83,7 @@ extern VENDOR_DEVICE_PATH
> gUartDeviceVenderNode;
>  #define gPnp16550ComPort \
>PNPID_DEVICE_PATH_NODE(0x0501)
> 
> -#define gUartVender \
> +#define gUartVendor \
>{ \
>  { \
>HARDWARE_DEVICE_PATH, \
> diff --git a/CorebootPayloadPkg/Library/PlatformBdsLib/PlatformData.c
> b/CorebootPayloadPkg/Library/PlatformBdsLib/PlatformData.c
> index 4739c3c..c86e0e9 100644
> --- a/CorebootPayloadPkg/Library/PlatformBdsLib/PlatformData.c
> +++ b/CorebootPayloadPkg/Library/PlatformBdsLib/PlatformData.c
> @@ -23,7 +23,7 @@ UINT16
> gPlatformBootTimeOutDefault = 5;
>  ACPI_HID_DEVICE_PATH   gPnp16550ComPortDeviceNode =
> gPnp16550ComPort;
>  UART_DEVICE_PATH   gUartDeviceNode= gUart;
>  VENDOR_DEVICE_PATH gTerminalTypeDeviceNode=
> gPcAnsiTerminal;
> -VENDOR_DEVICE_PATH gUartDeviceVenderNode  = gUartVender;
> +VENDOR_DEVICE_PATH gUartDeviceVendorNode  = gUartVendor;
>  //
>  // Predefined platform root bridge
>  //
> --
> 1.9.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 2/9] Linux: Ignore *.patch and *~ files

2016-03-04 Thread Bjorge, Erik C
Not sure this is needed but will not hurt anything.

Reviewed-by: Erik Bjorge 

> -Original Message-
> From: Leahy, Leroy P
> Sent: Friday, March 4, 2016 8:57 AM
> To: Justen, Jordan L ; edk2-
> de...@lists.01.org; Bjorge, Erik C 
> Cc: Leahy, Leroy P 
> Subject: [PATCH 2/9] Linux: Ignore *.patch and *~ files
> 
> Have git ignore patch files and backup files (file names ending with ~).
> 
> TEST=git status no longer displays these files
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Lee Leahy 
> ---
>  .gitignore | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/.gitignore b/.gitignore
> index 821ed66..83790eb 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -1,2 +1,4 @@
>  Build/
>  tags/
> +*.patch
> +*~
> --
> 1.9.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 1/9] edksetup.sh: Create the Conf directory if necessary

2016-03-04 Thread Bjorge, Erik C
Reviewed-by: Erik Bjorge 

> -Original Message-
> From: Leahy, Leroy P
> Sent: Friday, March 4, 2016 8:55 AM
> To: Justen, Jordan L ; edk2-
> de...@lists.01.org; Bjorge, Erik C 
> Cc: Leahy, Leroy P 
> Subject: [PATCH 1/9] edksetup.sh: Create the Conf directory if necessary
> 
> Edit the shell script to determine if the Conf directory is present.  If
> not then create the Conf directory.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Lee Leahy 
> ---
>  edksetup.sh | 4 
>  1 file changed, 4 insertions(+)
> 
> diff --git a/edksetup.sh b/edksetup.sh
> index 57368b5..d89ef9d 100755
> --- a/edksetup.sh
> +++ b/edksetup.sh
> @@ -72,6 +72,10 @@ function SetWorkspace()
> 
>  function SetupEnv()
>  {
> +  if [ ! -d "$WORKSPACE/Conf" ]
> +  then
> +mkdir $WORKSPACE/Conf
> +  fi
>if [ -n "$EDK_TOOLS_PATH" ]
>then
>  . $EDK_TOOLS_PATH/BuildEnv $*
> --
> 1.9.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v4] DuetPkg-PciBusNoEnumerationDxe: Fix stack overflow

2016-02-26 Thread Bjorge, Erik C
Reviewed-by: Erik Bjorge 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Lee Leahy
> Sent: Thursday, February 25, 2016 6:08 PM
> To: Ni, Ruiyu ; Bjorge, Erik C
> ; edk2-devel@lists.01.org
> Subject: [edk2] [PATCH v4] DuetPkg-PciBusNoEnumerationDxe: Fix stack
> overflow
> 
> When a PCI bridge is not enabled, the secondary bus may still be zero.
> This causes an infinite recursive call to enumerate bus 0 which results
> in a stack overflow.  The easy fix is to skip the recursive bus
> enumeration for bridges which do not have the secondary bus initialized.
> 
> TEST=Build and run CorebootPayloadPkg on Quark/Galileo Gen2
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Lee Leahy 
> ---
>  DuetPkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c | 13 +++-
> -
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/DuetPkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c
> b/DuetPkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c
> index 80b2b6b..6b7dceb 100644
> --- a/DuetPkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c
> +++ b/DuetPkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c
> @@ -257,13 +257,14 @@ Returns:
>}
> 
>//
> -  // Deep enumerate the next level bus
> +  // If the PCI bridge is initialized then enumerate the next
> level bus
>//
> -  Status = PciPciDeviceInfoCollector (
> -PciIoDevice,
> -(UINT8) (SecBus)
> -);
> -
> +  if (SecBus != 0) {
> +Status = PciPciDeviceInfoCollector (
> +  PciIoDevice,
> +  (UINT8) (SecBus)
> +  );
> +  }
>  }
> 
>  if (Func == 0 && !IS_PCI_MULTI_FUNC (&Pci)) {
> --
> 1.9.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 1/2] CorebootModulePkg-CbParseLib: Add ACPI table verification

2016-02-25 Thread Bjorge, Erik C
Reviewed-by: Erik Bjorge 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Lee Leahy
> Sent: Wednesday, February 24, 2016 6:54 PM
> To: Ma, Maurice ; Agyeman, Prince
> ; Bjorge, Erik C ;
> edk2-devel@lists.01.org
> Subject: [edk2] [PATCH 1/2] CorebootModulePkg-CbParseLib: Add ACPI table
> verification
> 
> Verify the register address in the FADT.
> 
> TEST=Build and run on Galileo Gen2 when the FADT was not present.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Lee Leahy 
> ---
>  CorebootModulePkg/Library/CbParseLib/CbParseLib.c | 9 +
>  1 file changed, 9 insertions(+)
> 
> diff --git a/CorebootModulePkg/Library/CbParseLib/CbParseLib.c
> b/CorebootModulePkg/Library/CbParseLib/CbParseLib.c
> index 8509bd2..de6a5f7 100644
> --- a/CorebootModulePkg/Library/CbParseLib/CbParseLib.c
> +++ b/CorebootModulePkg/Library/CbParseLib/CbParseLib.c
> @@ -478,6 +478,15 @@ CbParseFadtInfo (
>DEBUG ((EFI_D_INFO, "PmGpeEn Reg 0x%x\n", *pPmGpeEnReg));
>  }
> 
> +//
> +// Verify values for proper operation
> +//
> +ASSERT(Fadt->Pm1aCntBlk != 0);
> +ASSERT(Fadt->PmTmrBlk != 0);
> +ASSERT(Fadt->ResetReg.Address != 0);
> +ASSERT(Fadt->Pm1aEvtBlk != 0);
> +ASSERT(Fadt->Gpe0Blk != 0);
> +
>  return RETURN_SUCCESS;
>}
>  }
> --
> 1.9.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 2/2] CorebootModulePkg-CbParseLib: Fix bad reference in CbParseLib

2016-02-25 Thread Bjorge, Erik C
Reviewed-by: Erik Bjorge 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Lee Leahy
> Sent: Wednesday, February 24, 2016 6:56 PM
> To: Ma, Maurice ; Agyeman, Prince
> ; Bjorge, Erik C ;
> edk2-devel@lists.01.org
> Subject: [edk2] [PATCH 2/2] CorebootModulePkg-CbParseLib: Fix bad
> reference in CbParseLib
> 
> Dereferencing pMemTableSize in debug statement displays bad values when
> it is set to NULL.  Display the actual table size value instead.
> 
> TEST=Build and run on Galileo Gen2
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Lee Leahy 
> ---
>  CorebootModulePkg/Library/CbParseLib/CbParseLib.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/CorebootModulePkg/Library/CbParseLib/CbParseLib.c
> b/CorebootModulePkg/Library/CbParseLib/CbParseLib.c
> index de6a5f7..e7f08c2 100644
> --- a/CorebootModulePkg/Library/CbParseLib/CbParseLib.c
> +++ b/CorebootModulePkg/Library/CbParseLib/CbParseLib.c
> @@ -216,7 +216,8 @@ FindCbMemTable (
>  *pMemTableSize = Entries[Idx].size;
>}
> 
> -  DEBUG ((EFI_D_INFO, "Find CbMemTable Id 0x%x, base %p, size
> 0x%x\n", TableId, *pMemTable, *pMemTableSize));
> +  DEBUG ((EFI_D_INFO, "Find CbMemTable Id 0x%x, base %p, size
> 0x%x\n",
> +TableId, *pMemTable, Entries[Idx].size));
>return RETURN_SUCCESS;
>  }
>}
> --
> 1.9.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v3] DuetPkg-PciBusNoEnumerationDxe: Fix stack overflow

2016-02-25 Thread Bjorge, Erik C
Reviewed-by: Erik Bjorge 

> -Original Message-
> From: Leahy, Leroy P
> Sent: Thursday, February 25, 2016 11:17 AM
> To: Ni, Ruiyu ; Bjorge, Erik C
> ; edk2-devel@lists.01.org
> Cc: Leahy, Leroy P 
> Subject: [PATCH v3] DuetPkg-PciBusNoEnumerationDxe: Fix stack overflow
> 
> When a PCI bridge is not enabled, the secondary bus may still be zero.
> This causes an infinite recursive call to enumerate bus 0 which results
> in a stack overflow.  The easy fix is to skip the recursive bus
> enumeration for devices which are not enabled either for memory or I/O
> accesses.
> 
> TEST=Build and run CorebootPayloadPkg on Quark/Galileo Gen2
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Lee Leahy 
> ---
>  DuetPkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/DuetPkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c
> b/DuetPkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c
> index 80b2b6b..7f8393a 100644
> --- a/DuetPkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c
> +++ b/DuetPkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c
> @@ -243,7 +243,9 @@ Returns:
>  //
>  //
> 
> -if (!EFI_ERROR (Status) && (IS_PCI_BRIDGE (&Pci) ||
> IS_CARDBUS_BRIDGE (&Pci))) {
> +if (!EFI_ERROR (Status) && (Pci.Hdr.Command &
> (EFI_PCI_COMMAND_IO_SPACE
> +| EFI_PCI_COMMAND_MEMORY_SPACE))
> +  && (IS_PCI_BRIDGE (&Pci) || IS_CARDBUS_BRIDGE (&Pci))) {
> 
>//
>// If it is PPB, we need to get the secondary bus to continue
> the enumeration
> --
> 1.9.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] BaseTools build number after transition to git

2016-02-18 Thread Bjorge, Erik C
> From: Felix Poludov [mailto:fel...@ami.com]
> Sent: Thursday, February 18, 2016 1:11 PM
> To: Bjorge, Erik C ; edk2-devel@lists.01.org
> Subject: RE: BaseTools build number after transition to git
> 
> Eric,
> 
> Using git commit hash or a truncated version of hash, as proposed by
> Laszlo, is mostly fine.
> The only inconvenience of git hashes is that they cannot be compared.
> Unlike SVN revision, it's impossible to tell which commit is newer, by
> just looking at git hash.
> I suggest using git hash plus commit date/time.
> Something similar to the output of the following command:
> git show -s --format="%H %ci" 

I am fine with including the date along with the hash.  I will add that to my 
list of changes.

Thanks,
-Erik

> 
> 
> -Original Message-
> From: Bjorge, Erik C [mailto:erik.c.bjo...@intel.com]
> Sent: Friday, February 12, 2016 6:41 PM
> To: Felix Poludov; edk2-devel@lists.01.org
> Subject: RE: BaseTools build number after transition to git
> 
> Sorry for the late reply.  Currently I am planning to use the SHA1 as
> the version.  This seems like a reasonable approach.
> 
> Thanks,
> -Erik
> 
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> > Felix Poludov
> > Sent: Wednesday, February 10, 2016 11:09 AM
> > To: edk2-devel@lists.01.org
> > Subject: [edk2] BaseTools build number after transition to git
> >
> > Most of the EDKII tools support --version switch that returns tool
> > version and build number.
> > We've been using SVN revision ID as a build number for all the tools.
> > Have there been any discussions on what should be used as a build
> number
> > in the new (and hopefully merrier)  EDKII Git world?
> >
> > Felix
> >
> >
> > The information contained in this message may be confidential and
> > proprietary to American Megatrends, Inc.  This communication is
> intended
> > to be read only by the individual or entity to whom it is addressed or
> > by their designee. If the reader of this message is not the intended
> > recipient, you are on notice that any distribution of this message, in
> > any form, is strictly prohibited.  Please promptly notify the sender
> by
> > reply e-mail or by telephone at 770-246-8600, and then delete or
> destroy
> > all copies of the transmission.
> > ___
> > edk2-devel mailing list
> > edk2-devel@lists.01.org
> > https://lists.01.org/mailman/listinfo/edk2-devel
> 
> The information contained in this message may be confidential and
> proprietary to American Megatrends, Inc.  This communication is intended
> to be read only by the individual or entity to whom it is addressed or
> by their designee. If the reader of this message is not the intended
> recipient, you are on notice that any distribution of this message, in
> any form, is strictly prohibited.  Please promptly notify the sender by
> reply e-mail or by telephone at 770-246-8600, and then delete or destroy
> all copies of the transmission.
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] BaseTools build number after transition to git

2016-02-12 Thread Bjorge, Erik C
Sorry for the late reply.  Currently I am planning to use the SHA1 as the 
version.  This seems like a reasonable approach.

Thanks,
-Erik

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Felix Poludov
> Sent: Wednesday, February 10, 2016 11:09 AM
> To: edk2-devel@lists.01.org
> Subject: [edk2] BaseTools build number after transition to git
> 
> Most of the EDKII tools support --version switch that returns tool
> version and build number.
> We've been using SVN revision ID as a build number for all the tools.
> Have there been any discussions on what should be used as a build number
> in the new (and hopefully merrier)  EDKII Git world?
> 
> Felix
> 
> 
> The information contained in this message may be confidential and
> proprietary to American Megatrends, Inc.  This communication is intended
> to be read only by the individual or entity to whom it is addressed or
> by their designee. If the reader of this message is not the intended
> recipient, you are on notice that any distribution of this message, in
> any form, is strictly prohibited.  Please promptly notify the sender by
> reply e-mail or by telephone at 770-246-8600, and then delete or destroy
> all copies of the transmission.
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] github development process

2016-02-11 Thread Bjorge, Erik C
Jordan and I have updated the EDK II Development Process page.  Please check 
and see if this clears up some of the issues.

https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Development-Process

Thanks,
-Erik

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Bjorge, Erik C
> Sent: Thursday, February 11, 2016 10:23 AM
> To: El-Haj-Mahmoud, Samer ; edk2-
> de...@lists.01.org
> Subject: Re: [edk2] github development process
> 
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> > El-Haj-Mahmoud, Samer
> > Sent: Wednesday, February 10, 2016 4:03 PM
> > To: edk2-devel@lists.01.org
> > Subject: [edk2] github development process
> >
> > So I have been itching to submit patches after the transition to
> github,
> > when I stumbled across this. It looks like the development process
> > described in:
> https://github.com/tianocore/tianocore.github.io/wiki/EDK-
> > II-Development-Process , does not match the process described in:
> >
> https://raw.githubusercontent.com/tianocore/edk2/master/MdePkg/Contribut
> > ions.txt
> >
> > I followed the process in the wiki, and ended up creating a pull
> request
> > for tiancore/edk for my contribution
> > (https://github.com/tianocore/edk2/pull/55). I was also going to send
> a
> > patch to EDK2 list (as the wiki suggests). Then I quickly realized
> that
> > the maintainers are still working only with e-mail patches, and not
> pull
> > requests, as clear from the conversations in closed/rejected pull
> > requests:
> >
> > https://github.com/tianocore/edk2/pull/45
> > https://github.com/tianocore/edk2/pull/51
> > https://github.com/tianocore/edk2/pull/41
> > etc..
> >
> >
> > I have no problem of sticking with the edk2-devel e-mail patches like
> we
> > have been doing (all of my team from HPE contributes that way). But if
> > that is the only/proper way to submit contributions, then the wiki
> need
> > to be updated to drop the pull requests steps.
> 
> I will update the Wiki as you suggest.  We were hoping to allow for at
> least some form of pull request but it looks like we are not quite ready
> for that yet.
> 
> Thanks,
> -Erik
> 
> >
> > Thanks,
> > --Samer
> >
> >
> >
> > ___
> > edk2-devel mailing list
> > edk2-devel@lists.01.org
> > https://lists.01.org/mailman/listinfo/edk2-devel
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] github development process

2016-02-11 Thread Bjorge, Erik C
Jordan,

I think we also need to clarify step 9 as well by removing the option of 
sending a link and branch name of a forked repo.

Thanks,
-Erik

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> El-Haj-Mahmoud, Samer
> Sent: Thursday, February 11, 2016 7:31 AM
> To: Justen, Jordan L ; edk2-
> de...@lists.01.org
> Subject: Re: [edk2] github development process
> 
> Justen,
> 
> Yes I see now that there is duplicate between:
> 
> https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-
> Development-Process
> and
> https://github.com/tianocore/tianocore.github.io/wiki/SourceForge-to-
> Github-Quick-Start
> 
> 
> And yes, step "7. Update the master branch (pull or fetch/merge" is what
> triggered me to create a pull request (that, and my incorrect assumption
> that we are using github for development process, not just to host the
> pull requests).
> 
> Thanks,
> --Samer
> 
> 
> 
> 
> 
> -Original Message-
> From: Jordan Justen [mailto:jordan.l.jus...@intel.com]
> Sent: Wednesday, February 10, 2016 6:32 PM
> To: El-Haj-Mahmoud, Samer ; edk2-
> de...@lists.01.org
> Subject: Re: [edk2] github development process
> 
> On 2016-02-10 16:03:26, El-Haj-Mahmoud, Samer wrote:
> > So I have been itching to submit patches after the transition to
> > github, when I stumbled across this. It looks like the development
> > process described in:
> > https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Developme
> > nt-Process , does not match the process described in:
> > https://raw.githubusercontent.com/tianocore/edk2/master/MdePkg/Contrib
> > utions.txt
> >
> 
> There seems to be duplicated content on
> 
> https://github.com/tianocore/tianocore.github.io/wiki/SourceForge-to-
> Github-Quick-Start
> 
> And, I think the EDK-II-Development-Process version was a little older.
> I updated it to match the other one.
> 
> Before and after, I only saw one mention of 'pull':
> 
> "7. Update the master branch (pull or fetch/merge)"
> 
> Is this what caused the confusion? Or, was there something else that
> generated a pull request?
> 
> -Jordan
> 
> > I followed the process in the wiki, and ended up creating a pull
> > request for tiancore/edk for my contribution
> > (https://github.com/tianocore/edk2/pull/55). I was also going to send
> > a patch to EDK2 list (as the wiki suggests). Then I quickly realized
> > that the maintainers are still working only with e-mail patches, and
> > not pull requests, as clear from the conversations in closed/rejected
> > pull requests:
> >
> > https://github.com/tianocore/edk2/pull/45
> > https://github.com/tianocore/edk2/pull/51
> > https://github.com/tianocore/edk2/pull/41
> > etc..
> >
> >
> > I have no problem of sticking with the edk2-devel e-mail patches like
> > we have been doing (all of my team from HPE contributes that way). But
> > if that is the only/proper way to submit contributions, then the wiki
> > need to be updated to drop the pull requests steps.
> >
> > Thanks,
> > --Samer
> >
> >
> >
> > ___
> > edk2-devel mailing list
> > edk2-devel@lists.01.org
> > https://lists.01.org/mailman/listinfo/edk2-devel
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] github development process

2016-02-11 Thread Bjorge, Erik C
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> El-Haj-Mahmoud, Samer
> Sent: Wednesday, February 10, 2016 4:03 PM
> To: edk2-devel@lists.01.org
> Subject: [edk2] github development process
> 
> So I have been itching to submit patches after the transition to github,
> when I stumbled across this. It looks like the development process
> described in: https://github.com/tianocore/tianocore.github.io/wiki/EDK-
> II-Development-Process , does not match the process described in:
> https://raw.githubusercontent.com/tianocore/edk2/master/MdePkg/Contribut
> ions.txt
> 
> I followed the process in the wiki, and ended up creating a pull request
> for tiancore/edk for my contribution
> (https://github.com/tianocore/edk2/pull/55). I was also going to send a
> patch to EDK2 list (as the wiki suggests). Then I quickly realized that
> the maintainers are still working only with e-mail patches, and not pull
> requests, as clear from the conversations in closed/rejected pull
> requests:
> 
> https://github.com/tianocore/edk2/pull/45
> https://github.com/tianocore/edk2/pull/51
> https://github.com/tianocore/edk2/pull/41
> etc..
> 
> 
> I have no problem of sticking with the edk2-devel e-mail patches like we
> have been doing (all of my team from HPE contributes that way). But if
> that is the only/proper way to submit contributions, then the wiki need
> to be updated to drop the pull requests steps.

I will update the Wiki as you suggest.  We were hoping to allow for at least 
some form of pull request but it looks like we are not quite ready for that yet.

Thanks,
-Erik

> 
> Thanks,
> --Samer
> 
> 
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] BaseTools-Source: Update displayed version information

2016-02-05 Thread Bjorge, Erik C
Reviewed-by: Erik Bjorge 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Larry Hauch
> Sent: Friday, February 5, 2016 8:03 AM
> To: edk2-devel@lists.01.org
> Subject: [edk2] [PATCH] BaseTools-Source: Update displayed version
> information
> 
> Standardize the --version and --help text command-line options
> 
> Updated tools to correctly display the Build number when using command-
> line
> option --version and exit successfully after termination.
> Ecc was also updated to print informational messages after the options
> are
> parsed.
> 
> Cc: Zhu Yonghong 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Larry Hauch 
> Reviewed-by: Reviewer Name 
> ---
>  BaseTools/Source/C/BootSectImage/bootsectimage.c  | 14 ++--
>  BaseTools/Source/C/EfiLdrImage/EfiLdrImage.c  | 17 ---
>  BaseTools/Source/C/Split/Split.c  | 14 ++--
>  BaseTools/Source/C/VfrCompile/VfrCompiler.cpp |  8 +++
>  BaseTools/Source/C/VfrCompile/VfrCompiler.h   |  4 ++--
>  BaseTools/Source/C/VolInfo/VolInfo.c  | 26 ++--
> ---
>  BaseTools/Source/Python/BPDG/BPDG.py  |  6 +++---
>  BaseTools/Source/Python/BPDG/StringTable.py   | 14 ++--
>  BaseTools/Source/Python/Ecc/Ecc.py| 11 +-
>  BaseTools/Source/Python/UPT/Logger/StringTable.py |  6 +++---
>  BaseTools/Source/Python/UPT/UPT.py|  4 ++--
>  11 files changed, 65 insertions(+), 59 deletions(-)
> 
> diff --git a/BaseTools/Source/C/BootSectImage/bootsectimage.c
> b/BaseTools/Source/C/BootSectImage/bootsectimage.c
> index b4fb340..4f876ae 100644
> --- a/BaseTools/Source/C/BootSectImage/bootsectimage.c
> +++ b/BaseTools/Source/C/BootSectImage/bootsectimage.c
> @@ -4,7 +4,7 @@ Abstract:
>Patch the BPB information in boot sector image file.
>Patch the MBR code in MBR image file.
> 
> -Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
> +Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
>  This program and the accompanying materials
>  are licensed and made available under the terms and conditions of the
> BSD License
>  which accompanies this distribution.  The full text of the license may
> be found at
> @@ -33,8 +33,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND,
> EITHER EXPRESS OR IMPLIED.
>  //
>  // Utility version information
>  //
> -#define UTILITY_MAJOR_VERSION 0
> -#define UTILITY_MINOR_VERSION 1
> +#define UTILITY_MAJOR_VERSION 1
> +#define UTILITY_MINOR_VERSION 0
> 
>  void
>  Version (
> @@ -56,10 +56,7 @@ Returns:
> 
>  --*/
>  {
> -  printf ("%s Version %d.%d %s\n", UTILITY_NAME, UTILITY_MAJOR_VERSION,
> UTILITY_MINOR_VERSION, __BUILD_VERSION);
> -  printf ("Copyright (c) 1999-2014 Intel Corporation. All rights
> reserved.\n");
> -  printf ("\n  The BootSectImage tool prints information or patch
> destination file by source\n");
> -  printf ("  file for BIOS Parameter Block (BPB) or Master Boot Record
> (MBR).\n");
> +  printf ("%s Version %d.%d Build %s\n", UTILITY_NAME,
> UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);
>  }
> 
>  void
> @@ -82,6 +79,9 @@ Returns:
>  --*/
>  {
>Version();
> +  printf ("Copyright (c) 1999-2016 Intel Corporation. All rights
> reserved.\n");
> +  printf ("\n  The BootSectImage tool prints information or patch
> destination file by source\n");
> +  printf ("  file for BIOS Parameter Block (BPB) or Master Boot Record
> (MBR).\n");
>printf ("\nUsage: \n\
> BootSectImage\n\
>   [-f, --force force patch even if the FAT type of SrcImage and
> DstImage mismatch]\n\
> diff --git a/BaseTools/Source/C/EfiLdrImage/EfiLdrImage.c
> b/BaseTools/Source/C/EfiLdrImage/EfiLdrImage.c
> index 31d697e..88cc345 100644
> --- a/BaseTools/Source/C/EfiLdrImage/EfiLdrImage.c
> +++ b/BaseTools/Source/C/EfiLdrImage/EfiLdrImage.c
> @@ -6,7 +6,7 @@ FILE := EFILDR_HEADER
>   +
>  The order of EFILDR_IMAGE is same as the order of placing
> PeImageFileContent.
> 
> -Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
> +Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
>  This program and the accompanying materials
>  are licensed and made available under the terms and conditions of the
> BSD License
>  which accompanies this distribution.  The full text of the license may
> be found at
> @@ -51,8 +51,8 @@ typedef struct {
>  //
>  // Utility version information
>  //
> -#define UTILITY_MAJOR_VERSION 0
> -#define UTILITY_MINOR_VERSION 1
> +#define UTILITY_MAJOR_VERSION 1
> +#define UTILITY_MINOR_VERSION 0
> 
>  void
>  Version (
> @@ -74,9 +74,8 @@ Returns:
> 
>  --*/
>  {
> -  printf ("%s Version %d.%d %s\n", UTILITY_NAME, UTILITY_MAJOR_VERSION,
> UTILITY_MINOR_VERSION, __BUILD_VERSION);
> -  printf ("Copyright (c) 1999-2014 Intel Corporation. All rights
> reserved.\n");
> -  printf ("\n  The EfiLdrImage tool is used to combine PE fil

Re: [edk2] Transition to GitHub Update

2016-01-18 Thread Bjorge, Erik C
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Ard Biesheuvel
> Sent: Saturday, January 16, 2016 6:26 AM
> To: Jarlstrom, Laurie 
> Cc: edk2-devel@lists.01.org
> Subject: Re: [edk2] Transition to GitHub Update
> 
> On 15 January 2016 at 22:14, Jarlstrom, Laurie
>  wrote:
> > To: EDK II Community
> >
> > This message is an update on the transition from SourceForge to GitHub
> for EDK II development.  The schedule is currently targeting the last
> week of January or the first week of February to perform the transition.
> The transition process should only take one to two days to complete.  A
> notification message will be sent the week prior to the actual dates
> that the repositories will be impacted.  This should provide adequate
> notification for the scheduled down time.
> > As part of this transition some documentation and process changes have
> been required.  The updated process as well as other GitHub specific
> information can be found on the tianocore Wiki at the link provided
> below.  Feedback on this documentation is welcome and needed to make
> sure the transition is as smooth as possible.
> >
> > https://github.com/tianocore/tianocore.github.io/wiki/SourceForge-to-
> Github-Quick-Start
> >
> > Please post any comments or questions related to this transition to
> the edk2-devel mailing list or reply to the email message.
> >
> 
> Hello,
> 
> Thanks for getting all of this set up.
> 
> Regarding the following line
> 
> 'Commits should build / boot if possible to support use of bisect'
> 
> could we make that a bit stronger please? Breaking bisect is really
> not ok, and it usually does not take that much extra work to avoid it,
> as long as you are aware of it. Given that many people are new to Git,
> presenting it as an opt-in feature like this does not send the right
> message imo.

I will update the wording.  You are correct that bisect just needs to work.

> 
> In fact, having some guidelines about how to avoid breaking bisect
> could be helpful, especially that something like adding some temporary
> code in an early patch only to remove it again at the end of the
> series is perfectly ok, and highly preferred over losing
> bisectability. Not everybody might expect that.
> 

I will add some guidelines/hints on how not to break bisect.  Most of the time 
it is as simple as reordering a patch series.  Adding temporary code is not 
always an obvious solution so adding that to the list of hints is good.  Do you 
have any other hints or guidelines you would like added?

Thanks,
-Erik

> Thanks,
> Ard.
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] Transition to GitHub Update

2016-01-15 Thread Bjorge, Erik C


> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Bruce Cran
> Sent: Friday, January 15, 2016 4:02 PM
> To: Jarlstrom, Laurie ; edk2-
> de...@lists.01.org
> Subject: Re: [edk2] Transition to GitHub Update
> 
> On 1/15/16 2:14 PM, Jarlstrom, Laurie wrote:
> > To: EDK II Community
> >
> > This message is an update on the transition from SourceForge to GitHub
> for EDK II development.  The schedule is currently targeting the last
> week of January or the first week of February to perform the transition.
> The transition process should only take one to two days to complete.  A
> notification message will be sent the week prior to the actual dates
> that the repositories will be impacted.  This should provide adequate
> notification for the scheduled down time.
> > As part of this transition some documentation and process changes have
> been required.  The updated process as well as other GitHub specific
> information can be found on the tianocore Wiki at the link provided
> below.  Feedback on this documentation is welcome and needed to make
> sure the transition is as smooth as possible.
> >
> > https://github.com/tianocore/tianocore.github.io/wiki/SourceForge-to-
> Github-Quick-Start
> >
> > Please post any comments or questions related to this transition to
> the edk2-devel mailing list or reply to the email message.
> 
> It might be good to mention that people can use "git send-email" to send
> a patch to the mailing list.

I will update the Wiki to cover that.  The use of "git send-email" is the 
preferred method to send out patches.

-Erik

> 
> --
> Bruce
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] StdLib: Temporarily restrict compiler warnings so that sockets can be built using VS2015.

2016-01-04 Thread Bjorge, Erik C
As this is only temporary please commit this and continue to fix the socket 
build errors.

Reviewed-by: Erik Bjorge 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of 
> Bjorge, Erik C
> Sent: Monday, January 4, 2016 9:40 AM
> To: Daryl McDaniel ; edk2-devel@lists.01.org; 
> Carsey, Jaben
> 
> Subject: Re: [edk2] [PATCH] StdLib: Temporarily restrict compiler warnings so 
> that sockets
> can be built using VS2015.
> 
> Daryl,
> 
> What are the plans for fixing the socket code to pass with VS2015?  I just 
> want to know
> how long this temporary patch will be around.
> 
> Thanks,
> -Erik
> 
> From: Daryl McDaniel [mailto:edk2-li...@mc2research.org]
> Sent: Sunday, January 3, 2016 2:21 PM
> To: edk2-devel@lists.01.org; Carsey, Jaben ; Bjorge, 
> Erik C
> 
> Subject: [PATCH] StdLib: Temporarily restrict compiler warnings so that 
> sockets can be
> built using VS2015.
> 
> 
> StdLib: Temporarily restrict compiler warnings so that sockets can be built 
> using VS2015.
> 
> 
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> 
> Signed-off-by: Daryl McDaniel mailto:edk2-
> li...@mc2research.org>>
> 
> 
> 
> ---
> 
> diff U3 a/StdLib/StdLib.inc b/StdLib/StdLib.inc
> 
> --- a/StdLib/StdLib.inc Tue Aug 11 21:25:12 2015
> 
> +++ b/StdLib/StdLib.inc Sun Jan 03 12:17:42 2016
> 
> @@ -5,6 +5,7 @@
> 
> # The including DSC file must DEFINE the EMULATE macro if
> 
> # the application is to be run in an emulation environment.
> 
> #
> 
> +#  Copyright (c) 2016, Daryl McDaniel. All rights reserved.
> 
> #  Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.
> 
> #  This program and the accompanying materials
> 
> #  are licensed and made available under the terms and conditions of the BSD 
> License
> 
> @@ -133,3 +134,12 @@
> 
>  RVCT:*_*_*_CC_FLAGS = --library_interface=none -DUEFI_C_SOURCE -
> J$(WORKSPACE)/StdLib/Include -J$(WORKSPACE)/StdLib/Include/Arm
> 
> XCODE:*_*_*_CC_FLAGS = -nostdinc -nostdlib -DUEFI_C_SOURCE 
> -Wno-unused-const-
> variable -Wno-string-compare -Wno-sometimes-uninitialized
> 
> !endif
> 
> +
> 
> +  # Temporarily restrict compiler warnings to those produced by VS2012.
> 
> +  # Code that fails when these flags are removed will have to be rewritten
> 
> +  # in order to pass.  This may be as simple as renaming an object, but may
> 
> +  # require more significant changes.
> 
> +MSFT:*_VS2015_*_CC_FLAGS  = /Wv:11
> 
> +MSFT:*_VS2015x86_*_CC_FLAGS   = /Wv:11
> 
> +MSFT:*_VS2015xASL_*_CC_FLAGS  = /Wv:11
> 
> +MSFT:*_VS2015x86xASL_*_CC_FLAGS   = /Wv:11
> 
> --
> 
> Daryl McDaniel
> 
> 
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] StdLib: Temporarily restrict compiler warnings so that sockets can be built using VS2015.

2016-01-04 Thread Bjorge, Erik C
Daryl,

What are the plans for fixing the socket code to pass with VS2015?  I just want 
to know how long this temporary patch will be around.

Thanks,
-Erik

From: Daryl McDaniel [mailto:edk2-li...@mc2research.org]
Sent: Sunday, January 3, 2016 2:21 PM
To: edk2-devel@lists.01.org; Carsey, Jaben ; Bjorge, 
Erik C 
Subject: [PATCH] StdLib: Temporarily restrict compiler warnings so that sockets 
can be built using VS2015.


StdLib: Temporarily restrict compiler warnings so that sockets can be built 
using VS2015.



Contributed-under: TianoCore Contribution Agreement 1.0

Signed-off-by: Daryl McDaniel 
mailto:edk2-li...@mc2research.org>>



---

diff U3 a/StdLib/StdLib.inc b/StdLib/StdLib.inc

--- a/StdLib/StdLib.inc Tue Aug 11 21:25:12 2015

+++ b/StdLib/StdLib.inc Sun Jan 03 12:17:42 2016

@@ -5,6 +5,7 @@

# The including DSC file must DEFINE the EMULATE macro if

# the application is to be run in an emulation environment.

#

+#  Copyright (c) 2016, Daryl McDaniel. All rights reserved.

#  Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.

#  This program and the accompanying materials

#  are licensed and made available under the terms and conditions of the BSD 
License

@@ -133,3 +134,12 @@

 RVCT:*_*_*_CC_FLAGS = --library_interface=none -DUEFI_C_SOURCE 
-J$(WORKSPACE)/StdLib/Include -J$(WORKSPACE)/StdLib/Include/Arm

XCODE:*_*_*_CC_FLAGS = -nostdinc -nostdlib -DUEFI_C_SOURCE 
-Wno-unused-const-variable -Wno-string-compare -Wno-sometimes-uninitialized

!endif

+

+  # Temporarily restrict compiler warnings to those produced by VS2012.

+  # Code that fails when these flags are removed will have to be rewritten

+  # in order to pass.  This may be as simple as renaming an object, but may

+  # require more significant changes.

+MSFT:*_VS2015_*_CC_FLAGS  = /Wv:11

+MSFT:*_VS2015x86_*_CC_FLAGS   = /Wv:11

+MSFT:*_VS2015xASL_*_CC_FLAGS  = /Wv:11

+MSFT:*_VS2015x86xASL_*_CC_FLAGS   = /Wv:11

--

Daryl McDaniel



___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] StdLib: Fix IIO_Write() to return the number of bytes consumed, not characters output.

2016-01-04 Thread Bjorge, Erik C
I am not sure I like how the W_INSTRUMENT and R_INSTRUMENT look in the code but 
I also do not have a good alternate suggestion.  It just looked odd when I was 
reading the patch.

Reviewed-by: Erik Bjorge 

> -Original Message-
> From: Daryl McDaniel [mailto:edk2-li...@mc2research.org]
> Sent: Sunday, January 3, 2016 2:38 PM
> To: 'Alexey Vegner' ; 
> edk2-devel@lists.01.org; Carsey,
> Jaben ; Bjorge, Erik C 
> Subject: [PATCH] StdLib: Fix IIO_Write() to return the number of bytes 
> consumed, not
> characters output.
> 
> StdLib: Fix IIO_Write() to return the number of bytes consumed, not 
> characters output.
> 
> Depending upon termios settings, writing to a terminal device may result in
> many more characters being output than were in the buffer provided to the
> IIO_Write() function.
> 
> IIO_Write() is supposed to return the number of BYTES written, not characters.
> Since the provided buffer contains MBCS characters, there can be up to three
> bytes per character.  Due to the expansion that may occur, "BYTES written"
> is interpreted to mean the number of BYTES consumed from the MBCS buffer
> provided as a parameter to IIO_Write.
> 
> These changes ensure that the correct number of characters are consumed from
> the internal Output buffer and the correct number of BYTES consumed from the
> buffer parameter are counted and returned.
> 
> Update copyright.
> Add debugging instrumentation to count unconsumed data in the Input and 
> Output buffers.
> Improve comments for IIO_Write().
> Modify IIO_Write() to:
>   * Accurately count input bytes CONSUMED.
>   * Consume only as many expanded (cooked) characters from the output buffer
> as were actually sent to the device.
>   * Purge only the number of CHARACTERS sent from the output buffer.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Daryl McDaniel 
> 
> ---
> diff U3 a/StdLib/LibC/Uefi/InteractiveIO/IIO.c 
> b/StdLib/LibC/Uefi/InteractiveIO/IIO.c
> --- a/StdLib/LibC/Uefi/InteractiveIO/IIO.c  Tue Dec 11 13:19:14 2012
> +++ b/StdLib/LibC/Uefi/InteractiveIO/IIO.c  Sun Jan 03 09:35:14 2016
> @@ -3,6 +3,7 @@
> 
>The functions assume that isatty() is TRUE at the time they are called.
> 
> +  Copyright (c) 2016, Daryl McDaniel. All rights reserved.
>Copyright (c) 2012, Intel Corporation. All rights reserved.
>This program and the accompanying materials are licensed and made available
>under the terms and conditions of the BSD License which accompanies this
> @@ -26,6 +27,20 @@
>  #include  "IIOutilities.h"
>  #include  "IIOechoCtrl.h"
> 
> +// Instrumentation used for debugging
> +#define   IIO_C_DEBUG   0   ///< Set to 1 to enable instrumentation, 0 
> to disable
> +
> +#if IIO_C_DEBUG
> +  static volatile size_t  IIO_C_WRemainder = 0;   ///< Characters in Out 
> buffer after
> IIO_Write
> +  static volatile size_t  IIO_C_RRemainder = 0;   ///< Characters in In 
> buffer after
> IIO_Read
> +
> +  #define W_INSTRUMENT  IIO_C_WRemainder =
> +  #define R_INSTRUMENT  IIO_C_RRemainder =
> +#else // ! IIO_C_DEBUG -- don't instrument code
> +  #define W_INSTRUMENT  (void)
> +  #define R_INSTRUMENT  (void)
> +#endif  // IIO_C_DEBUG
> +
>  /** Read from an Interactive IO device.
> 
>NOTE: If _S_IWTTY is set, the internal buffer contains WIDE characters.
> @@ -82,24 +97,44 @@
>NumRead = wcstombs((char *)Buffer, (const wchar_t *)gMD->UString2, 
> XlateSz);
> 
>// Consume the translated characters
> -  (void)This->InBuf->Flush(This->InBuf, Needed);
> +  (void) This->InBuf->Flush(This->InBuf, Needed);
>  }
>  else {
>// Data in InBuf is narrow characters.  Use verbatim.
>NumRead = This->InBuf->Read(This->InBuf, Buffer, (INT32)BufferSize);
>  }
> +#if IIO_C_DEBUG
> +IIO_C_RRemainder = This->InBuf->Count(This->InBuf, AsElements);
> +#endif // IIO_C_DEBUG
>}
>return NumRead;
>  }
> 
> -/** Process characters from buffer buf and write them to the output device
> +/** Handle write to a Terminal (Interactive) device.
> +
> +Processes characters from buffer buf and writes them to the Terminal 
> device
>  specified by filp.
> 
> +The parameter buf points to a MBCS string to be output. This is processed
> +and buffered one character at a time by IIO_WriteOne() which handles TAB
> +expansion, NEWLINE to CARRIAGE_RETURN + NEWLINE expansion, as well as
> +basic line editing functions. The number of characters actually written 
> to
> +the output device will seldom equal the number of characters consumed 

Re: [edk2] [PATCH] StdLib: Implement da_ConFlush() and flush I/O buffers when closing a console device.

2016-01-04 Thread Bjorge, Erik C
Reviewed-by: Erik Bjorge 

> -Original Message-
> From: Daryl McDaniel [mailto:edk2-li...@mc2research.org]
> Sent: Sunday, January 3, 2016 2:45 PM
> To: edk2-devel@lists.01.org; Carsey, Jaben ; Bjorge, 
> Erik C
> 
> Subject: [PATCH] StdLib: Implement da_ConFlush() and flush I/O buffers when 
> closing a
> console device.
> 
> StdLib: Implement da_ConFlush() and flush I/O buffers when closing a console 
> device.
> 
> Add header file Efi/SysEfi.h
> Implement function da_ConFlush()
> Modify da_ConClose() to flush its buffers and clean up better upon close.
> Construct the console instance using the new da_ConFlush() instead of the 
> nullop function.
> Remove da_ConFlush() from the "Not implemented (yet?)" place holder.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Daryl McDaniel 
> 
> ---
> diff U3 a/StdLib/LibC/Uefi/Devices/Console/daConsole.c
> b/StdLib/LibC/Uefi/Devices/Console/daConsole.c
> --- a/StdLib/LibC/Uefi/Devices/Console/daConsole.c  Tue Nov 11 14:56:58 2014
> +++ b/StdLib/LibC/Uefi/Devices/Console/daConsole.c  Sun Jan 03 12:16:39 2016
> @@ -10,6 +10,7 @@
>The devices status as a wide device is indicatd by _S_IWTTY being set in
>f_iflags.
> 
> +  Copyright (c) 2016, Daryl McDaniel. All rights reserved.
>Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.
>This program and the accompanying materials are licensed and made 
> available under
>the terms and conditions of the BSD License that accompanies this 
> distribution.
> @@ -37,6 +38,7 @@
>  #include  
>  #include  
>  #include  
> +#include  
>  #include  
>  #include  
>  #include  
> @@ -104,6 +106,65 @@
>return i;
>  }
> 
> +/** Flush the console's IIO buffers.
> +
> +Flush the IIO Input or Output buffers depending upon the mode
> +of the specified file.
> +
> +If the console is open for output, write any unwritten data in the output
> +buffer to the console.
> +
> +If the console is open for input or output, discard any remaining data
> +in the associated buffers.
> +
> +@param[in]filpPointer to the target file's descriptor structure.
> +
> +@retval 0 Always succeeds
> +**/
> +static
> +int
> +EFIAPI
> +da_ConFlush(
> +  struct __filedes *filp
> +)
> +{
> +  cIIO   *This;
> +  char   *MbcsPtr;
> +  ssize_t NumProc;
> +  void   *OutPtr;
> +
> +  This = filp->devdata;
> +
> +  if (filp->f_iflags & S_ACC_READ)  { // Readable so flush the input 
> buffer
> +This->InBuf->Flush(This->InBuf, UNICODE_STRING_MAX);
> +  }
> +  if (filp->f_iflags & S_ACC_WRITE)  {// Writable so flush the output 
> buffer
> +// At this point, the characters to write are in OutBuf
> +// First, linearize and consume the buffer
> +NumProc = OutBuf->Read(OutBuf, gMD->UString, UNICODE_STRING_MAX-1);
> +if (NumProc > 0) {  // Optimization -- Nothing to do if no characters
> +  gMD->UString[NumProc] = 0;   // Ensure that the buffer is terminated
> +
> +  if(filp->f_iflags & _S_IWTTY) {
> +// Output device expects wide characters, Output what we have
> +OutPtr = gMD->UString;
> +  }
> +  else {
> +// Output device expects narrow characters, convert to MBCS
> +OutPtr = gMD->UString2;
> +// Translate the wide buffer, gMD->UString into MBCS
> +// in the buffer pointed to by OutPtr.
> +// The returned value, NumProc, is the resulting number of bytes.
> +NumProc = wcstombs((char *)OutPtr, (const wchar_t *)gMD->UString, 
> NumProc);
> +((char *)OutPtr)[NumProc] = 0;   // Ensure the buffer is terminated
> +  }
> +  // Do the actual write of the data
> +  (void) filp->f_ops->fo_write(filp, NULL, NumProc, OutPtr);
> +}
> +  }
> +  return 0;
> +}
> +
>  /** Close an open file.
> 
>  @param[in]  filpPointer to the file descriptor structure for this 
> file.
> @@ -127,6 +188,13 @@
>  EFIerrno = RETURN_INVALID_PARAMETER;
>  return -1;// Looks like a bad File Descriptor pointer
>}
> +  // Stream and filp look OK, so continue.
> +  // Flush the I/O buffers
> +  (void) da_ConFlush(filp);
> +
> +  // Break the connection to IIO
> +  filp->devdata = NULL;
> +
>gMD->StdIo[Stream->InstanceNum] = NULL;   // Mark the stream as closed
>return 0;
>  }
> @@ -188,10 +256,10 @@
>  by da_ConWrite are WIDE characters.  It is the responsibility of the
>  higher-level function(s)

Re: [edk2] [PATCH] StdLib: Clarify and improve comments.

2016-01-04 Thread Bjorge, Erik C
Please also note in the comments for the commits where you fixed indentation 
issues.

Reviewed-by: Erik Bjorge 

> -Original Message-
> From: Daryl McDaniel [mailto:edk2-li...@mc2research.org]
> Sent: Sunday, January 3, 2016 2:51 PM
> To: edk2-devel@lists.01.org; Carsey, Jaben ; Bjorge, 
> Erik C
> 
> Subject: [PATCH] StdLib: Clarify and improve comments.
> 
> StdLib: Clarify and improve comments.
> 
> LibC/Locale/multibyte_Utf8.c
> LibC/Uefi/SysCalls.c
>   Clarify and improve comments.
> 
> Include/sys/termios.h
>   Add parameter names to function prototypes as referenced in the comments.
> 
> StdLibPrivateInternalFiles\Include\kfile.h
>   Add comment for the fo_close fileop.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Daryl McDaniel 
> 
> ---
>   .../StdLib/LibC/Locale/multibyte_Utf8.c |  20 +++-
>   .../StdLib/LibC/Uefi/SysCalls.c | 127 +++--
>   .../StdLib/Include/sys/termios.h|  11 ++-
>   .../StdLibPrivateInternalFiles\Include\kfile.h  |  11 +--
>   4 files changed, 95 insertions(+), 74 deletions(-)
> 
> diff U3 a/StdLib/LibC/Locale/multibyte_Utf8.c 
> b/StdLib/LibC/Locale/multibyte_Utf8.c
> --- a/StdLib/LibC/Locale/multibyte_Utf8.c Tue May 14 17:59:11 2013
> +++ b/StdLib/LibC/Locale/multibyte_Utf8.c Sun Jan 03 12:45:02 2016
> @@ -1,4 +1,5 @@
>  /** @file
> +  Copyright (c) 2016, Daryl McDaniel. All rights reserved.
>Copyright (c) 2012, Intel Corporation. All rights reserved.
>This program and the accompanying materials
>are licensed and made available under the terms and conditions of the BSD 
> License
> @@ -16,7 +17,7 @@
>  #include  
>  #include  
> 
> -typedef  int  ch_UCS4;
> +typedef int  ch_UCS4;
> 
>  static  mbstate_t LocalConvState = {0};
> 
> @@ -79,7 +80,7 @@
>  // We are in an invalid state
>  ps->A = 0;// Initial State
>}
> -  ps->C[ps->A] = ch;  // Save the current character
> +  ps->C[ps->A] = ch;  // Save the current byte
>Mask = utf8_code_length[ch];
> 
>if(ps->A == 0) {// Initial State.  First byte of sequence.
> @@ -89,7 +90,7 @@
>case 0:   // State 0, Code 0
>  errno = EILSEQ;
>  RetVal = -1;
> -ps->E = 1;// Consume this character
> +ps->E = 1;// Consume this byte
>  break;
>case 1:   // State 0, Code 1
>  // ASCII-7 Character
> @@ -116,7 +117,7 @@
>  ps->A = 0;  // Next state is State-0
>  RetVal = 2;
>}
> -  else {// This isn't the last character, get more.  State 1, 
> Code 3 or 4
> +  else {// This isn't the last byte, get more.  State 1, Code 3 
> or 4
>  ps->A = 2;
>  RetVal = -2;
>}
> @@ -158,12 +159,12 @@
>  errno = EILSEQ;
>  ps->A = 0;
>  RetVal = -1;
> -ps->E = 4;  // Can't happen, but consume this character 
> anyway
> +ps->E = 4;  // Can't happen, but consume this byte anyway
>}
>break;
>}
>  }
> -else {// Invalid surrogate character
> +else {// Invalid surrogate byte
>errno = EILSEQ;
>ps->A = 0;  // Next is State-0
>RetVal = -1;
> @@ -287,7 +288,8 @@
> 
>  @param[in]Src   Pointer to a wide character string.
>  @param[in]Limit Maximum number of bytes the converted string may 
> occupy.
> -@param[out]   NumChar   Pointer to where to store the number of wide 
> characters, or
> NULL.
> +@param[out]   NumChar   Pointer to where to store the number of wide 
> characters
> +consumed, or NULL.
> 
>  @return The number of bytes required to convert Src to MBCS,
>  not including the terminating NUL.  If NumChar is not NULL, 
> the number
> @@ -961,8 +963,8 @@
>  @return   If a wide character is encountered that does not correspond to 
> a
>valid multibyte character, the wcstombs function returns
>(size_t)(-1). Otherwise, the wcstombs function returns the 
> number
> -  of bytes modified, not including a terminating null character,
> -  if any.
> +  of bytes in the resulting multibyte character sequence,
> +  not including the terminating null character (if any).
> 
>  Declared in: stdlib.h
>  **/
> diff U3 a/StdL

Re: [edk2] [PATCH] Python: Clean up and document how to escape the -# option.

2016-01-04 Thread Bjorge, Erik C
Reviewed-by: Erik Bjorge 

> -Original Message-
> From: Daryl McDaniel [mailto:edk2-li...@mc2research.org]
> Sent: Sunday, January 3, 2016 4:07 PM
> To: edk2-devel@lists.01.org; Carsey, Jaben ; Bjorge, 
> Erik C
> 
> Subject: [PATCH] Python: Clean up and document how to escape the -# option.
> 
> AppPkg/.../Python: Clean up and document how to escape the -# option.
> 
> Depending upon the version of Shell you are using, it may be necessary
> to escape the '#' character, when using the "-#" command-line option, so that
> the Shell doesn't interpret it as the start of a comment.
> The escape character is '^'.
> Example:
> python -^# -V
> 
> * General updating.
> * Re-format so that no line is longer than 80 char.
> * Add note about escaping the "-#" command-line option.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Daryl McDaniel 
> 
> ---
> diff U3 a/AppPkg/Applications/Python/PythonReadMe.txt
> b/AppPkg/Applications/Python/PythonReadMe.txt
> --- a/AppPkg/Applications/Python/PythonReadMe.txt Fri Oct 25 12:09:26 2013
> +++ b/AppPkg/Applications/Python/PythonReadMe.txt Sun Jan 03 15:43:26 2016
> @@ -1,7 +1,8 @@
>  EDK II Python
> -ReadMe
> - Release 1.02
> - 18 Jan. 2013
> +   ReadMe
> +Version 2.7.2
> +Release 1.02
> +18 Jan. 2013
> 
> 
>  1. OVERVIEW
> @@ -25,10 +26,10 @@
>  ==
>3.1 Getting Python
>==
> -  Currently only version 2.7.2 of the CPython distribution is supported.  
> For development
> -  ease, a subset of the Python 2.7.2 distribution has been included in the 
> AppPkg source
> -  tree.  If a full distribution is desired, the Python-2.7.2 directory can 
> be removed or
> -  renamed and the full source code downloaded from
> http://www.python.org/ftp/python/2.7.2/.
> +  For development ease, a subset of the Python 2.7.2 distribution has been
> +  included in the AppPkg source tree.  If a full distribution is desired, the
> +  Python-2.7.2 directory can be removed or renamed and the full source code
> +  downloaded from http://www.python.org/ftp/python/2.7.2/.
> 
>A.  Within your EDK II development tree, extract the Python distribution 
> into
>  AppPkg/Applications/Python.  This should create the
> @@ -70,7 +71,8 @@
> |- \etc  Configuration files used by libraries.
> |- \tmp  Temporary files created by tmpfile(), 
> etc.
> |- \lib  Root of the libraries tree.
> -   |- \python.27Directory containing the Python library 
> modules.
> +   |- \python.27Directory containing the Python library
> +   |modules.
> |- \lib-dynload  Dynamically loadable Python extensions.
> |- \site-packagesSite-specific packages and modules.
> 
> @@ -81,7 +83,7 @@
>  system as follows:
> 
>* \Efi\Tools receives a copy of Build/AppPkg/DEBUG_VS2005/X64/Python.efi.
> -   ^ ^^
> +   ^ ^^
>  Modify the host path to match the your build type and compiler.
> 
>* The \Efi\StdLib\etc directory is populated from the StdLib/Efi/StdLib/etc
> @@ -94,8 +96,8 @@
>  sitetypes copy_reglinecache genericpath
> 
>* Python C Extension Modules built as dynamically loadable extensions go 
> into
> -the \Efi\StdLib\lib\python.27\lib-dynload directory.  This functionality 
> is not
> -yet implemented.
> +the \Efi\StdLib\lib\python.27\lib-dynload directory.  This functionality 
> is
> +not yet implemented.
> 
> 
>  6. Example: Enabling socket support
> @@ -107,11 +109,48 @@
>  functools, types, os, sys, warnings, cStringIO, StringIO, errno
> 
>5.  build -a X64 -p AppPkg\AppPkg.dsc
> -  6.  copy Build\AppPkg\DEBUG_VS2005\X64\Python.efi to \Efi\Tools on your 
> target system.
> - Modify as needed
> +  6.  copy Build\AppPkg\DEBUG_VS2005\X64\Python.efi to \Efi\Tools on your
> +  target system. Replace "DEBUG_VS2005\X64", in the source path, with
> +  values appropriate for your tool chain and processor architecture.
> +
> +
> +7. Running Python
> +=
> +  Python 

Re: [edk2] [Patch] AppPkg/.../Python-2.7.10: Update pyconfig for Python 2.7.10 compliance.

2015-12-28 Thread Bjorge, Erik C
Reviewed-by: Erik Bjorge 

> -Original Message-
> From: Daryl McDaniel [mailto:edk2-li...@mc2research.org]
> Sent: Sunday, December 27, 2015 4:34 PM
> To: edk2-devel@lists.01.org; Carsey, Jaben ; Bjorge, 
> Erik C
> 
> Subject: [Patch] AppPkg/.../Python-2.7.10: Update pyconfig for Python 2.7.10 
> compliance.
> 
> Jaben or Erik, could you please review the following patch?
> 
> AppPkg/Applications/Python/Python-2.7.10/*/pyconfig.h: Update pyconfig for 
> Python 2.7.10
> compliance.
> 
> Add new constants required for Python 2.7.10.
> Update package and help values.
> Define networking constants so that the getaddrinfo, gethostbyname, and
> getnameinfo functions are used from the sockets package.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Daryl McDaniel 
> 
> ---
>  .../Python/Python-2.7.10/Ia32/pyconfig.h | 18 +-
>  .../Python/Python-2.7.10/X64/pyconfig.h  | 89 +++--
>  2 files changed, 73 insertions(+), 34 deletions(-)
> 
> diff C3 a/AppPkg/Applications/Python/Python-2.7.10/Ia32/pyconfig.h
> b/AppPkg/Applications/Python/Python-2.7.10/Ia32/pyconfig.h
> *** a/AppPkg/Applications/Python/Python-2.7.10/Ia32/pyconfig.h Tue Dec 22 
> 16:15:45 2015
> --- b/AppPkg/Applications/Python/Python-2.7.10/Ia32/pyconfig.h Sun Dec 27 
> 15:07:14 2015
> ***
> *** 289,295 
>   #endif
> 
>   /* Define if you have the getaddrinfo function. */
> ! #undef HAVE_GETADDRINFO
> 
>   /* Define to 1 if you have the 'getcwd' function. */
>   #define HAVE_GETCWD   1
> --- 289,296 
>   #endif
> 
>   /* Define if you have the getaddrinfo function. */
> ! //#undef HAVE_GETADDRINFO
> ! #define HAVE_GETADDRINFO  1
> 
>   /* Define to 1 if you have the 'getcwd' function. */
>   #define HAVE_GETCWD   1
> ***
> *** 304,310 
>   #undef HAVE_GETGROUPS
> 
>   /* Define to 1 if you have the 'gethostbyname' function. */
> ! #undef HAVE_GETHOSTBYNAME
> 
>   /* Define this if you have some version of gethostbyname_r() */
>   #undef HAVE_GETHOSTBYNAME_R
> --- 305,312 
>   #undef HAVE_GETGROUPS
> 
>   /* Define to 1 if you have the 'gethostbyname' function. */
> ! //#undef HAVE_GETHOSTBYNAME
> ! #define HAVE_GETHOSTBYNAME  1
> 
>   /* Define this if you have some version of gethostbyname_r() */
>   #undef HAVE_GETHOSTBYNAME_R
> ***
> *** 328,334 
>   #undef HAVE_GETLOGIN
> 
>   /* Define to 1 if you have the 'getnameinfo' function. */
> ! #undef HAVE_GETNAMEINFO
> 
>   /* Define if you have the 'getpagesize' function. */
>   #undef HAVE_GETPAGESIZE
> --- 330,337 
>   #undef HAVE_GETLOGIN
> 
>   /* Define to 1 if you have the 'getnameinfo' function. */
> ! //#undef HAVE_GETNAMEINFO
> ! #define HAVE_GETNAMEINFO 1
> 
>   /* Define if you have the 'getpagesize' function. */
>   #undef HAVE_GETPAGESIZE
> diff C3 a/AppPkg/Applications/Python/X64/pyconfig.h
> b/AppPkg/Applications/Python/X64/pyconfig.h
> *** a/AppPkg/Applications/Python/X64/pyconfig.h  Tue Nov 03 10:58:06 2015
> --- b/AppPkg/Applications/Python/X64/pyconfig.h  Sun Dec 27 15:11:17 2015
> ***
> *** 1,6 
> --- 1,7 
>   /** @file
>   Manually generated Python Configuration file for EDK II.
> 
> + Copyright (c) 2015, Daryl McDaniel. All rights reserved.
>   Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.
>   This program and the accompanying materials are licensed and made 
> available under
>   the terms and conditions of the BSD License that accompanies this 
> distribution.
> ***
> *** 67,72 
> --- 68,76 
>   /* Define to 1 if you have the 'alarm' function. */
>   #undef HAVE_ALARM
> 
> + /* Define to 1 if you have the  header file. */
> + #undef HAVE_ALLOCA_H
> +
>   /* Define this if your time.h defines altzone. */
>   #undef HAVE_ALTZONE
> 
> ***
> *** 109,114 
> --- 113,121 
>   /* define to 1 if your sem_getvalue is broken. */
>   #define HAVE_BROKEN_SEM_GETVALUE  1
> 
> + /* Define if 'unsetenv' does not return an int. */
> + #undef HAVE_BROKEN_UNSETENV
> +
>   /* Define this if you have the type _Bool. */
>   #define HAVE_C99_BOOL 1
> 
> ***
> *** 170,179 
>   /* Define to 1 if you have the device macros. */
>   #undef HAVE_DEVICE_MACROS
> 
> ! /* Define if we have /dev/ptc. */
>   #undef HAVE_DEV_PTC
> 
> ! /* Define if we have /dev/ptmx. */
>   #undef HAVE_DEV_PTMX
> 
>   /* Define to 1 if you have the  header file. */
> --- 177,186 -

Re: [edk2] Git transition for EDK2

2015-12-03 Thread Bjorge, Erik C
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Jordan 
> Justen
> Sent: Thursday, December 3, 2015 4:37 PM
> To: Laszlo Ersek ; Jarlstrom, Laurie 
> 
> Cc: edk2-devel@lists.01.org
> Subject: Re: [edk2] Git transition for EDK2
> 
> On 2015-12-03 15:41:22, Laszlo Ersek wrote:
> > On 12/03/15 21:05, Jarlstrom, Laurie wrote:
> > > To: EDK2 Community
> > >
> > > This message is to notify you that near the end of January 2016 the
> > > active repository for EDK2 development will switch from using
> > > SourceForge to GitHub. The repository found at SourceForge will
> > > continue to be a read-only mirror of the master branch on GitHub.
> > >
> > > A number of reasons have prompted us to switch to git most notably
> > > the communities request for us to make this change. Other reasons
> > > include the ability to have better commit logs and the use of
> > > branching to aid in reviewing larger changes and the addition of new
> > > features.
> > >
> > > As part of this change a number of process changes will be adopted to
> > > support better use of git. This includes the method for sending out
> > > patches for review and other minor changes. Information regarding
> > > these changes will be found on http://tianocore.org  in the following
> > > weeks. In addition to the process changes documentation for users new
> > > to git will also be provided.
> > >
> > > Please post any comments or questions related to this transition to
> > > the Edk2-devel mailing list or reply to the email message
> > >
> > > Thanks, Tianocore.org Administration
> >
> > Great news!
> >
> > I'd like to ask for confirmation in two points:
> >
> > (1) that the git repo will remain a unified one (I think this has been
> > made possible by the BaseTools support for external packages);
> 
> I can confirm that it will remain unified. In fact, I plan to delete
> the separate package based repos on github soon.
> 
> > (2) that a purely email based setup will remain fully functional for
> > participation (posting and reviewing), regardless of whether additional
> > web based utilities will be developed.
> 

The email review process will continue as is.  We may discuss the addition of 
other tools in the future if the community feels they would be valuable.

Thanks,
-Erik

> I agree with this. I have also expressed that I would like email based
> code reviewed to remain fully supported.
> 
> I think some people want to investigate gerrit at some point, and I
> don't know how that would be implemented. I hope it would not mean
> that patches will be posted in gerrit, and no notice will appear on
> the email list.
> 
> I strongly doubt that gerrit will be set up at the initial git
> cut-over point, so at least initially email patches will be the only
> option.
> 
> -Jordan
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 3/3] AppPkg/Python-2.7.10/edk2module.c: Update for Python 2.7.10.

2015-11-13 Thread Bjorge, Erik C
Reviewed-by: Erik Bjorge 

-Original Message-
From: Daryl McDaniel [mailto:edk2-li...@mc2research.org] 
Sent: Friday, November 13, 2015 3:24 PM
To: Bjorge, Erik C ; edk2-devel@lists.01.org; Carsey, 
Jaben 
Subject: RE: [edk2] [PATCH 3/3] AppPkg/Python-2.7.10/edk2module.c: Update for 
Python 2.7.10.

Hi Erik,

The commit message is wrong.
I'll fix it when I do the actual commit.

Daryl McDaniel

-Original Message-
From: Bjorge, Erik C [mailto:erik.c.bjo...@intel.com] 
Sent: Friday, November 13, 2015 2:10 PM
To: Daryl McDaniel ; edk2-devel@lists.01.org; 
Carsey, Jaben 
Subject: RE: [edk2] [PATCH 3/3] AppPkg/Python-2.7.10/edk2module.c: Update for 
Python 2.7.10.

Daryl,

It actually looks like you are adding a two blank lines instead of removing 
them.  Is the commit message wrong?

Thanks,
-Erik

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Daryl 
McDaniel
Sent: Thursday, November 12, 2015 2:53 PM
To: edk2-devel@lists.01.org; Carsey, Jaben ; Bjorge, 
Erik C 
Subject: [edk2] [PATCH 3/3] AppPkg/Python-2.7.10/edk2module.c: Update for 
Python 2.7.10.

AppPkg/Python-2.7.10: Update file for Python-2.7.10 inclusion.

Add copyright message.
Remove some redundant blank lines.
Remove a superfluous call to setup_confname_tables(m) from INITFUNC().

Signed-off-by: Daryl McDaniel 
---
 .../Python/Python-2.7.10/PyMod-2.7.10/Modules/edk2module.c | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git 
a/AppPkg/Applications/Python/Python-2.7.10/PyMod-2.7.10/Modules/edk2module.c
b/AppPkg/Applications/Python/Python-2.7.10/PyMod-2.7.10/Modules/edk2module.c
index 4cf09ca..42a9aea 100644
--- a/AppPkg/Applications/Python/Python-2.7.10/PyMod-2.7.10/Modules/edk2module.c
+++ b/AppPkg/Applications/Python/Python-2.7.10/PyMod-2.7.10/Modules/edk2module.c
@@ -2,6 +2,7 @@
 OS-specific module implementation for EDK II and UEFI.
 Derived from posixmodule.c in Python 2.7.2.

+Copyright (c) 2015, Daryl McDaniel. All rights reserved.
 Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.
 This program and the accompanying materials are licensed and made 
available under
 the terms and conditions of the BSD License that accompanies this 
distribution.
@@ -2248,6 +2249,7 @@ edk2_getpid(PyObject *self, PyObject *noargs)
 return PyLong_FromPid(getpid());
 }

+
 #ifdef HAVE_GETLOGIN
 PyDoc_STRVAR(edk2_getlogin__doc__,
 "getlogin() -> string\n\n\
@@ -2340,7 +2342,6 @@ PyDoc_STRVAR(edk2_popen__doc__,
 "popen(command [, mode='r' [, bufsize]]) -> pipe\n\n\
 Open a pipe to/from a command returning a file object.");

-/* standard posix version of popen() support */
 static PyObject *
 edk2_popen(PyObject *self, PyObject *args)
 {
@@ -2369,6 +2370,7 @@ edk2_popen(PyObject *self, PyObject *args)

 #endif /* HAVE_POPEN */

+
 #if defined(HAVE_WAIT3) || defined(HAVE_WAIT4)
 static PyObject *
 wait_helper(pid_t pid, int status, struct rusage *ru)
@@ -4187,9 +4189,6 @@ INITFUNC(void)
 if (all_ins(m))
 return;

-if (setup_confname_tables(m))
-return;
-
 Py_INCREF(PyExc_OSError);
 PyModule_AddObject(m, "error", PyExc_OSError);

--
1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 3/3] AppPkg/Python-2.7.10/edk2module.c: Update for Python 2.7.10.

2015-11-13 Thread Bjorge, Erik C
Daryl,

It actually looks like you are adding a two blank lines instead of removing 
them.  Is the commit message wrong?

Thanks,
-Erik

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Daryl 
McDaniel
Sent: Thursday, November 12, 2015 2:53 PM
To: edk2-devel@lists.01.org; Carsey, Jaben ; Bjorge, 
Erik C 
Subject: [edk2] [PATCH 3/3] AppPkg/Python-2.7.10/edk2module.c: Update for 
Python 2.7.10.

AppPkg/Python-2.7.10: Update file for Python-2.7.10 inclusion.

Add copyright message.
Remove some redundant blank lines.
Remove a superfluous call to setup_confname_tables(m) from INITFUNC().

Signed-off-by: Daryl McDaniel 
---
 .../Python/Python-2.7.10/PyMod-2.7.10/Modules/edk2module.c | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git 
a/AppPkg/Applications/Python/Python-2.7.10/PyMod-2.7.10/Modules/edk2module.c 
b/AppPkg/Applications/Python/Python-2.7.10/PyMod-2.7.10/Modules/edk2module.c
index 4cf09ca..42a9aea 100644
--- a/AppPkg/Applications/Python/Python-2.7.10/PyMod-2.7.10/Modules/edk2module.c
+++ b/AppPkg/Applications/Python/Python-2.7.10/PyMod-2.7.10/Modules/edk2module.c
@@ -2,6 +2,7 @@
 OS-specific module implementation for EDK II and UEFI.
 Derived from posixmodule.c in Python 2.7.2.

+Copyright (c) 2015, Daryl McDaniel. All rights reserved.
 Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.
 This program and the accompanying materials are licensed and made 
available under
 the terms and conditions of the BSD License that accompanies this 
distribution.
@@ -2248,6 +2249,7 @@ edk2_getpid(PyObject *self, PyObject *noargs)
 return PyLong_FromPid(getpid());
 }

+
 #ifdef HAVE_GETLOGIN
 PyDoc_STRVAR(edk2_getlogin__doc__,
 "getlogin() -> string\n\n\
@@ -2340,7 +2342,6 @@ PyDoc_STRVAR(edk2_popen__doc__,
 "popen(command [, mode='r' [, bufsize]]) -> pipe\n\n\
 Open a pipe to/from a command returning a file object.");

-/* standard posix version of popen() support */
 static PyObject *
 edk2_popen(PyObject *self, PyObject *args)
 {
@@ -2369,6 +2370,7 @@ edk2_popen(PyObject *self, PyObject *args)

 #endif /* HAVE_POPEN */

+
 #if defined(HAVE_WAIT3) || defined(HAVE_WAIT4)
 static PyObject *
 wait_helper(pid_t pid, int status, struct rusage *ru)
@@ -4187,9 +4189,6 @@ INITFUNC(void)
 if (all_ins(m))
 return;

-if (setup_confname_tables(m))
-return;
-
 Py_INCREF(PyExc_OSError);
 PyModule_AddObject(m, "error", PyExc_OSError);

--
1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 2/3] AppPkg/Python-2.7.10/edk2module.c: Rename posix_ to edk2_.

2015-11-13 Thread Bjorge, Erik C
Reviewed-by: Erik Bjorge 

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Daryl 
McDaniel
Sent: Thursday, November 12, 2015 2:53 PM
To: edk2-devel@lists.01.org; Carsey, Jaben ; Bjorge, 
Erik C 
Subject: [edk2] [PATCH 2/3] AppPkg/Python-2.7.10/edk2module.c: Rename posix_ to 
edk2_.

AppPkg/Python-2.7.10: Rename identifiers beginning with "posix_" to "edk2_".

Rename identifiers to have an edk2_ prefix instead of posix_ in order to
conform to the convention used in other environment-specific Python modules.
This also makes the names match the module instead of implying that these are
Posix compatible routines.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daryl McDaniel 
---
 .../PyMod-2.7.10/Modules/edk2module.c  | 794 ++---
 1 file changed, 397 insertions(+), 397 deletions(-)

diff --git 
a/AppPkg/Applications/Python/Python-2.7.10/PyMod-2.7.10/Modules/edk2module.c 
b/AppPkg/Applications/Python/Python-2.7.10/PyMod-2.7.10/Modules/edk2module.c
index d9d4916..4cf09ca 100644
--- a/AppPkg/Applications/Python/Python-2.7.10/PyMod-2.7.10/Modules/edk2module.c
+++ b/AppPkg/Applications/Python/Python-2.7.10/PyMod-2.7.10/Modules/edk2module.c
@@ -201,19 +201,19 @@ convertenviron(void)
 /* Set a POSIX-specific error from errno, and return NULL */

 static PyObject *
-posix_error(void)
+edk2_error(void)
 {
 return PyErr_SetFromErrno(PyExc_OSError);
 }
 static PyObject *
-posix_error_with_filename(char* name)
+edk2_error_with_filename(char* name)
 {
 return PyErr_SetFromErrnoWithFilename(PyExc_OSError, name);
 }


 static PyObject *
-posix_error_with_allocated_filename(char* name)
+edk2_error_with_allocated_filename(char* name)
 {
 PyObject *rc = PyErr_SetFromErrnoWithFilename(PyExc_OSError, name);
 PyMem_Free(name);
@@ -224,7 +224,7 @@ posix_error_with_allocated_filename(char* name)

 #ifndef UEFI_C_SOURCE
   static PyObject *
-  posix_fildes(PyObject *fdobj, int (*func)(int))
+  edk2_fildes(PyObject *fdobj, int (*func)(int))
   {
   int fd;
   int res;
@@ -232,19 +232,19 @@ posix_error_with_allocated_filename(char* name)
   if (fd < 0)
   return NULL;
   if (!_PyVerify_fd(fd))
-  return posix_error();
+  return edk2_error();
   Py_BEGIN_ALLOW_THREADS
   res = (*func)(fd);
   Py_END_ALLOW_THREADS
   if (res < 0)
-  return posix_error();
+  return edk2_error();
   Py_INCREF(Py_None);
   return Py_None;
   }
 #endif  /* UEFI_C_SOURCE */

 static PyObject *
-posix_1str(PyObject *args, char *format, int (*func)(const char*))
+edk2_1str(PyObject *args, char *format, int (*func)(const char*))
 {
 char *path1 = NULL;
 int res;
@@ -255,14 +255,14 @@ posix_1str(PyObject *args, char *format, int 
(*func)(const char*))
 res = (*func)(path1);
 Py_END_ALLOW_THREADS
 if (res < 0)
-return posix_error_with_allocated_filename(path1);
+return edk2_error_with_allocated_filename(path1);
 PyMem_Free(path1);
 Py_INCREF(Py_None);
 return Py_None;
 }

 static PyObject *
-posix_2str(PyObject *args,
+edk2_2str(PyObject *args,
char *format,
int (*func)(const char *, const char *))
 {
@@ -279,7 +279,7 @@ posix_2str(PyObject *args,
 PyMem_Free(path2);
 if (res != 0)
 /* XXX how to report both path1 and path2??? */
-return posix_error();
+return edk2_error();
 Py_INCREF(Py_None);
 return Py_None;
 }
@@ -486,7 +486,7 @@ fill_time(PyObject *v, int index, time_t sec, unsigned long 
nsec)
 }

 /* pack a system stat C structure into the Python stat tuple
-   (used by posix_stat() and posix_fstat()) */
+   (used by edk2_stat() and edk2_fstat()) */
 static PyObject*
 _pystat_fromstructstat(STRUCT_STAT *st)
 {
@@ -556,7 +556,7 @@ _pystat_fromstructstat(STRUCT_STAT *st)
 }

 static PyObject *
-posix_do_stat(PyObject *self, PyObject *args,
+edk2_do_stat(PyObject *self, PyObject *args,
   char *format,
   int (*statfunc)(const char *, STRUCT_STAT *),
   char *wformat,
@@ -578,7 +578,7 @@ posix_do_stat(PyObject *self, PyObject *args,
 Py_END_ALLOW_THREADS

 if (res != 0) {
-result = posix_error_with_filename(pathfree);
+result = edk2_error_with_filename(pathfree);
 }
 else
 result = _pystat_fromstructstat(&st);
@@ -589,7 +589,7 @@ posix_do_stat(PyObject *self, PyObject *args,

 /* POSIX methods */

-PyDoc_STRVAR(posix_access__doc__,
+PyDoc_STRVAR(edk2_access__doc__,
 "access(path, mode) -> True if granted, False otherwise\n\n\
 Use the real uid/gid to test for access to a path.  Note that most\n\
 operations will use the effective uid/gid, therefore this routine can\n\
@@ -598,7 +598,7 @@ specified access to the path.  The mode argument can be 
F_OK to test\n\
 existence, or the inclusive-OR of R_OK, W_OK, and X_OK.");

 static PyO

Re: [edk2] [PATCH 4/4] AppPkg/Python-2.7.10: AppPkg.dsc, pyconfig.h, PyMod-2.7.10 (resend)

2015-11-09 Thread Bjorge, Erik C
Reviewed-by: Erik Bjorge 

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Daryl 
McDaniel
Sent: Saturday, November 7, 2015 11:46 AM
To: edk2-devel@lists.01.org; Carsey, Jaben ; Bjorge, 
Erik C 
Subject: [edk2] [PATCH 4/4] AppPkg/Python-2.7.10: AppPkg.dsc, pyconfig.h, 
PyMod-2.7.10 (resend)

Resent using git send-email.  Maybe this will be easier to use.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daryl McDaniel 
---
 AppPkg/AppPkg.dsc  |   5 +-
 .../Python/Python-2.7.10/Ia32/pyconfig.h   |  93 
 .../Python-2.7.10/PyMod-2.7.10/Lib/ntpath.py   |  30 +++-
 .../Python/Python-2.7.10/PyMod-2.7.10/Lib/os.py|  35 -
 .../Python/Python-2.7.10/PyMod-2.7.10/Lib/pydoc.py |  17 +++
 .../Python/Python-2.7.10/PyMod-2.7.10/Lib/site.py  | 165 ++---
 .../Python-2.7.10/PyMod-2.7.10/Modules/_sre.c  | 150 ++-
 .../Python-2.7.10/PyMod-2.7.10/Modules/addrinfo.h  | 101 +++--
 .../PyMod-2.7.10/Modules/errnomodule.c |  57 ++-
 .../PyMod-2.7.10/Modules/expat/expat_external.h|   4 +-
 .../Python-2.7.10/PyMod-2.7.10/Modules/getpath.c   | 143 +-
 .../Python-2.7.10/PyMod-2.7.10/Modules/main.c  |  61 
 .../PyMod-2.7.10/Modules/selectmodule.c|  43 --
 .../PyMod-2.7.10/Modules/zlib/gzguts.h |  10 +-
 .../PyMod-2.7.10/Modules/zlib/zutil.h  |  11 +-
 .../PyMod-2.7.10/Objects/longobject.c  |  14 +-
 .../PyMod-2.7.10/Objects/stringlib/localeutil.h|  17 ++-
 .../PyMod-2.7.10/Python/getcopyright.c |  24 ++-
 .../Python-2.7.10/PyMod-2.7.10/Python/marshal.c|  21 ++-
 .../Python-2.7.10/PyMod-2.7.10/Python/random.c |  32 +++-
 .../Python/Python-2.7.10/X64/pyconfig.h|  63 ++--
 21 files changed, 640 insertions(+), 456 deletions(-)

diff --git a/AppPkg/AppPkg.dsc b/AppPkg/AppPkg.dsc
index 6db32a1..58bc84e 100644
--- a/AppPkg/AppPkg.dsc
+++ b/AppPkg/AppPkg.dsc
@@ -126,9 +126,12 @@
   gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80400040
   }

- Un-comment the following line to build Python.
+ Un-comment the following line to build Python 2.7.2.
 #  AppPkg/Applications/Python/PythonCore.inf

+ Un-comment the following line to build Python 2.7.10.
+# AppPkg/Applications/Python/Python-2.7.10/Python2710.inf
+
  Un-comment the following line to build Lua.
 #  AppPkg/Applications/Lua/Lua.inf

diff --git a/AppPkg/Applications/Python/Python-2.7.10/Ia32/pyconfig.h 
b/AppPkg/Applications/Python/Python-2.7.10/Ia32/pyconfig.h
index 99b3422..00cfd54 100644
--- a/AppPkg/Applications/Python/Python-2.7.10/Ia32/pyconfig.h
+++ b/AppPkg/Applications/Python/Python-2.7.10/Ia32/pyconfig.h
@@ -1,6 +1,7 @@
 /** @file
 Manually generated Python Configuration file for EDK II.

+Copyright (c) 2015, Daryl McDaniel. All rights reserved.
 Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.
 This program and the accompanying materials are licensed and made 
available under
 the terms and conditions of the BSD License that accompanies this 
distribution.
@@ -67,6 +68,9 @@
 /* Define to 1 if you have the 'alarm' function. */
 #undef HAVE_ALARM

+/* Define to 1 if you have the  header file. */
+#undef HAVE_ALLOCA_H
+
 /* Define this if your time.h defines altzone. */
 #undef HAVE_ALTZONE

@@ -109,6 +113,9 @@
 /* define to 1 if your sem_getvalue is broken. */
 #define HAVE_BROKEN_SEM_GETVALUE  1

+/* Define if 'unsetenv' does not return an int. */
+#undef HAVE_BROKEN_UNSETENV
+
 /* Define this if you have the type _Bool. */
 #define HAVE_C99_BOOL 1

@@ -170,10 +177,10 @@
 /* Define to 1 if you have the device macros. */
 #undef HAVE_DEVICE_MACROS

-/* Define if we have /dev/ptc. */
+/* Define to 1 if you have the /dev/ptc device file. */
 #undef HAVE_DEV_PTC

-/* Define if we have /dev/ptmx. */
+/* Define to 1 if you have the /dev/ptmx device file. */
 #undef HAVE_DEV_PTMX

 /* Define to 1 if you have the  header file. */
@@ -274,11 +281,11 @@
 #undef HAVE_GAMMA

 /* Define if we can use gcc inline assembler to get and set x87 control word
-*/
+   */
 #if defined(__GNUC__)
   #define HAVE_GCC_ASM_FOR_X87  1
 #else
-  #undef HAVE_GCC_ASM_FOR_X87
+#undef HAVE_GCC_ASM_FOR_X87
 #endif

 /* Define if you have the getaddrinfo function. */
@@ -290,6 +297,9 @@
 /* Define this if you have flockfile(), getc_unlocked(), and funlockfile() */
 #undef HAVE_GETC_UNLOCKED

+/* Define to 1 if you have the 'getentropy' function. */
+#undef HAVE_GETENTROPY
+
 /* Define to 1 if you have the 'getgroups' function. */
 #undef HAVE_GETGROUPS

@@ -383,6 +393,12 @@
 /* Define to 1 if you have the 'initgroups' function. */
 #undef HAVE_INITGROUPS

+/* Define if your compiler provides int32_t. */
+#undef HAVE_INT32_T
+
+/* Define if your compiler provides int64_t

Re: [edk2] [Patch 2/4] AppPkg/Python-2.7.10: New helper scripts

2015-11-06 Thread Bjorge, Erik C
Reviewed-by: Erik Bjorge 

From: Daryl McDaniel [mailto:edk2-li...@mc2research.org]
Sent: Thursday, November 5, 2015 2:32 PM
To: edk2-devel@lists.01.org; Carsey, Jaben ; Bjorge, 
Erik C 
Subject: [Patch 2/4] AppPkg/Python-2.7.10: New helper scripts

AppPkg/Python-2.7.10: Patch 2 of 4 -- New helper scripts

New files libprep.bat and srcprep.bat are included here in their entirety,
along with their diffs.  The whole files are located between the " BEGIN" 
and
" END" lines with the diffs following.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daryl McDaniel 
mailto:edk2-li...@mc2research.org>>

 BEGIN CUT HERE -
@echo off
REM libprep.bat
REM
REM SYNTAX: libprep 
REM
SETLOCAL

set dest=%1

echo Copying files to %dest%.
echo Existing files will be overwritten.
echo.
PAUSE

REM Copy Distro then PyMod files to the destination
XCOPY Lib %dest% /S /I /Y
XCOPY PyMod-2.7.10\Lib %dest% /S /I /Y

echo DONE
ENDLOCAL
 END   CUT HERE -

 BEGIN CUT HERE -
@echo off
REM Prepare the Python sources for EDK II by copying
REM the .h files from the PyMod tree into the Python tree.
REM Directory correspondence is maintained.

FOR %%d IN (Include Modules Objects Python) DO (
  echo.
  echo Processing the %%d directory.
  XCOPY /S /Y /Q PyMod-2.7.10\%%d\*.h %%d
)

echo.
echo DONE!
 END   CUT HERE -


diff --git a/AppPkg/Applications/Python/Python-2.7.10/libprep.bat 
b/AppPkg/Applications/Python/Python-2.7.10/libprep.bat
new file mode 100644
index 000..b623b4b
--- /dev/null
+++ b/AppPkg/Applications/Python/Python-2.7.10/libprep.bat
@@ -0,0 +1,20 @@
+@echo off
+REM libprep.bat
+REM
+REM SYNTAX: libprep 
+REM
+SETLOCAL
+
+set dest=%1
+
+echo Copying files to %dest%.
+echo Existing files will be overwritten.
+echo.
+PAUSE
+
+REM Copy Distro then PyMod files to the destination
+XCOPY Lib %dest% /S /I /Y
+XCOPY PyMod-2.7.10\Lib %dest% /S /I /Y
+
+echo DONE
+ENDLOCAL
diff --git a/AppPkg/Applications/Python/Python-2.7.10/srcprep.bat 
b/AppPkg/Applications/Python/Python-2.7.10/srcprep.bat
new file mode 100644
index 000..d7a5823
--- /dev/null
+++ b/AppPkg/Applications/Python/Python-2.7.10/srcprep.bat
@@ -0,0 +1,13 @@
+@echo off
+REM Prepare the Python sources for EDK II by copying
+REM the .h files from the PyMod tree into the Python tree.
+REM Directory correspondence is maintained.
+
+FOR %%d IN (Include Modules Objects Python) DO (
+ echo.
+ echo Processing the %%d directory.
+ XCOPY /S /Y /Q PyMod-2.7.10\%%d\*.h %%d
+)
+
+echo.
+echo DONE!

END OF PATCH 2 of 4

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch 1/4] AppPkg/Python-2.7.10: ReadMe and .inf files

2015-11-06 Thread Bjorge, Erik C
Reviewed-by: Erik Bjorge 

-Original Message-
From: Daryl McDaniel [mailto:edk2-li...@mc2research.org] 
Sent: Thursday, November 5, 2015 2:31 PM
To: edk2-devel@lists.01.org; Carsey, Jaben ; Bjorge, 
Erik C 
Subject: [Patch 1/4] AppPkg/Python-2.7.10: ReadMe and .inf files

AppPkg/Python-2.7.10: Patch 1 of 4 -- ReadMe and .inf files

Files Py2710ReadMe.txt and Python2710.inf are included here in their
entirety,
along with their diffs.  The whole files are located between the "
BEGIN" and
" END" lines with the diffs following.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daryl McDaniel 

 BEGIN CUT HERE -
EDK II Python
   ReadMe
Version 2.7.10
 Release 1.00
  3 Nov. 2015


1. OVERVIEW
===
This document is devoted to general information on building and setup of the
Python environment for UEFI, the invocation of the interpreter, and things
that make working with Python easier.

It is assumed that you already have UDK2010 or later, or a current snapshot
of
the EDK II sources from www.tianocore.org, and that you can successfully
build
packages within that distribution.

2. Release Notes

  1)  All C extension modules must be statically linked (built in)
  2)  The site and os modules must exist as discrete files in
...\lib\python27.10
  3)  User-specific configurations are not supported.
  4)  Environment variables are not supported.

3. Getting and Building Python
==
  3.1 Getting Python
  ==
  This file describes the UEFI port of version 2.7.10 of the CPython
distribution.
  For development ease, a subset of the Python 2.7.10 distribution has been
  included as part of the AppPkg/Applications/Python/Python-2.7.10 source
tree.
  If this is sufficient, you may skip to section 3.2, Building Python.

  If a full distribution is desired, it can be merged into the Python-2.7.10
  source tree.  Directory AppPkg/Applications/Python/Python-2.7.10
corresponds
  to the root directory of the CPython 2.7.10 distribution.  The full
  CPython 2.7.10 source code may be downloaded from
  http://www.python.org/ftp/python/2.7.10/.

  A.  Within your EDK II development tree, extract the Python distribution
into
AppPkg/Applications/Python/Python-2.7.10.  This should merge the
additional
files into the source tree.  It will also create the following
directories:
Demo  Doc Grammar Mac   Misc
PCPCbuild RISCOS  Tools

The greatest change will be within the Python-2.7.10/Lib directory where
many more packages and modules will be added.  These additional
components
may not have been ported to EDK II yet.

  3.2 Building Python
  ===
  B.  From the AppPkg/Applications/Python/Python-2.7.10 directory, execute
the
srcprep.bat (srcprep.sh) script to copy the header files from within the
PyMod-2.7.10 sub-tree into their corresponding directories within the
distribution.  This step only needs to be performed prior to the first
build of Python, or if one of the header files within the PyMod tree has
been
modified.

  A.  Edit PyMod-2.7.10\Modules\config.c to enable the built-in modules you
need.  By default,
it is configured for the minimally required set of modules.
Mandatory Built-in Modules:
edk2  errno   imp marshal

  Additional built-in modules which are required to use the help()
  functionality provided by PyDoc, are:
_codecs _collections_functools_random
_sre_struct _weakref  binascii
cStringIO   gc  itertools math
operatortime

  B.  Edit AppPkg/AppPkg.dsc to enable (uncomment) the Python2710.inf line
within the [Components] section.

  C.  Build AppPkg using the standard "build" command:
For example, to build Python for an X64 CPU architecture:
build -a X64 -p AppPkg\AppPkg.dsc

4. Python-related paths and files
=
Python depends upon the existence of several directories and files on the
target system.

  \EFI  Root of the UEFI system area.
   |- \ToolsLocation of the Python.efi executable.
   |- \Boot UEFI specified Boot directory.
   |- \StdLib   Root of the Standard Libraries sub-tree.
   |- \etc  Configuration files used by libraries.
   |- \tmp  Temporary files created by tmpfile(),
etc.
   |- \lib  Root of the libraries tree.
   |- \python27.10  Directory containing the Python library
m

Re: [edk2] [Patch v2 1/1] AppPkg/Python remove improper characters from pyconfig.h

2015-11-03 Thread Bjorge, Erik C
Reviewed-by: Erik Bjorge 

-Original Message-
From: Daryl McDaniel [mailto:edk2-li...@mc2research.org] 
Sent: Tuesday, November 3, 2015 10:37 AM
To: edk2-devel@lists.01.org; Carsey, Jaben ; Bjorge, 
Erik C ; Rosenbaum, Lee G 
Subject: [Patch v2 1/1] AppPkg/Python remove improper characters from pyconfig.h

AppPkg: Within the Ia32 and X64 pyconfig.h files, there are 178 occurrences
of an accent character, `, being used instead of a regular single quote, ',
within comments.

Replace all occurrences of ` within comments with '.  Example:
OLD:  `foobar'
NEW: 'foobar'

The same changes are applied to both
AppPkg/Applications/Python/Ia32/pyconfig.h and
AppPkg/Applications/Python/X64/pyconfig.h.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daryl McDaniel 


*** a/AppPkg/Applications/Python/X64/pyconfig.h-revBASE.svn001.tmp.hFri
Mar 23 17:19:06 2012
--- b/AppPkg/Applications/Python/X64/pyconfig.h Tue Oct 20 12:43:43 2015
***
*** 58,88 
 the case on Motorola V4 (R40V4.2) */
  #undef GETTIMEOFDAY_NO_TZ
  
! /* Define to 1 if you have the `acosh' function. */
  #undef HAVE_ACOSH
  
  /* struct addrinfo (netdb.h) */
  #undef HAVE_ADDRINFO
  
! /* Define to 1 if you have the `alarm' function. */
  #undef HAVE_ALARM
  
  /* Define this if your time.h defines altzone. */
  #undef HAVE_ALTZONE
  
! /* Define to 1 if you have the `asinh' function. */
  #undef HAVE_ASINH
  
  /* Define to 1 if you have the  header file. */
  #undef HAVE_ASM_TYPES_H
  
! /* Define to 1 if you have the `atanh' function. */
  #undef HAVE_ATANH
  
  /* Define if GCC supports __attribute__((format(PyArg_ParseTuple, 2, 3)))
*/
  #undef HAVE_ATTRIBUTE_FORMAT_PARSETUPLE
  
! /* Define to 1 if you have the `bind_textdomain_codeset' function. */
  #undef HAVE_BIND_TEXTDOMAIN_CODESET
  
  /* Define to 1 if you have the  header file. */
--- 58,88 
 the case on Motorola V4 (R40V4.2) */
  #undef GETTIMEOFDAY_NO_TZ
  
! /* Define to 1 if you have the 'acosh' function. */
  #undef HAVE_ACOSH
  
  /* struct addrinfo (netdb.h) */
  #undef HAVE_ADDRINFO
  
! /* Define to 1 if you have the 'alarm' function. */
  #undef HAVE_ALARM
  
  /* Define this if your time.h defines altzone. */
  #undef HAVE_ALTZONE
  
! /* Define to 1 if you have the 'asinh' function. */
  #undef HAVE_ASINH
  
  /* Define to 1 if you have the  header file. */
  #undef HAVE_ASM_TYPES_H
  
! /* Define to 1 if you have the 'atanh' function. */
  #undef HAVE_ATANH
  
  /* Define if GCC supports __attribute__((format(PyArg_ParseTuple, 2, 3)))
*/
  #undef HAVE_ATTRIBUTE_FORMAT_PARSETUPLE
  
! /* Define to 1 if you have the 'bind_textdomain_codeset' function. */
  #undef HAVE_BIND_TEXTDOMAIN_CODESET
  
  /* Define to 1 if you have the  header file. */
***
*** 112,139 
  /* Define this if you have the type _Bool. */
  #define HAVE_C99_BOOL 1
  
! /* Define to 1 if you have the `chflags' function. */
  #undef HAVE_CHFLAGS
  
! /* Define to 1 if you have the `chown' function. */
  #undef HAVE_CHOWN
  
  /* Define if you have the 'chroot' function. */
  #undef HAVE_CHROOT
  
! /* Define to 1 if you have the `clock' function. */
  #define HAVE_CLOCK1
  
! /* Define to 1 if you have the `confstr' function. */
  #undef HAVE_CONFSTR
  
  /* Define to 1 if you have the  header file. */
  #undef HAVE_CONIO_H
  
! /* Define to 1 if you have the `copysign' function. */
  #undef HAVE_COPYSIGN
  
! /* Define to 1 if you have the `ctermid' function. */
  #undef HAVE_CTERMID
  
  /* Define if you have the 'ctermid_r' function. */
--- 112,139 
  /* Define this if you have the type _Bool. */
  #define HAVE_C99_BOOL 1
  
! /* Define to 1 if you have the 'chflags' function. */
  #undef HAVE_CHFLAGS
  
! /* Define to 1 if you have the 'chown' function. */
  #undef HAVE_CHOWN
  
  /* Define if you have the 'chroot' function. */
  #undef HAVE_CHROOT
  
! /* Define to 1 if you have the 'clock' function. */
  #define HAVE_CLOCK1
  
! /* Define to 1 if you have the 'confstr' function. */
  #undef HAVE_CONFSTR
  
  /* Define to 1 if you have the  header file. */
  #undef HAVE_CONIO_H
  
! /* Define to 1 if you have the 'copysign' function. */
  #undef HAVE_COPYSIGN
  
! /* Define to 1 if you have the 'ctermid' function. */
  #undef HAVE_CTERMID
  
  /* Define if you have the 'ctermid_r' function. */
***
*** 151,169 
  /* Define if you have the 'resize_term' function. */
  #undef HAVE_CURSES_RESIZE_TERM
  
! /* Define to 1 if you have the declaration of `isfinite', and to 0 if you
 don't. */
  #define HAVE_DECL_ISFINITE0
  
! /* Define to 1 if you have the declaration of `isinf', an

Re: [edk2] [Patch 1/1] AppPkg/Python remove improper characters from pyconfig.h

2015-11-03 Thread Bjorge, Erik C
Reviewed-by: Erik Bjorge 

-Original Message-
From: Daryl McDaniel [mailto:edk2-li...@mc2research.org] 
Sent: Tuesday, November 3, 2015 10:29 AM
To: edk2-devel@lists.01.org; Carsey, Jaben ; Bjorge, 
Erik C ; Rosenbaum, Lee G 
Subject: [Patch 1/1] AppPkg/Python remove improper characters from pyconfig.h

AppPkg: Within the Ia32 and X64 pyconfig.h files, there are 178 occurrences
of an accent character, `, being used instead of a regular single quote, ',
within comments.

Replace all occurrences of ` within comments with '.  Example:
OLD:  `foobar'
NEW: 'foobar'

The same changes are applied to both
AppPkg/Applications/Python/Ia32/pyconfig.h and
AppPkg/Applications/Python/X64/pyconfig.h.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daryl McDaniel 


Changes are detailed in the attached patch file.

Sincerely,
Daryl McDaniel

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ShellPkg: Use safe string functions to refine Tftp.c code.

2015-10-14 Thread Bjorge, Erik C
Please put the 'if' statement on its own line.

-Erik

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Qiu 
Shumin
Sent: Tuesday, October 13, 2015 10:00 PM
To: edk2-devel@lists.01.org
Cc: Carsey, Jaben ; Qiu, Shumin 
Subject: [edk2] [PATCH] ShellPkg: Use safe string functions to refine Tftp.c 
code.

Cc: Jaben Carsey 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin 
---
 ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c 
b/ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c
index 4bb21aa..02099fe 100644
--- a/ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c
+++ b/ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c
@@ -955,6 +955,7 @@ CheckPacket (
   UINTN Index;
   UINTN LastStep;
   UINTN Step;
+  EFI_STATUSStatus;
 
   if ((NTOHS (Packet->OpCode)) != EFI_MTFTP4_OPCODE_DATA) {
 return EFI_SUCCESS;
@@ -984,7 +985,10 @@ CheckPacket (
 
   ShellPrintEx (-1, -1, L"%s", mTftpProgressDelete);
 
-  StrCpy (Progress, mTftpProgressFrame);
+  Status = StrCpyS (Progress, TFTP_PROGRESS_MESSAGE_SIZE, 
+ mTftpProgressFrame);  if (EFI_ERROR(Status)) {
+return Status;
+  }
   for (Index = 1; Index < Step; Index++) {
 Progress[Index] = L'=';
   }
--
1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] BaseTools/Scripts: Add PatchCheck.py script

2015-10-12 Thread Bjorge, Erik C
I think it may have been outlook messing with me when applying the patch.  The 
whitespace notice was about some of the copyright lines.  I will pull from your 
public repo/branch and see if I have the same issue.

Thanks,
-Erik

-Original Message-
From: Justen, Jordan L 
Sent: Friday, October 9, 2015 11:11 AM
To: Laszlo Ersek ; Bjorge, Erik C ; 
edk2-devel@lists.01.org
Cc: Gao, Liming 
Subject: Re: [edk2] [PATCH] BaseTools/Scripts: Add PatchCheck.py script

On 2015-10-09 10:57:40, Laszlo Ersek wrote:
> On 10/09/15 19:13, Bjorge, Erik C wrote:
> > The patch has some trailing white spaces
> 
> Apparently, Jordan forgot to run the script on the patch that adds the 
> script! ;)

I ran the script on the patch, and it didn't flag any trailing whitespace. So, 
if there is trailing whitespace in the patch, then there is a bug in the script.

I also tried using my editor to cleanup any tailing whitespace, and it didn't 
seem to locate any.

Can either of you point out a line with trailing whitespace in the patch?

-Jordan

> > but other than that it works fine.
> > 
> > Reviewed-by: Erik Bjorge 
> > 
> > -Original Message-
> > From: Justen, Jordan L
> > Sent: Wednesday, October 7, 2015 7:53 PM
> > To: edk2-devel@lists.01.org
> > Cc: Justen, Jordan L ; Bjorge, Erik C 
> > ; Zhu, Yonghong ; 
> > Gao, Liming 
> > Subject: [PATCH] BaseTools/Scripts: Add PatchCheck.py script
> > 
> > This script can be used to check some expected rules for EDK II patches. It 
> > only works on git formatted patches.
> > 
> > It checks both the commit message and the lines that are added in the patch 
> > diff.
> > 
> > In the commit message it verifies line lengths, signature formats, and the 
> > Contributed-under tag.
> > 
> > In the patch, it checks that line endings are CRLF for all files that don't 
> > have a .sh extension. It verifies that no trailing whitespace is present 
> > and that tab characters are not used.
> > 
> > Patch contributors should use this script prior to submitting their 
> > patches. Package maintainers can also use it to verify incoming patches.
> > 
> > It can also be run by specifying a git revision list, so actual patch files 
> > are not always required.
> > 
> > For example, to checkout this last 5 patches in your git branch you can run:
> > 
> >   python PatchCheck.py HEAD~5..
> > 
> > Or, a shortcut (like git log):
> > 
> >   python PatchCheck.py -5
> > 
> > The --oneline option works similar to git log --oneline.
> > 
> > The --silent option enables silent operation.
> > 
> > The script supports python 2.7 and python 3.
> > 
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Jordan Justen 
> > Cc: Erik Bjorge 
> > Cc: Yonghong Zhu 
> > Cc: Liming Gao 
> > ---
> >  BaseTools/Scripts/PatchCheck.py | 607 
> > 
> >  1 file changed, 607 insertions(+)
> >  create mode 100644 BaseTools/Scripts/PatchCheck.py
> > 
> > diff --git a/BaseTools/Scripts/PatchCheck.py 
> > b/BaseTools/Scripts/PatchCheck.py new file mode 100644 index 
> > 000..340a997
> > --- /dev/null
> > +++ b/BaseTools/Scripts/PatchCheck.py
> > @@ -0,0 +1,607 @@
> > +## @file
> > +#  Check a patch for various format issues # #  Copyright (c) 2015, 
> > +Intel Corporation. All rights reserved. # #  This program and 
> > +the accompanying materials are licensed and made #  available under 
> > +the terms and conditions of the BSD License which #  accompanies 
> > +this distribution. The full text of the license may be #  found at 
> > +http://opensource.org/licenses/bsd-license.php
> > +#
> > +#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
> > +#  BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
> > +# EXPRESS OR IMPLIED.
> > +#
> > +
> > +from __future__ import print_function
> > +
> > +VersionNumber = '0.1'
> > +__copyright__ = "Copyright (c) 2015, Intel Corporation  All rights 
> > reserved."
> > +
> > +import email
> > +import argparse
> > +import os
> > +import re
> > +import subprocess
> > +import sys
> > +
> > +class Verbose:
> > +SILENT, ONELINE, NORMAL = range(3)
> > +level = NORMAL
> > +
> > +class CommitMessageCheck:
> > +"""Checks the contents of a git commit message."""
> > +
> > +def __init__(self, subject, message):
> &g

Re: [edk2] [PATCH] BaseTools/Scripts: Add PatchCheck.py script

2015-10-09 Thread Bjorge, Erik C
The patch has some trailing white spaces but other than that it works fine.

Reviewed-by: Erik Bjorge 

-Original Message-
From: Justen, Jordan L 
Sent: Wednesday, October 7, 2015 7:53 PM
To: edk2-devel@lists.01.org
Cc: Justen, Jordan L ; Bjorge, Erik C 
; Zhu, Yonghong ; Gao, Liming 

Subject: [PATCH] BaseTools/Scripts: Add PatchCheck.py script

This script can be used to check some expected rules for EDK II patches. It 
only works on git formatted patches.

It checks both the commit message and the lines that are added in the patch 
diff.

In the commit message it verifies line lengths, signature formats, and the 
Contributed-under tag.

In the patch, it checks that line endings are CRLF for all files that don't 
have a .sh extension. It verifies that no trailing whitespace is present and 
that tab characters are not used.

Patch contributors should use this script prior to submitting their patches. 
Package maintainers can also use it to verify incoming patches.

It can also be run by specifying a git revision list, so actual patch files are 
not always required.

For example, to checkout this last 5 patches in your git branch you can run:

  python PatchCheck.py HEAD~5..

Or, a shortcut (like git log):

  python PatchCheck.py -5

The --oneline option works similar to git log --oneline.

The --silent option enables silent operation.

The script supports python 2.7 and python 3.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen 
Cc: Erik Bjorge 
Cc: Yonghong Zhu 
Cc: Liming Gao 
---
 BaseTools/Scripts/PatchCheck.py | 607 
 1 file changed, 607 insertions(+)
 create mode 100644 BaseTools/Scripts/PatchCheck.py

diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py 
new file mode 100644 index 000..340a997
--- /dev/null
+++ b/BaseTools/Scripts/PatchCheck.py
@@ -0,0 +1,607 @@
+## @file
+#  Check a patch for various format issues # #  Copyright (c) 2015, 
+Intel Corporation. All rights reserved. # #  This program and the 
+accompanying materials are licensed and made #  available under the 
+terms and conditions of the BSD License which #  accompanies this 
+distribution. The full text of the license may be #  found at 
+http://opensource.org/licenses/bsd-license.php
+#
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
+#  BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER #  
+EXPRESS OR IMPLIED.
+#
+
+from __future__ import print_function
+
+VersionNumber = '0.1'
+__copyright__ = "Copyright (c) 2015, Intel Corporation  All rights reserved."
+
+import email
+import argparse
+import os
+import re
+import subprocess
+import sys
+
+class Verbose:
+SILENT, ONELINE, NORMAL = range(3)
+level = NORMAL
+
+class CommitMessageCheck:
+"""Checks the contents of a git commit message."""
+
+def __init__(self, subject, message):
+self.ok = True
+
+if subject is None and  message is None:
+self.error('Commit message is missing!')
+return
+
+self.subject = subject
+self.msg = message
+
+self.check_contributed_under()
+self.check_signed_off_by()
+self.check_misc_signatures()
+self.check_overall_format()
+self.report_message_result()
+
+url = 
'https://github.com/tianocore/tianocore.github.io/wiki/Commit-Message-Format'
+
+def report_message_result(self):
+if Verbose.level < Verbose.NORMAL:
+return
+if self.ok:
+# All checks passed
+return_code = 0
+print('The commit message format passed all checks.')
+else:
+return_code = 1
+if not self.ok:
+print(self.url)
+
+def error(self, *err):
+if self.ok and Verbose.level > Verbose.ONELINE:
+print('The commit message format is not valid:')
+self.ok = False
+if Verbose.level < Verbose.NORMAL:
+return
+count = 0
+for line in err:
+prefix = (' *', '  ')[count > 0]
+print(prefix, line)
+count += 1
+
+def check_contributed_under(self):
+cu_msg='Contributed-under: TianoCore Contribution Agreement 1.0'
+if self.msg.find(cu_msg) < 0:
+self.error('Missing Contributed-under! (Note: this must be ' +
+   'added by the code contributor!)')
+
+@staticmethod
+def make_signature_re(sig, re_input=False):
+if re_input:
+sub_re = sig
+else:
+sub_re = sig.replace('-', r'[-\s]+')
+re_str = (r'^(?P' + sub_re +
+  r')(\s*):(\s*)(?P\S.*?)(?:\s*)$')
+try:
+return re.compile(re_str, re.MULTILINE