From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) by mx.groups.io with SMTP id smtpd.web10.3284.1604363804937256527 for ; Mon, 02 Nov 2020 16:36:45 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nVuPKVTi; spf=pass (domain: gmail.com, ip: 209.85.215.179, mailfrom: matthewfcarlson@gmail.com) Received: by mail-pg1-f179.google.com with SMTP id w4so2050733pgg.13 for ; Mon, 02 Nov 2020 16:36:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/cRdZVwbEhkF6zT6RTtrg2SHSE5ktIfHqnb0T+CMFMs=; b=nVuPKVTizyfwSTsRQdkUYy1cSo/vyLT0dmoUowaH30dOl/mfeZce7i0Mjp4OMCL7mr 1DjqkRwfp/h4rfyZGPNezQDOOFKRLcMKS6jQyTGY7QUq1XZAqx5YyWzazNOhNcJ3YMW4 YHZcLGiC3p+DRAzC1hsk0c6f4SBgta1n8/pSKtsaazOwJWMuLavc50HiHdclUAwSeG3B mYULKbG4eT+gh7ybvApCco9jrT7Xz6tln+V/XIowkS8mlaH4UQgtQjn7UiOCdBBEhfKg bzn66Fjj/xgi0AQvxvo4Xe9+fxxiG0Yh19JUNgNzGfA/O+n0R68kpLn+/qdjM5RSx4tH o29g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/cRdZVwbEhkF6zT6RTtrg2SHSE5ktIfHqnb0T+CMFMs=; b=izf6BwWAMYqqVuoKqQ+gIVJi02c6kuyvX1q4laMnC9/d/YUg4B2sXMsPs+xNlrhbCB zIQQCIQVG56Fl0j4XRqTUPqni8M7P/XcuikhSFJWGXQvlEb9reFxK6G0xn2dAtd3UVew ePJQ/V4sdK74m68G3eNFQsbi/of600THancPnjmq5fojT6SzI7IDQugpDptt/i/+BDfC dqmvx3Fp5gJ6F3uDvkHrLvnpdOT6iUEtFT+6kujpwyGvP0hUOkPrv7vlkzKozMH5sN/I PoqxFuNAFUnxkMVRnnN0w9itQfJrEb8pXEA/xQoDJpQWK0VvK2Di7VfFsw62FqhgOe3x pu/w== X-Gm-Message-State: AOAM533j9/MoMYz5mKh0NePj3j+IkWyzx0gUve8A19AxTTk7T4rPPNi2 eqERuW09xR+B8JnKd3S8nrUYQxM11bWjDg== X-Google-Smtp-Source: ABdhPJzJ2nVu0ZZFF4TJ1qGgLksNPcNn0K3J9PrHClZFZRAfuZZnfFVeGygKjenWrJvVKH/h5as0lg== X-Received: by 2002:a63:4644:: with SMTP id v4mr15159316pgk.351.1604363803987; Mon, 02 Nov 2020 16:36:43 -0800 (PST) Return-Path: Received: from localhost.localdomain ([50.34.53.167]) by smtp.gmail.com with ESMTPSA id x15sm630853pjh.21.2020.11.02.16.36.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Nov 2020 16:36:43 -0800 (PST) From: "Matthew Carlson" To: devel@edk2.groups.io Cc: Bob Feng , Liming Gao , Yuwei Chen , Sean Brogan , Michael Kinney , Matthew Carlson Subject: [PATCH v1 1/1] BaseTools: Use pip module if available, CI uses it by default Date: Mon, 2 Nov 2020 16:36:30 -0800 Message-Id: <20201103003630.1869-2-matthewfcarlson@gmail.com> X-Mailer: git-send-email 2.28.0.vfs.0.0 In-Reply-To: <20201103003630.1869-1-matthewfcarlson@gmail.com> References: <20201103003630.1869-1-matthewfcarlson@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Matthew Carlson =0D Use the new edk2-basetools pip module.=0D Includes a helpful message in setup to let users know which has been=0D selected.=0D =0D Cc: Bob Feng =0D Cc: Liming Gao =0D Cc: Yuwei Chen =0D Cc: Sean Brogan =0D Cc: Michael Kinney =0D =0D Signed-off-by: Matthew Carlson =0D ---=0D .pytool/CISettings.py = | 20 +-=0D BaseTools/BinPipWrappers/PosixLike/AmlToC = | 14 +=0D BaseTools/BinPipWrappers/PosixLike/BPDG = | 12 +=0D BaseTools/BinPipWrappers/PosixLike/Brotli = | 29 ++=0D BaseTools/BinPipWrappers/PosixLike/BrotliCompress = | 34 ++=0D BaseTools/BinPipWrappers/PosixLike/DevicePath = | 29 ++=0D BaseTools/BinPipWrappers/PosixLike/Ecc = | 13 +=0D BaseTools/BinPipWrappers/PosixLike/EfiRom = | 29 ++=0D BaseTools/BinPipWrappers/PosixLike/GenCrc32 = | 29 ++=0D BaseTools/BinPipWrappers/PosixLike/GenDepex = | 12 +=0D BaseTools/BinPipWrappers/PosixLike/GenFds = | 12 +=0D BaseTools/BinPipWrappers/PosixLike/GenFfs = | 29 ++=0D BaseTools/BinPipWrappers/PosixLike/GenFv = | 29 ++=0D BaseTools/BinPipWrappers/PosixLike/GenFw = | 29 ++=0D BaseTools/BinPipWrappers/PosixLike/GenPatchPcdTable = | 12 +=0D BaseTools/BinPipWrappers/PosixLike/GenSec = | 29 ++=0D BaseTools/BinPipWrappers/PosixLike/GenerateCapsule = | 12 +=0D BaseTools/BinPipWrappers/PosixLike/LzmaCompress = | 29 ++=0D BaseTools/BinPipWrappers/PosixLike/LzmaF86Compress = | 19 +=0D BaseTools/BinPipWrappers/PosixLike/PatchPcdValue = | 12 +=0D BaseTools/BinPipWrappers/PosixLike/Pkcs7Sign = | 12 +=0D BaseTools/BinPipWrappers/PosixLike/Rsa2048Sha256GenerateKeys = | 12 +=0D BaseTools/BinPipWrappers/PosixLike/Rsa2048Sha256Sign = | 12 +=0D BaseTools/BinPipWrappers/PosixLike/Split = | 29 ++=0D BaseTools/BinPipWrappers/PosixLike/TargetTool = | 12 +=0D BaseTools/BinPipWrappers/PosixLike/TianoCompress = | 29 ++=0D BaseTools/BinPipWrappers/PosixLike/Trim = | 13 +=0D BaseTools/BinPipWrappers/PosixLike/UPT = | 12 +=0D BaseTools/BinPipWrappers/PosixLike/VfrCompile = | 29 ++=0D BaseTools/BinPipWrappers/PosixLike/VolInfo = | 29 ++=0D BaseTools/BinPipWrappers/PosixLike/build = | 12 +=0D BaseTools/{BinWrappers =3D> BinPipWrappers}/PosixLike/posix_path_env.yaml = | 3 +-=0D BaseTools/BinPipWrappers/WindowsLike/AmlToC.bat = | 3 +=0D BaseTools/BinPipWrappers/WindowsLike/BPDG.bat = | 3 +=0D BaseTools/BinPipWrappers/WindowsLike/BrotliCompress.bat = | 55 ++=0D BaseTools/BinPipWrappers/WindowsLike/Ecc.bat = | 3 +=0D BaseTools/BinPipWrappers/WindowsLike/GenDepex.bat = | 3 +=0D BaseTools/BinPipWrappers/WindowsLike/GenFds.bat = | 3 +=0D BaseTools/BinPipWrappers/WindowsLike/GenPatchPcdTable.bat = | 3 +=0D BaseTools/BinPipWrappers/WindowsLike/GenerateCapsule.bat = | 1 +=0D BaseTools/BinPipWrappers/WindowsLike/PatchPcdValue.bat = | 3 +=0D BaseTools/BinPipWrappers/WindowsLike/Pkcs7Sign.bat = | 3 +=0D BaseTools/BinPipWrappers/WindowsLike/Rsa2048Sha256GenerateKeys.bat = | 1 +=0D BaseTools/BinPipWrappers/WindowsLike/Rsa2048Sha256Sign.bat = | 3 +=0D BaseTools/BinPipWrappers/WindowsLike/TargetTool.bat = | 3 +=0D BaseTools/BinPipWrappers/WindowsLike/Trim.bat = | 3 +=0D BaseTools/BinPipWrappers/WindowsLike/UPT.bat = | 3 +=0D BaseTools/BinPipWrappers/WindowsLike/build.bat = | 3 +=0D BaseTools/{BinWrappers =3D> BinPipWrappers}/WindowsLike/win_build_tools_pa= th_env.yaml | 3 +-=0D BaseTools/BinWrappers/PosixLike/posix_path_env.yaml = | 1 +=0D BaseTools/BinWrappers/WindowsLike/win_build_tools_path_env.yaml = | 1 +=0D BaseTools/BuildEnv = | 548 ++++++++++----------=0D BaseTools/Scripts/PatchCheck.py = | 1 +=0D BaseTools/toolsetup.bat = | 19 +=0D pip-requirements.txt = | 1 +=0D 55 files changed, 1035 insertions(+), 272 deletions(-)=0D =0D diff --git a/.pytool/CISettings.py b/.pytool/CISettings.py=0D index b337d046ae08..e0e106d8e65a 100644=0D --- a/.pytool/CISettings.py=0D +++ b/.pytool/CISettings.py=0D @@ -22,6 +22,7 @@ class Settings(CiBuildSettingsManager, UpdateSettingsMana= ger, SetupSettingsManag=0D self.ActualTargets =3D []=0D self.ActualArchitectures =3D []=0D self.ActualToolChainTag =3D ""=0D + self.UseBuiltInBaseTools =3D None=0D =0D # ####################################################################= ################### #=0D # Extra CmdLine configuration = #=0D @@ -131,7 +132,24 @@ class Settings(CiBuildSettingsManager, UpdateSettingsM= anager, SetupSettingsManag=0D =0D self.ActualToolChainTag =3D shell_environment.GetBuildVars().GetVa= lue("TOOL_CHAIN_TAG", "")=0D =0D - if GetHostInfo().os.upper() =3D=3D "LINUX" and self.ActualToolChai= nTag.upper().startswith("GCC"):=0D + is_linux =3D GetHostInfo().os.upper() =3D=3D "LINUX"=0D +=0D + if self.UseBuiltInBaseTools is None:=0D + is_linux =3D GetHostInfo().os.upper() =3D=3D "LINUX"=0D + # try and import the pip module for basetools=0D + try:=0D + import edk2basetools=0D + self.UseBuiltInBaseTools =3D True=0D + logging.info("Using Pip Tools based BaseTools")=0D + except ImportError:=0D + logging.warning("Falling back to using in-tree BaseTools")= =0D + self.UseBuiltInBaseTools =3D False=0D + pass=0D +=0D + if self.UseBuiltInBaseTools =3D=3D True:=0D + scopes +=3D ('pipbuild-unix',) if is_linux else ('pipbuild-win= ',)=0D +=0D + if is_linux and self.ActualToolChainTag.upper().startswith("GCC"):= =0D if "AARCH64" in self.ActualArchitectures:=0D scopes +=3D ("gcc_aarch64_linux",)=0D if "ARM" in self.ActualArchitectures:=0D diff --git a/BaseTools/BinPipWrappers/PosixLike/AmlToC b/BaseTools/BinPipWr= appers/PosixLike/AmlToC=0D new file mode 100644=0D index 000000000000..1dd28e966288=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/PosixLike/AmlToC=0D @@ -0,0 +1,14 @@=0D +#!/usr/bin/env bash=0D +#python `dirname $0`/RunToolFromSource.py `basename $0` $*=0D +=0D +# If a ${PYTHON_COMMAND} command is available, use it in preference to pyt= hon=0D +if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then=0D + python_exe=3D${PYTHON_COMMAND}=0D +fi=0D +=0D +full_cmd=3D${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028= for a discussion of why $0 is not a good choice here=0D +dir=3D$(dirname "$full_cmd")=0D +exe=3D$(basename "$full_cmd")=0D +=0D +export PYTHONPATH=3D"$dir/../../Source/Python${PYTHONPATH:+:"$PYTHONPATH"}= "=0D +exec "${python_exe:-python}" "$dir/../../Source/Python/$exe/$exe.py" "$@"= =0D diff --git a/BaseTools/BinPipWrappers/PosixLike/BPDG b/BaseTools/BinPipWrap= pers/PosixLike/BPDG=0D new file mode 100644=0D index 000000000000..a2b901c084d6=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/PosixLike/BPDG=0D @@ -0,0 +1,12 @@=0D +#!/usr/bin/env bash=0D +#python `dirname $0`/RunToolFromSource.py `basename $0` $*=0D +=0D +# If a ${PYTHON_COMMAND} command is available, use it in preference to pyt= hon=0D +if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then=0D + python_exe=3D${PYTHON_COMMAND}=0D +fi=0D +=0D +full_cmd=3D${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028= for a discussion of why $0 is not a good choice here=0D +cmd=3D${full_cmd##*/}=0D +=0D +exec "${python_exe:-python}" -m edk2basetools.$cmd.EccMain "$@"=0D diff --git a/BaseTools/BinPipWrappers/PosixLike/Brotli b/BaseTools/BinPipWr= appers/PosixLike/Brotli=0D new file mode 100644=0D index 000000000000..a244ecc095e1=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/PosixLike/Brotli=0D @@ -0,0 +1,29 @@=0D +#!/usr/bin/env bash=0D +=0D +full_cmd=3D${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028= for a discussion of why $0 is not a good choice here=0D +dir=3D$(dirname "$full_cmd")=0D +cmd=3D${full_cmd##*/}=0D +=0D +if [ -n "$WORKSPACE" ] && [ -e "$WORKSPACE/Conf/BaseToolsCBinaries" ]=0D +then=0D + exec "$WORKSPACE/Conf/BaseToolsCBinaries/$cmd"=0D +elif [ -n "$WORKSPACE" ] && [ -e "$EDK_TOOLS_PATH/Source/C" ]=0D +then=0D + if [ ! -e "$EDK_TOOLS_PATH/Source/C/bin/$cmd" ]=0D + then=0D + echo "BaseTools C Tool binary was not found ($cmd)"=0D + echo "You may need to run:"=0D + echo " make -C $EDK_TOOLS_PATH/Source/C"=0D + else=0D + exec "$EDK_TOOLS_PATH/Source/C/bin/$cmd" "$@"=0D + fi=0D +elif [ -e "$dir/../../Source/C/bin/$cmd" ]=0D +then=0D + exec "$dir/../../Source/C/bin/$cmd" "$@"=0D +else=0D + echo "Unable to find the real '$cmd' to run"=0D + echo "This message was printed by"=0D + echo " $0"=0D + exit 127=0D +fi=0D +=0D diff --git a/BaseTools/BinPipWrappers/PosixLike/BrotliCompress b/BaseTools/= BinPipWrappers/PosixLike/BrotliCompress=0D new file mode 100644=0D index 000000000000..b5fd1beb5555=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/PosixLike/BrotliCompress=0D @@ -0,0 +1,34 @@=0D +#!/usr/bin/env bash=0D +#=0D +# This script will exec Brotli tool with -e/-d options.=0D +#=0D +# Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.
=0D +# SPDX-License-Identifier: BSD-2-Clause-Patent=0D +#=0D +QLT=3D"-q 9 -w 22"=0D +ARGS=3D=0D +=0D +while test $# -gt 0=0D +do=0D + case $1 in=0D + -e)=0D + ;;=0D + -d)=0D + ARGS+=3D"$1 "=0D + ;;=0D + -o|-g)=0D + ARGS+=3D"$1 $2 "=0D + shift=0D + ;;=0D + -q)=0D + QLT=3D"$1 $2 "=0D + shift=0D + ;;=0D + *)=0D + ARGS+=3D"$1 "=0D + ;;=0D + esac=0D + shift=0D +done=0D +=0D +exec Brotli $QLT $ARGS=0D diff --git a/BaseTools/BinPipWrappers/PosixLike/DevicePath b/BaseTools/BinP= ipWrappers/PosixLike/DevicePath=0D new file mode 100644=0D index 000000000000..a244ecc095e1=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/PosixLike/DevicePath=0D @@ -0,0 +1,29 @@=0D +#!/usr/bin/env bash=0D +=0D +full_cmd=3D${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028= for a discussion of why $0 is not a good choice here=0D +dir=3D$(dirname "$full_cmd")=0D +cmd=3D${full_cmd##*/}=0D +=0D +if [ -n "$WORKSPACE" ] && [ -e "$WORKSPACE/Conf/BaseToolsCBinaries" ]=0D +then=0D + exec "$WORKSPACE/Conf/BaseToolsCBinaries/$cmd"=0D +elif [ -n "$WORKSPACE" ] && [ -e "$EDK_TOOLS_PATH/Source/C" ]=0D +then=0D + if [ ! -e "$EDK_TOOLS_PATH/Source/C/bin/$cmd" ]=0D + then=0D + echo "BaseTools C Tool binary was not found ($cmd)"=0D + echo "You may need to run:"=0D + echo " make -C $EDK_TOOLS_PATH/Source/C"=0D + else=0D + exec "$EDK_TOOLS_PATH/Source/C/bin/$cmd" "$@"=0D + fi=0D +elif [ -e "$dir/../../Source/C/bin/$cmd" ]=0D +then=0D + exec "$dir/../../Source/C/bin/$cmd" "$@"=0D +else=0D + echo "Unable to find the real '$cmd' to run"=0D + echo "This message was printed by"=0D + echo " $0"=0D + exit 127=0D +fi=0D +=0D diff --git a/BaseTools/BinPipWrappers/PosixLike/Ecc b/BaseTools/BinPipWrapp= ers/PosixLike/Ecc=0D new file mode 100644=0D index 000000000000..598728915095=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/PosixLike/Ecc=0D @@ -0,0 +1,13 @@=0D +#!/usr/bin/env bash=0D +#python `dirname $0`/RunToolFromSource.py `basename $0` $*=0D +=0D +# If a ${PYTHON_COMMAND} command is available, use it in preference to pyt= hon=0D +if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then=0D + python_exe=3D${PYTHON_COMMAND}=0D +fi=0D +=0D +full_cmd=3D${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028= for a discussion of why $0 is not a good choice here=0D +cmd=3D${full_cmd##*/}=0D +=0D +export PYTHONPATH=3D"$dir/../../Source/Python${PYTHONPATH:+:"$PYTHONPATH"}= "=0D +exec "${python_exe:-python}" -m $cmd.EccMain "$@"=0D diff --git a/BaseTools/BinPipWrappers/PosixLike/EfiRom b/BaseTools/BinPipWr= appers/PosixLike/EfiRom=0D new file mode 100644=0D index 000000000000..a244ecc095e1=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/PosixLike/EfiRom=0D @@ -0,0 +1,29 @@=0D +#!/usr/bin/env bash=0D +=0D +full_cmd=3D${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028= for a discussion of why $0 is not a good choice here=0D +dir=3D$(dirname "$full_cmd")=0D +cmd=3D${full_cmd##*/}=0D +=0D +if [ -n "$WORKSPACE" ] && [ -e "$WORKSPACE/Conf/BaseToolsCBinaries" ]=0D +then=0D + exec "$WORKSPACE/Conf/BaseToolsCBinaries/$cmd"=0D +elif [ -n "$WORKSPACE" ] && [ -e "$EDK_TOOLS_PATH/Source/C" ]=0D +then=0D + if [ ! -e "$EDK_TOOLS_PATH/Source/C/bin/$cmd" ]=0D + then=0D + echo "BaseTools C Tool binary was not found ($cmd)"=0D + echo "You may need to run:"=0D + echo " make -C $EDK_TOOLS_PATH/Source/C"=0D + else=0D + exec "$EDK_TOOLS_PATH/Source/C/bin/$cmd" "$@"=0D + fi=0D +elif [ -e "$dir/../../Source/C/bin/$cmd" ]=0D +then=0D + exec "$dir/../../Source/C/bin/$cmd" "$@"=0D +else=0D + echo "Unable to find the real '$cmd' to run"=0D + echo "This message was printed by"=0D + echo " $0"=0D + exit 127=0D +fi=0D +=0D diff --git a/BaseTools/BinPipWrappers/PosixLike/GenCrc32 b/BaseTools/BinPip= Wrappers/PosixLike/GenCrc32=0D new file mode 100644=0D index 000000000000..a244ecc095e1=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/PosixLike/GenCrc32=0D @@ -0,0 +1,29 @@=0D +#!/usr/bin/env bash=0D +=0D +full_cmd=3D${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028= for a discussion of why $0 is not a good choice here=0D +dir=3D$(dirname "$full_cmd")=0D +cmd=3D${full_cmd##*/}=0D +=0D +if [ -n "$WORKSPACE" ] && [ -e "$WORKSPACE/Conf/BaseToolsCBinaries" ]=0D +then=0D + exec "$WORKSPACE/Conf/BaseToolsCBinaries/$cmd"=0D +elif [ -n "$WORKSPACE" ] && [ -e "$EDK_TOOLS_PATH/Source/C" ]=0D +then=0D + if [ ! -e "$EDK_TOOLS_PATH/Source/C/bin/$cmd" ]=0D + then=0D + echo "BaseTools C Tool binary was not found ($cmd)"=0D + echo "You may need to run:"=0D + echo " make -C $EDK_TOOLS_PATH/Source/C"=0D + else=0D + exec "$EDK_TOOLS_PATH/Source/C/bin/$cmd" "$@"=0D + fi=0D +elif [ -e "$dir/../../Source/C/bin/$cmd" ]=0D +then=0D + exec "$dir/../../Source/C/bin/$cmd" "$@"=0D +else=0D + echo "Unable to find the real '$cmd' to run"=0D + echo "This message was printed by"=0D + echo " $0"=0D + exit 127=0D +fi=0D +=0D diff --git a/BaseTools/BinPipWrappers/PosixLike/GenDepex b/BaseTools/BinPip= Wrappers/PosixLike/GenDepex=0D new file mode 100644=0D index 000000000000..ab29450aa1ab=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/PosixLike/GenDepex=0D @@ -0,0 +1,12 @@=0D +#!/usr/bin/env bash=0D +#python `dirname $0`/RunToolFromSource.py `basename $0` $*=0D +=0D +# If a ${PYTHON_COMMAND} command is available, use it in preference to pyt= hon=0D +if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then=0D + python_exe=3D${PYTHON_COMMAND}=0D +fi=0D +=0D +full_cmd=3D${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028= for a discussion of why $0 is not a good choice here=0D +cmd=3D${full_cmd##*/}=0D +=0D +exec "${python_exe:-python}" -m edk2basetools.AutoGen.$cmd "$@"=0D diff --git a/BaseTools/BinPipWrappers/PosixLike/GenFds b/BaseTools/BinPipWr= appers/PosixLike/GenFds=0D new file mode 100644=0D index 000000000000..14e8d8af7122=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/PosixLike/GenFds=0D @@ -0,0 +1,12 @@=0D +#!/usr/bin/env bash=0D +#python `dirname $0`/RunToolFromSource.py `basename $0` $*=0D +=0D +# If a ${PYTHON_COMMAND} command is available, use it in preference to pyt= hon=0D +if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then=0D + python_exe=3D${PYTHON_COMMAND}=0D +fi=0D +=0D +full_cmd=3D${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028= for a discussion of why $0 is not a good choice here=0D +cmd=3D${full_cmd##*/}=0D +=0D +exec "${python_exe:-python}" -m edk2basetools.$cmd "$@"=0D diff --git a/BaseTools/BinPipWrappers/PosixLike/GenFfs b/BaseTools/BinPipWr= appers/PosixLike/GenFfs=0D new file mode 100644=0D index 000000000000..a244ecc095e1=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/PosixLike/GenFfs=0D @@ -0,0 +1,29 @@=0D +#!/usr/bin/env bash=0D +=0D +full_cmd=3D${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028= for a discussion of why $0 is not a good choice here=0D +dir=3D$(dirname "$full_cmd")=0D +cmd=3D${full_cmd##*/}=0D +=0D +if [ -n "$WORKSPACE" ] && [ -e "$WORKSPACE/Conf/BaseToolsCBinaries" ]=0D +then=0D + exec "$WORKSPACE/Conf/BaseToolsCBinaries/$cmd"=0D +elif [ -n "$WORKSPACE" ] && [ -e "$EDK_TOOLS_PATH/Source/C" ]=0D +then=0D + if [ ! -e "$EDK_TOOLS_PATH/Source/C/bin/$cmd" ]=0D + then=0D + echo "BaseTools C Tool binary was not found ($cmd)"=0D + echo "You may need to run:"=0D + echo " make -C $EDK_TOOLS_PATH/Source/C"=0D + else=0D + exec "$EDK_TOOLS_PATH/Source/C/bin/$cmd" "$@"=0D + fi=0D +elif [ -e "$dir/../../Source/C/bin/$cmd" ]=0D +then=0D + exec "$dir/../../Source/C/bin/$cmd" "$@"=0D +else=0D + echo "Unable to find the real '$cmd' to run"=0D + echo "This message was printed by"=0D + echo " $0"=0D + exit 127=0D +fi=0D +=0D diff --git a/BaseTools/BinPipWrappers/PosixLike/GenFv b/BaseTools/BinPipWra= ppers/PosixLike/GenFv=0D new file mode 100644=0D index 000000000000..a244ecc095e1=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/PosixLike/GenFv=0D @@ -0,0 +1,29 @@=0D +#!/usr/bin/env bash=0D +=0D +full_cmd=3D${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028= for a discussion of why $0 is not a good choice here=0D +dir=3D$(dirname "$full_cmd")=0D +cmd=3D${full_cmd##*/}=0D +=0D +if [ -n "$WORKSPACE" ] && [ -e "$WORKSPACE/Conf/BaseToolsCBinaries" ]=0D +then=0D + exec "$WORKSPACE/Conf/BaseToolsCBinaries/$cmd"=0D +elif [ -n "$WORKSPACE" ] && [ -e "$EDK_TOOLS_PATH/Source/C" ]=0D +then=0D + if [ ! -e "$EDK_TOOLS_PATH/Source/C/bin/$cmd" ]=0D + then=0D + echo "BaseTools C Tool binary was not found ($cmd)"=0D + echo "You may need to run:"=0D + echo " make -C $EDK_TOOLS_PATH/Source/C"=0D + else=0D + exec "$EDK_TOOLS_PATH/Source/C/bin/$cmd" "$@"=0D + fi=0D +elif [ -e "$dir/../../Source/C/bin/$cmd" ]=0D +then=0D + exec "$dir/../../Source/C/bin/$cmd" "$@"=0D +else=0D + echo "Unable to find the real '$cmd' to run"=0D + echo "This message was printed by"=0D + echo " $0"=0D + exit 127=0D +fi=0D +=0D diff --git a/BaseTools/BinPipWrappers/PosixLike/GenFw b/BaseTools/BinPipWra= ppers/PosixLike/GenFw=0D new file mode 100644=0D index 000000000000..a244ecc095e1=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/PosixLike/GenFw=0D @@ -0,0 +1,29 @@=0D +#!/usr/bin/env bash=0D +=0D +full_cmd=3D${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028= for a discussion of why $0 is not a good choice here=0D +dir=3D$(dirname "$full_cmd")=0D +cmd=3D${full_cmd##*/}=0D +=0D +if [ -n "$WORKSPACE" ] && [ -e "$WORKSPACE/Conf/BaseToolsCBinaries" ]=0D +then=0D + exec "$WORKSPACE/Conf/BaseToolsCBinaries/$cmd"=0D +elif [ -n "$WORKSPACE" ] && [ -e "$EDK_TOOLS_PATH/Source/C" ]=0D +then=0D + if [ ! -e "$EDK_TOOLS_PATH/Source/C/bin/$cmd" ]=0D + then=0D + echo "BaseTools C Tool binary was not found ($cmd)"=0D + echo "You may need to run:"=0D + echo " make -C $EDK_TOOLS_PATH/Source/C"=0D + else=0D + exec "$EDK_TOOLS_PATH/Source/C/bin/$cmd" "$@"=0D + fi=0D +elif [ -e "$dir/../../Source/C/bin/$cmd" ]=0D +then=0D + exec "$dir/../../Source/C/bin/$cmd" "$@"=0D +else=0D + echo "Unable to find the real '$cmd' to run"=0D + echo "This message was printed by"=0D + echo " $0"=0D + exit 127=0D +fi=0D +=0D diff --git a/BaseTools/BinPipWrappers/PosixLike/GenPatchPcdTable b/BaseTool= s/BinPipWrappers/PosixLike/GenPatchPcdTable=0D new file mode 100644=0D index 000000000000..14b8903232c6=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/PosixLike/GenPatchPcdTable=0D @@ -0,0 +1,12 @@=0D +#!/usr/bin/env bash=0D +#python `dirname $0`/RunToolFromSource.py `basename $0` $*=0D +=0D +# If a ${PYTHON_COMMAND} command is available, use it in preference to pyt= hon=0D +if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then=0D + python_exe=3D${PYTHON_COMMAND}=0D +fi=0D +=0D +full_cmd=3D${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028= for a discussion of why $0 is not a good choice here=0D +cmd=3D${full_cmd##*/}=0D +=0D +exec "${python_exe:-python}" -m edk2basetools.$cmd.$cmd "$@"=0D diff --git a/BaseTools/BinPipWrappers/PosixLike/GenSec b/BaseTools/BinPipWr= appers/PosixLike/GenSec=0D new file mode 100644=0D index 000000000000..a244ecc095e1=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/PosixLike/GenSec=0D @@ -0,0 +1,29 @@=0D +#!/usr/bin/env bash=0D +=0D +full_cmd=3D${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028= for a discussion of why $0 is not a good choice here=0D +dir=3D$(dirname "$full_cmd")=0D +cmd=3D${full_cmd##*/}=0D +=0D +if [ -n "$WORKSPACE" ] && [ -e "$WORKSPACE/Conf/BaseToolsCBinaries" ]=0D +then=0D + exec "$WORKSPACE/Conf/BaseToolsCBinaries/$cmd"=0D +elif [ -n "$WORKSPACE" ] && [ -e "$EDK_TOOLS_PATH/Source/C" ]=0D +then=0D + if [ ! -e "$EDK_TOOLS_PATH/Source/C/bin/$cmd" ]=0D + then=0D + echo "BaseTools C Tool binary was not found ($cmd)"=0D + echo "You may need to run:"=0D + echo " make -C $EDK_TOOLS_PATH/Source/C"=0D + else=0D + exec "$EDK_TOOLS_PATH/Source/C/bin/$cmd" "$@"=0D + fi=0D +elif [ -e "$dir/../../Source/C/bin/$cmd" ]=0D +then=0D + exec "$dir/../../Source/C/bin/$cmd" "$@"=0D +else=0D + echo "Unable to find the real '$cmd' to run"=0D + echo "This message was printed by"=0D + echo " $0"=0D + exit 127=0D +fi=0D +=0D diff --git a/BaseTools/BinPipWrappers/PosixLike/GenerateCapsule b/BaseTools= /BinPipWrappers/PosixLike/GenerateCapsule=0D new file mode 100644=0D index 000000000000..44e234d433f9=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/PosixLike/GenerateCapsule=0D @@ -0,0 +1,12 @@=0D +#!/usr/bin/env bash=0D +#python `dirname $0`/RunToolFromSource.py `basename $0` $*=0D +=0D +# If a ${PYTHON_COMMAND} command is available, use it in preference to pyt= hon=0D +if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then=0D + python_exe=3D${PYTHON_COMMAND}=0D +fi=0D +=0D +full_cmd=3D${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028= for a discussion of why $0 is not a good choice here=0D +cmd=3D${full_cmd##*/}=0D +=0D +exec "${python_exe:-python}" -m edk2basetools.Capsule.$cmd "$@"=0D diff --git a/BaseTools/BinPipWrappers/PosixLike/LzmaCompress b/BaseTools/Bi= nPipWrappers/PosixLike/LzmaCompress=0D new file mode 100644=0D index 000000000000..a244ecc095e1=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/PosixLike/LzmaCompress=0D @@ -0,0 +1,29 @@=0D +#!/usr/bin/env bash=0D +=0D +full_cmd=3D${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028= for a discussion of why $0 is not a good choice here=0D +dir=3D$(dirname "$full_cmd")=0D +cmd=3D${full_cmd##*/}=0D +=0D +if [ -n "$WORKSPACE" ] && [ -e "$WORKSPACE/Conf/BaseToolsCBinaries" ]=0D +then=0D + exec "$WORKSPACE/Conf/BaseToolsCBinaries/$cmd"=0D +elif [ -n "$WORKSPACE" ] && [ -e "$EDK_TOOLS_PATH/Source/C" ]=0D +then=0D + if [ ! -e "$EDK_TOOLS_PATH/Source/C/bin/$cmd" ]=0D + then=0D + echo "BaseTools C Tool binary was not found ($cmd)"=0D + echo "You may need to run:"=0D + echo " make -C $EDK_TOOLS_PATH/Source/C"=0D + else=0D + exec "$EDK_TOOLS_PATH/Source/C/bin/$cmd" "$@"=0D + fi=0D +elif [ -e "$dir/../../Source/C/bin/$cmd" ]=0D +then=0D + exec "$dir/../../Source/C/bin/$cmd" "$@"=0D +else=0D + echo "Unable to find the real '$cmd' to run"=0D + echo "This message was printed by"=0D + echo " $0"=0D + exit 127=0D +fi=0D +=0D diff --git a/BaseTools/BinPipWrappers/PosixLike/LzmaF86Compress b/BaseTools= /BinPipWrappers/PosixLike/LzmaF86Compress=0D new file mode 100644=0D index 000000000000..b1ba8ed1e7a8=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/PosixLike/LzmaF86Compress=0D @@ -0,0 +1,19 @@=0D +#!/usr/bin/env bash=0D +#=0D +# This script will exec LzmaCompress tool with --f86 option that enables c= onverter for x86 code.=0D +#=0D +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP
=0D +# Copyright (c) 2012, Intel Corporation. All rights reserved.
=0D +# SPDX-License-Identifier: BSD-2-Clause-Patent=0D +#=0D +=0D +for arg; do=0D + case $arg in=0D + -e|-d)=0D + set -- "$@" --f86=0D + break=0D + ;;=0D + esac=0D +done=0D +=0D +exec LzmaCompress "$@"=0D diff --git a/BaseTools/BinPipWrappers/PosixLike/PatchPcdValue b/BaseTools/B= inPipWrappers/PosixLike/PatchPcdValue=0D new file mode 100644=0D index 000000000000..14b8903232c6=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/PosixLike/PatchPcdValue=0D @@ -0,0 +1,12 @@=0D +#!/usr/bin/env bash=0D +#python `dirname $0`/RunToolFromSource.py `basename $0` $*=0D +=0D +# If a ${PYTHON_COMMAND} command is available, use it in preference to pyt= hon=0D +if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then=0D + python_exe=3D${PYTHON_COMMAND}=0D +fi=0D +=0D +full_cmd=3D${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028= for a discussion of why $0 is not a good choice here=0D +cmd=3D${full_cmd##*/}=0D +=0D +exec "${python_exe:-python}" -m edk2basetools.$cmd.$cmd "$@"=0D diff --git a/BaseTools/BinPipWrappers/PosixLike/Pkcs7Sign b/BaseTools/BinPi= pWrappers/PosixLike/Pkcs7Sign=0D new file mode 100644=0D index 000000000000..14b8903232c6=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/PosixLike/Pkcs7Sign=0D @@ -0,0 +1,12 @@=0D +#!/usr/bin/env bash=0D +#python `dirname $0`/RunToolFromSource.py `basename $0` $*=0D +=0D +# If a ${PYTHON_COMMAND} command is available, use it in preference to pyt= hon=0D +if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then=0D + python_exe=3D${PYTHON_COMMAND}=0D +fi=0D +=0D +full_cmd=3D${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028= for a discussion of why $0 is not a good choice here=0D +cmd=3D${full_cmd##*/}=0D +=0D +exec "${python_exe:-python}" -m edk2basetools.$cmd.$cmd "$@"=0D diff --git a/BaseTools/BinPipWrappers/PosixLike/Rsa2048Sha256GenerateKeys b= /BaseTools/BinPipWrappers/PosixLike/Rsa2048Sha256GenerateKeys=0D new file mode 100644=0D index 000000000000..c8b31202554b=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/PosixLike/Rsa2048Sha256GenerateKeys=0D @@ -0,0 +1,12 @@=0D +#!/usr/bin/env bash=0D +#python `dirname $0`/RunToolFromSource.py `basename $0` $*=0D +=0D +# If a ${PYTHON_COMMAND} command is available, use it in preference to pyt= hon=0D +if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then=0D + python_exe=3D${PYTHON_COMMAND}=0D +fi=0D +=0D +full_cmd=3D${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028= for a discussion of why $0 is not a good choice here=0D +cmd=3D${full_cmd##*/}=0D +=0D +exec "${python_exe:-python}" -m edk2basetools.Rsa2048Sha256Sign.$cmd "$@"= =0D diff --git a/BaseTools/BinPipWrappers/PosixLike/Rsa2048Sha256Sign b/BaseToo= ls/BinPipWrappers/PosixLike/Rsa2048Sha256Sign=0D new file mode 100644=0D index 000000000000..75b934a5d0b5=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/PosixLike/Rsa2048Sha256Sign=0D @@ -0,0 +1,12 @@=0D +#!/usr/bin/env bash=0D +#python `dirname $0`/RunToolFromSource.py `basename $0` $*=0D +=0D +# If a ${PYTHON_COMMAND} command is available, use it in preference to pyt= hon=0D +if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then=0D + python_exe=3D${PYTHON_COMMAND}=0D +fi=0D +=0D +full_cmd=3D${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028= for a discussion of why $0 is not a good choice here=0D +cmd=3D${full_cmd##*/}=0D +=0D +exec "${python_exe:-python}" -m edk2basetools.$cmd.$cmd "$@"=0D \ No newline at end of file=0D diff --git a/BaseTools/BinPipWrappers/PosixLike/Split b/BaseTools/BinPipWra= ppers/PosixLike/Split=0D new file mode 100644=0D index 000000000000..a244ecc095e1=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/PosixLike/Split=0D @@ -0,0 +1,29 @@=0D +#!/usr/bin/env bash=0D +=0D +full_cmd=3D${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028= for a discussion of why $0 is not a good choice here=0D +dir=3D$(dirname "$full_cmd")=0D +cmd=3D${full_cmd##*/}=0D +=0D +if [ -n "$WORKSPACE" ] && [ -e "$WORKSPACE/Conf/BaseToolsCBinaries" ]=0D +then=0D + exec "$WORKSPACE/Conf/BaseToolsCBinaries/$cmd"=0D +elif [ -n "$WORKSPACE" ] && [ -e "$EDK_TOOLS_PATH/Source/C" ]=0D +then=0D + if [ ! -e "$EDK_TOOLS_PATH/Source/C/bin/$cmd" ]=0D + then=0D + echo "BaseTools C Tool binary was not found ($cmd)"=0D + echo "You may need to run:"=0D + echo " make -C $EDK_TOOLS_PATH/Source/C"=0D + else=0D + exec "$EDK_TOOLS_PATH/Source/C/bin/$cmd" "$@"=0D + fi=0D +elif [ -e "$dir/../../Source/C/bin/$cmd" ]=0D +then=0D + exec "$dir/../../Source/C/bin/$cmd" "$@"=0D +else=0D + echo "Unable to find the real '$cmd' to run"=0D + echo "This message was printed by"=0D + echo " $0"=0D + exit 127=0D +fi=0D +=0D diff --git a/BaseTools/BinPipWrappers/PosixLike/TargetTool b/BaseTools/BinP= ipWrappers/PosixLike/TargetTool=0D new file mode 100644=0D index 000000000000..9d143c7fc6c2=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/PosixLike/TargetTool=0D @@ -0,0 +1,12 @@=0D +#!/usr/bin/env bash=0D +#python `dirname $0`/RunToolFromSource.py `basename $0` $*=0D +=0D +# If a ${PYTHON_COMMAND} command is available, use it in preference to pyt= hon=0D +if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then=0D + python_exe=3D${PYTHON_COMMAND}=0D +fi=0D +=0D +full_cmd=3D${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028= for a discussion of why $0 is not a good choice here=0D +cmd=3D${full_cmd##*/}=0D +=0D +exec "${python_exe:-python}" -m edk2basetools.$cmd.$cmd "$@"=0D diff --git a/BaseTools/BinPipWrappers/PosixLike/TianoCompress b/BaseTools/B= inPipWrappers/PosixLike/TianoCompress=0D new file mode 100644=0D index 000000000000..a244ecc095e1=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/PosixLike/TianoCompress=0D @@ -0,0 +1,29 @@=0D +#!/usr/bin/env bash=0D +=0D +full_cmd=3D${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028= for a discussion of why $0 is not a good choice here=0D +dir=3D$(dirname "$full_cmd")=0D +cmd=3D${full_cmd##*/}=0D +=0D +if [ -n "$WORKSPACE" ] && [ -e "$WORKSPACE/Conf/BaseToolsCBinaries" ]=0D +then=0D + exec "$WORKSPACE/Conf/BaseToolsCBinaries/$cmd"=0D +elif [ -n "$WORKSPACE" ] && [ -e "$EDK_TOOLS_PATH/Source/C" ]=0D +then=0D + if [ ! -e "$EDK_TOOLS_PATH/Source/C/bin/$cmd" ]=0D + then=0D + echo "BaseTools C Tool binary was not found ($cmd)"=0D + echo "You may need to run:"=0D + echo " make -C $EDK_TOOLS_PATH/Source/C"=0D + else=0D + exec "$EDK_TOOLS_PATH/Source/C/bin/$cmd" "$@"=0D + fi=0D +elif [ -e "$dir/../../Source/C/bin/$cmd" ]=0D +then=0D + exec "$dir/../../Source/C/bin/$cmd" "$@"=0D +else=0D + echo "Unable to find the real '$cmd' to run"=0D + echo "This message was printed by"=0D + echo " $0"=0D + exit 127=0D +fi=0D +=0D diff --git a/BaseTools/BinPipWrappers/PosixLike/Trim b/BaseTools/BinPipWrap= pers/PosixLike/Trim=0D new file mode 100644=0D index 000000000000..0bd14ee03872=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/PosixLike/Trim=0D @@ -0,0 +1,13 @@=0D +#!/usr/bin/env bash=0D +#python `dirname $0`/RunToolFromSource.py `basename $0` $*=0D +=0D +# If a ${PYTHON_COMMAND} command is available, use it in preference to pyt= hon=0D +if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then=0D + python_exe=3D${PYTHON_COMMAND}=0D +fi=0D +=0D +full_cmd=3D${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028= for a discussion of why $0 is not a good choice here=0D +cmd=3D$(basename "$full_cmd")=0D +=0D +exec "${python_exe:-python}" -m edk2basetools.$cmd.$cmd "$@"=0D +=0D diff --git a/BaseTools/BinPipWrappers/PosixLike/UPT b/BaseTools/BinPipWrapp= ers/PosixLike/UPT=0D new file mode 100644=0D index 000000000000..75b934a5d0b5=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/PosixLike/UPT=0D @@ -0,0 +1,12 @@=0D +#!/usr/bin/env bash=0D +#python `dirname $0`/RunToolFromSource.py `basename $0` $*=0D +=0D +# If a ${PYTHON_COMMAND} command is available, use it in preference to pyt= hon=0D +if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then=0D + python_exe=3D${PYTHON_COMMAND}=0D +fi=0D +=0D +full_cmd=3D${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028= for a discussion of why $0 is not a good choice here=0D +cmd=3D${full_cmd##*/}=0D +=0D +exec "${python_exe:-python}" -m edk2basetools.$cmd.$cmd "$@"=0D \ No newline at end of file=0D diff --git a/BaseTools/BinPipWrappers/PosixLike/VfrCompile b/BaseTools/BinP= ipWrappers/PosixLike/VfrCompile=0D new file mode 100644=0D index 000000000000..a244ecc095e1=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/PosixLike/VfrCompile=0D @@ -0,0 +1,29 @@=0D +#!/usr/bin/env bash=0D +=0D +full_cmd=3D${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028= for a discussion of why $0 is not a good choice here=0D +dir=3D$(dirname "$full_cmd")=0D +cmd=3D${full_cmd##*/}=0D +=0D +if [ -n "$WORKSPACE" ] && [ -e "$WORKSPACE/Conf/BaseToolsCBinaries" ]=0D +then=0D + exec "$WORKSPACE/Conf/BaseToolsCBinaries/$cmd"=0D +elif [ -n "$WORKSPACE" ] && [ -e "$EDK_TOOLS_PATH/Source/C" ]=0D +then=0D + if [ ! -e "$EDK_TOOLS_PATH/Source/C/bin/$cmd" ]=0D + then=0D + echo "BaseTools C Tool binary was not found ($cmd)"=0D + echo "You may need to run:"=0D + echo " make -C $EDK_TOOLS_PATH/Source/C"=0D + else=0D + exec "$EDK_TOOLS_PATH/Source/C/bin/$cmd" "$@"=0D + fi=0D +elif [ -e "$dir/../../Source/C/bin/$cmd" ]=0D +then=0D + exec "$dir/../../Source/C/bin/$cmd" "$@"=0D +else=0D + echo "Unable to find the real '$cmd' to run"=0D + echo "This message was printed by"=0D + echo " $0"=0D + exit 127=0D +fi=0D +=0D diff --git a/BaseTools/BinPipWrappers/PosixLike/VolInfo b/BaseTools/BinPipW= rappers/PosixLike/VolInfo=0D new file mode 100644=0D index 000000000000..a244ecc095e1=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/PosixLike/VolInfo=0D @@ -0,0 +1,29 @@=0D +#!/usr/bin/env bash=0D +=0D +full_cmd=3D${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028= for a discussion of why $0 is not a good choice here=0D +dir=3D$(dirname "$full_cmd")=0D +cmd=3D${full_cmd##*/}=0D +=0D +if [ -n "$WORKSPACE" ] && [ -e "$WORKSPACE/Conf/BaseToolsCBinaries" ]=0D +then=0D + exec "$WORKSPACE/Conf/BaseToolsCBinaries/$cmd"=0D +elif [ -n "$WORKSPACE" ] && [ -e "$EDK_TOOLS_PATH/Source/C" ]=0D +then=0D + if [ ! -e "$EDK_TOOLS_PATH/Source/C/bin/$cmd" ]=0D + then=0D + echo "BaseTools C Tool binary was not found ($cmd)"=0D + echo "You may need to run:"=0D + echo " make -C $EDK_TOOLS_PATH/Source/C"=0D + else=0D + exec "$EDK_TOOLS_PATH/Source/C/bin/$cmd" "$@"=0D + fi=0D +elif [ -e "$dir/../../Source/C/bin/$cmd" ]=0D +then=0D + exec "$dir/../../Source/C/bin/$cmd" "$@"=0D +else=0D + echo "Unable to find the real '$cmd' to run"=0D + echo "This message was printed by"=0D + echo " $0"=0D + exit 127=0D +fi=0D +=0D diff --git a/BaseTools/BinPipWrappers/PosixLike/build b/BaseTools/BinPipWra= ppers/PosixLike/build=0D new file mode 100644=0D index 000000000000..9d143c7fc6c2=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/PosixLike/build=0D @@ -0,0 +1,12 @@=0D +#!/usr/bin/env bash=0D +#python `dirname $0`/RunToolFromSource.py `basename $0` $*=0D +=0D +# If a ${PYTHON_COMMAND} command is available, use it in preference to pyt= hon=0D +if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then=0D + python_exe=3D${PYTHON_COMMAND}=0D +fi=0D +=0D +full_cmd=3D${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028= for a discussion of why $0 is not a good choice here=0D +cmd=3D${full_cmd##*/}=0D +=0D +exec "${python_exe:-python}" -m edk2basetools.$cmd.$cmd "$@"=0D diff --git a/BaseTools/BinWrappers/PosixLike/posix_path_env.yaml b/BaseTool= s/BinPipWrappers/PosixLike/posix_path_env.yaml=0D similarity index 71%=0D copy from BaseTools/BinWrappers/PosixLike/posix_path_env.yaml=0D copy to BaseTools/BinPipWrappers/PosixLike/posix_path_env.yaml=0D index 8b32e010bb1d..eb1db9eb2511 100644=0D --- a/BaseTools/BinWrappers/PosixLike/posix_path_env.yaml=0D +++ b/BaseTools/BinPipWrappers/PosixLike/posix_path_env.yaml=0D @@ -5,6 +5,7 @@=0D # SPDX-License-Identifier: BSD-2-Clause-Patent=0D ##=0D {=0D - "scope": "global-nix",=0D + "scope": "pipbuild-unix",=0D + "override_id": "binwrappers",=0D "flags": ["set_path"]=0D }=0D diff --git a/BaseTools/BinPipWrappers/WindowsLike/AmlToC.bat b/BaseTools/Bi= nPipWrappers/WindowsLike/AmlToC.bat=0D new file mode 100644=0D index 000000000000..d347d6484467=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/WindowsLike/AmlToC.bat=0D @@ -0,0 +1,3 @@=0D +@setlocal=0D +@set ToolName=3D%~n0%=0D +@%PYTHON_COMMAND% -m edk2basetools.%ToolName%.%ToolName% %*=0D diff --git a/BaseTools/BinPipWrappers/WindowsLike/BPDG.bat b/BaseTools/BinP= ipWrappers/WindowsLike/BPDG.bat=0D new file mode 100644=0D index 000000000000..d347d6484467=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/WindowsLike/BPDG.bat=0D @@ -0,0 +1,3 @@=0D +@setlocal=0D +@set ToolName=3D%~n0%=0D +@%PYTHON_COMMAND% -m edk2basetools.%ToolName%.%ToolName% %*=0D diff --git a/BaseTools/BinPipWrappers/WindowsLike/BrotliCompress.bat b/Base= Tools/BinPipWrappers/WindowsLike/BrotliCompress.bat=0D new file mode 100644=0D index 000000000000..788c99a1307d=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/WindowsLike/BrotliCompress.bat=0D @@ -0,0 +1,55 @@=0D +@REM @file=0D +@REM This script will exec Brotli tool with -e/-d options.=0D +@REM=0D +@REM Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.=0D +@REM SPDX-License-Identifier: BSD-2-Clause-Patent=0D +@REM=0D +=0D +@echo off=0D +@setlocal=0D +=0D +set QLT=3D-q 9 -w 22=0D +set ARGS=3D=0D +=0D +:Begin=0D +if "%1"=3D=3D"" goto End=0D +=0D +if "%1"=3D=3D"-d" (=0D + set ARGS=3D%ARGS% %1=0D + shift=0D + goto Begin=0D +)=0D +=0D +if "%1"=3D=3D"-e" (=0D + shift=0D + goto Begin=0D +)=0D +=0D +if "%1"=3D=3D"-g" (=0D + set ARGS=3D%ARGS% %1 %2=0D + shift=0D + shift=0D + goto Begin=0D +)=0D +=0D +if "%1"=3D=3D"-o" (=0D + set ARGS=3D%ARGS% %1 %2=0D + shift=0D + shift=0D + goto Begin=0D +)=0D +=0D +if "%1"=3D=3D"-q" (=0D + set QLT=3D%1 %2=0D + shift=0D + shift=0D + goto Begin=0D +)=0D +=0D +set ARGS=3D%ARGS% %1=0D +shift=0D +goto Begin=0D +=0D +:End=0D +Brotli %QLT% %ARGS%=0D +@echo on=0D diff --git a/BaseTools/BinPipWrappers/WindowsLike/Ecc.bat b/BaseTools/BinPi= pWrappers/WindowsLike/Ecc.bat=0D new file mode 100644=0D index 000000000000..16a0a799a43b=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/WindowsLike/Ecc.bat=0D @@ -0,0 +1,3 @@=0D +@setlocal=0D +@set ToolName=3D%~n0%=0D +@%PYTHON_COMMAND% -m edk2basetools.%ToolName%.EccMain %*=0D diff --git a/BaseTools/BinPipWrappers/WindowsLike/GenDepex.bat b/BaseTools/= BinPipWrappers/WindowsLike/GenDepex.bat=0D new file mode 100644=0D index 000000000000..481b5ac47d24=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/WindowsLike/GenDepex.bat=0D @@ -0,0 +1,3 @@=0D +@setlocal=0D +@set ToolName=3D%~n0%=0D +@%PYTHON_COMMAND% -m edk2basetools.AutoGen.%ToolName% %*=0D diff --git a/BaseTools/BinPipWrappers/WindowsLike/GenFds.bat b/BaseTools/Bi= nPipWrappers/WindowsLike/GenFds.bat=0D new file mode 100644=0D index 000000000000..d347d6484467=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/WindowsLike/GenFds.bat=0D @@ -0,0 +1,3 @@=0D +@setlocal=0D +@set ToolName=3D%~n0%=0D +@%PYTHON_COMMAND% -m edk2basetools.%ToolName%.%ToolName% %*=0D diff --git a/BaseTools/BinPipWrappers/WindowsLike/GenPatchPcdTable.bat b/Ba= seTools/BinPipWrappers/WindowsLike/GenPatchPcdTable.bat=0D new file mode 100644=0D index 000000000000..d347d6484467=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/WindowsLike/GenPatchPcdTable.bat=0D @@ -0,0 +1,3 @@=0D +@setlocal=0D +@set ToolName=3D%~n0%=0D +@%PYTHON_COMMAND% -m edk2basetools.%ToolName%.%ToolName% %*=0D diff --git a/BaseTools/BinPipWrappers/WindowsLike/GenerateCapsule.bat b/Bas= eTools/BinPipWrappers/WindowsLike/GenerateCapsule.bat=0D new file mode 100644=0D index 000000000000..34c43ac7fc99=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/WindowsLike/GenerateCapsule.bat=0D @@ -0,0 +1 @@=0D +@%PYTHON_COMMAND% -m edk2basetools.Capsule.GenerateCapsule %*=0D diff --git a/BaseTools/BinPipWrappers/WindowsLike/PatchPcdValue.bat b/BaseT= ools/BinPipWrappers/WindowsLike/PatchPcdValue.bat=0D new file mode 100644=0D index 000000000000..d347d6484467=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/WindowsLike/PatchPcdValue.bat=0D @@ -0,0 +1,3 @@=0D +@setlocal=0D +@set ToolName=3D%~n0%=0D +@%PYTHON_COMMAND% -m edk2basetools.%ToolName%.%ToolName% %*=0D diff --git a/BaseTools/BinPipWrappers/WindowsLike/Pkcs7Sign.bat b/BaseTools= /BinPipWrappers/WindowsLike/Pkcs7Sign.bat=0D new file mode 100644=0D index 000000000000..d347d6484467=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/WindowsLike/Pkcs7Sign.bat=0D @@ -0,0 +1,3 @@=0D +@setlocal=0D +@set ToolName=3D%~n0%=0D +@%PYTHON_COMMAND% -m edk2basetools.%ToolName%.%ToolName% %*=0D diff --git a/BaseTools/BinPipWrappers/WindowsLike/Rsa2048Sha256GenerateKeys= .bat b/BaseTools/BinPipWrappers/WindowsLike/Rsa2048Sha256GenerateKeys.bat=0D new file mode 100644=0D index 000000000000..cdc2e3ea373d=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/WindowsLike/Rsa2048Sha256GenerateKeys.bat=0D @@ -0,0 +1 @@=0D +@%PYTHON_COMMAND% -m edk2basetools.Rsa2048Sha256Sign.Rsa2048Sha256Generate= Keys %*=0D diff --git a/BaseTools/BinPipWrappers/WindowsLike/Rsa2048Sha256Sign.bat b/B= aseTools/BinPipWrappers/WindowsLike/Rsa2048Sha256Sign.bat=0D new file mode 100644=0D index 000000000000..d347d6484467=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/WindowsLike/Rsa2048Sha256Sign.bat=0D @@ -0,0 +1,3 @@=0D +@setlocal=0D +@set ToolName=3D%~n0%=0D +@%PYTHON_COMMAND% -m edk2basetools.%ToolName%.%ToolName% %*=0D diff --git a/BaseTools/BinPipWrappers/WindowsLike/TargetTool.bat b/BaseTool= s/BinPipWrappers/WindowsLike/TargetTool.bat=0D new file mode 100644=0D index 000000000000..d347d6484467=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/WindowsLike/TargetTool.bat=0D @@ -0,0 +1,3 @@=0D +@setlocal=0D +@set ToolName=3D%~n0%=0D +@%PYTHON_COMMAND% -m edk2basetools.%ToolName%.%ToolName% %*=0D diff --git a/BaseTools/BinPipWrappers/WindowsLike/Trim.bat b/BaseTools/BinP= ipWrappers/WindowsLike/Trim.bat=0D new file mode 100644=0D index 000000000000..d347d6484467=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/WindowsLike/Trim.bat=0D @@ -0,0 +1,3 @@=0D +@setlocal=0D +@set ToolName=3D%~n0%=0D +@%PYTHON_COMMAND% -m edk2basetools.%ToolName%.%ToolName% %*=0D diff --git a/BaseTools/BinPipWrappers/WindowsLike/UPT.bat b/BaseTools/BinPi= pWrappers/WindowsLike/UPT.bat=0D new file mode 100644=0D index 000000000000..d347d6484467=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/WindowsLike/UPT.bat=0D @@ -0,0 +1,3 @@=0D +@setlocal=0D +@set ToolName=3D%~n0%=0D +@%PYTHON_COMMAND% -m edk2basetools.%ToolName%.%ToolName% %*=0D diff --git a/BaseTools/BinPipWrappers/WindowsLike/build.bat b/BaseTools/Bin= PipWrappers/WindowsLike/build.bat=0D new file mode 100644=0D index 000000000000..d347d6484467=0D --- /dev/null=0D +++ b/BaseTools/BinPipWrappers/WindowsLike/build.bat=0D @@ -0,0 +1,3 @@=0D +@setlocal=0D +@set ToolName=3D%~n0%=0D +@%PYTHON_COMMAND% -m edk2basetools.%ToolName%.%ToolName% %*=0D diff --git a/BaseTools/BinWrappers/WindowsLike/win_build_tools_path_env.yam= l b/BaseTools/BinPipWrappers/WindowsLike/win_build_tools_path_env.yaml=0D similarity index 70%=0D copy from BaseTools/BinWrappers/WindowsLike/win_build_tools_path_env.yaml=0D copy to BaseTools/BinPipWrappers/WindowsLike/win_build_tools_path_env.yaml= =0D index 83f5856e75c6..9fdbe1bcb06b 100644=0D --- a/BaseTools/BinWrappers/WindowsLike/win_build_tools_path_env.yaml=0D +++ b/BaseTools/BinPipWrappers/WindowsLike/win_build_tools_path_env.yaml=0D @@ -5,6 +5,7 @@=0D # SPDX-License-Identifier: BSD-2-Clause-Patent=0D ##=0D {=0D - "scope": "global-win",=0D + "scope": "pipbuild-win",=0D + "override_id": "binwrappers",=0D "flags": ["set_path"]=0D }=0D diff --git a/BaseTools/BinWrappers/PosixLike/posix_path_env.yaml b/BaseTool= s/BinWrappers/PosixLike/posix_path_env.yaml=0D index 8b32e010bb1d..99529235ec9a 100644=0D --- a/BaseTools/BinWrappers/PosixLike/posix_path_env.yaml=0D +++ b/BaseTools/BinWrappers/PosixLike/posix_path_env.yaml=0D @@ -5,6 +5,7 @@=0D # SPDX-License-Identifier: BSD-2-Clause-Patent=0D ##=0D {=0D + "id": "binwrappers",=0D "scope": "global-nix",=0D "flags": ["set_path"]=0D }=0D diff --git a/BaseTools/BinWrappers/WindowsLike/win_build_tools_path_env.yam= l b/BaseTools/BinWrappers/WindowsLike/win_build_tools_path_env.yaml=0D index 83f5856e75c6..43da76f354e5 100644=0D --- a/BaseTools/BinWrappers/WindowsLike/win_build_tools_path_env.yaml=0D +++ b/BaseTools/BinWrappers/WindowsLike/win_build_tools_path_env.yaml=0D @@ -5,6 +5,7 @@=0D # SPDX-License-Identifier: BSD-2-Clause-Patent=0D ##=0D {=0D + "id": "binwrappers",=0D "scope": "global-win",=0D "flags": ["set_path"]=0D }=0D diff --git a/BaseTools/BuildEnv b/BaseTools/BuildEnv=0D index 5943bb9ef908..cc8e92db6558 100755=0D --- a/BaseTools/BuildEnv=0D +++ b/BaseTools/BuildEnv=0D @@ -1,269 +1,279 @@=0D -## @file=0D -# Setup the environment for unix-like systems running a bash-like shell.=0D -# This file must be "sourced" not merely executed. For example: ". edksetu= p.sh"=0D -#=0D -# Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
=0D -# Copyright (c) 2016, Linaro Ltd. All rights reserved.
=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -=0D -SetWorkspace() {=0D -=0D - #=0D - # If WORKSPACE is already set, then we can return right now=0D - #=0D - if [ -n "$WORKSPACE" ]=0D - then=0D - return 0=0D - fi=0D -=0D - #=0D - # Set $WORKSPACE=0D - #=0D - export WORKSPACE=3D`pwd`=0D -=0D - return 0=0D -=0D -}=0D -=0D -RestorePreviousConfiguration() {=0D - #=0D - # Restore previous configuration=0D - #=0D - if [ -z "$CONF_PATH" ]=0D - then=0D - export CONF_PATH=3D$WORKSPACE/Conf=0D - if [ ! -d $WORKSPACE/Conf ] && [ -n "$PACKAGES_PATH" ]=0D - then=0D - PATH_LIST=3D${PACKAGES_PATH//:/ }=0D - for DIR in $PATH_LIST=0D - do=0D - if [ -d $DIR/Conf ]=0D - then=0D - export CONF_PATH=3D$DIR/Conf=0D - break=0D - fi=0D - done=0D - fi=0D - fi=0D - =0D - PREVIOUS_CONF_FILE=3D$CONF_PATH/BuildEnv.sh=0D - if [ -e $PREVIOUS_CONF_FILE ]=0D - then=0D - echo Loading previous configuration from $PREVIOUS_CONF_FILE=0D - . $PREVIOUS_CONF_FILE=0D - fi=0D -}=0D -=0D -GenerateShellCodeToSetVariable() {=0D - VARIABLE=3D$1=0D - OUTPUT_FILE=3D$2=0D - VAR_VALUE=3D"echo \${${VARIABLE}}"=0D - VAR_VALUE=3D`eval $VAR_VALUE`=0D - echo "if [ -z \"\$${VARIABLE}\" ]" >> $OUTPUT_FILE=0D - echo "then" >> $OUTPUT_FILE=0D - echo " export ${VARIABLE}=3D${VAR_VALUE}" >> $OUTPUT_FILE=0D - echo "fi" >> $OUTPUT_FILE=0D -}=0D -=0D -GenerateShellCodeToUpdatePath() {=0D - OUTPUT_FILE=3D$1=0D - echo "if [ -e $EDK_TOOLS_PATH_BIN ]" >> $OUTPUT_F= ILE=0D - echo "then" >> $OUTPUT_F= ILE=0D - echo " if [ "\${PATH/$EDK_TOOLS_PATH_BIN/}" =3D=3D "\$PATH" ]" >> $OUTP= UT_FILE=0D - echo " then" >> $OUTPUT_F= ILE=0D - echo " export PATH=3D$EDK_TOOLS_PATH_BIN:\$PATH" >> $OUTPUT= _FILE=0D - echo " fi" >> $OUTPUT_F= ILE=0D - echo "fi" >> $OUTPUT_F= ILE=0D -}=0D -=0D -StoreCurrentConfiguration() {=0D - #=0D - # Write configuration to a shell script to allow for configuration to be= =0D - # easily reloaded.=0D - #=0D - OUTPUT_FILE=3D$CONF_PATH/BuildEnv.sh=0D - #echo Storing current configuration into $OUTPUT_FILE=0D - echo "# Auto-generated by ${BASH_SOURCE[0]}" >| $OUTPUT_FILE=0D - GenerateShellCodeToSetVariable WORKSPACE $OUTPUT_FILE=0D - GenerateShellCodeToSetVariable EDK_TOOLS_PATH $OUTPUT_FILE=0D - GenerateShellCodeToUpdatePath $OUTPUT_FILE=0D -}=0D -=0D -SetEdkToolsPath() {=0D -=0D - #=0D - # If EDK_TOOLS_PATH is already set, then we can return right now=0D - #=0D - if [ -n "$EDK_TOOLS_PATH" ]=0D - then=0D - return 0=0D - fi=0D -=0D - #=0D - # Try $CONF_PATH/EdkTools=0D - #=0D - if [ -e $CONF_PATH/EdkTools ]=0D - then=0D - export EDK_TOOLS_PATH=3D$CONF_PATH/EdkTools=0D - return 0=0D - fi=0D -=0D - #=0D - # Try $CONF_PATH/BaseToolsSource=0D - #=0D - if [ -e $CONF_PATH/BaseToolsSource ]=0D - then=0D - export EDK_TOOLS_PATH=3D$CONF_PATH/BaseToolsSource=0D - return 0=0D - fi=0D -=0D - #=0D - # Try $WORKSPACE/BaseTools=0D - #=0D - if [ -e $WORKSPACE/BaseTools ]=0D - then=0D - export EDK_TOOLS_PATH=3D$WORKSPACE/BaseTools=0D - return 0=0D - fi=0D -=0D - #=0D - # Try $PACKAGES_PATH=0D - #=0D - if [ -n "$PACKAGES_PATH"]=0D - then=0D - PATH_LIST=3D${PACKAGES_PATH//:/ }=0D - for DIR in $PATH_LIST=0D - do=0D - if [ -d $DIR/BaseTools ]=0D - then=0D - export EDK_TOOLS_PATH=3D$DIR/BaseTools=0D - return 0=0D - fi=0D - done=0D - fi=0D -=0D - echo "Unable to determine EDK_TOOLS_PATH"=0D - echo=0D - echo "You may need to download the 'BaseTools' from buildtools.tianocore= .org."=0D - echo "After downloading, either create a symbolic link to the source at"= =0D - echo "\$WORKSPACE/Conf/BaseToolsSource, or set the EDK_TOOLS_PATH enviro= nment"=0D - echo "variable."=0D -=0D -}=0D -=0D -GetBaseToolsBinSubDir() {=0D - #=0D - # Figure out a uniq directory name from the uname command=0D - #=0D - UNAME_DIRNAME=3D`uname -sm`=0D - UNAME_DIRNAME=3D${UNAME_DIRNAME// /-}=0D - UNAME_DIRNAME=3D${UNAME_DIRNAME//\//-}=0D - echo $UNAME_DIRNAME=0D -}=0D -=0D -GetEdkToolsPathBinDirectory() {=0D - #=0D - # Figure out a uniq directory name from the uname command=0D - #=0D - BIN_SUB_DIR=3D`GetBaseToolsBinSubDir`=0D -=0D - if [ -e $EDK_TOOLS_PATH/BinWrappers/$BIN_SUB_DIR ]=0D - then=0D - EDK_TOOLS_PATH_BIN=3D$EDK_TOOLS_PATH/BinWrappers/$BIN_SUB_DIR=0D - else=0D - EDK_TOOLS_PATH_BIN=3D$EDK_TOOLS_PATH/Bin/$BIN_SUB_DIR=0D - fi=0D -=0D - echo $EDK_TOOLS_PATH_BIN=0D -}=0D -=0D -AddDirToStartOfPath() {=0D - DIRNAME=3D$1=0D - PATH=3D$DIRNAME:$DIRNAME:$DIRNAME:$PATH=0D - PATH=3D${PATH//$DIRNAME:/}=0D - PATH=3D$DIRNAME:$PATH=0D - export PATH=0D -}=0D -=0D -AddEdkToolsToPath() {=0D -=0D - #=0D - # If EDK_TOOLS_PATH is not set, then we cannot update PATH=0D - #=0D - if [ -z "$EDK_TOOLS_PATH" ]=0D - then=0D - return 1=0D - fi=0D -=0D - EDK_TOOLS_PATH_BIN=3D`GetEdkToolsPathBinDirectory`=0D -=0D - AddDirToStartOfPath $EDK_TOOLS_PATH/BinWrappers/PosixLike=0D - AddDirToStartOfPath $EDK_TOOLS_PATH_BIN=0D -=0D -}=0D -=0D -CopySingleTemplateFile() {=0D -=0D - SRC_FILENAME=3DConf/$1.template=0D - DST_FILENAME=3D$CONF_PATH/$1.txt=0D -=0D - if [ -e $DST_FILENAME ]=0D - then=0D - [ $RECONFIG !=3D TRUE ] && return=0D - fi=0D -=0D - echo "Copying \$EDK_TOOLS_PATH/$SRC_FILENAME"=0D - echo " to $DST_FILENAME"=0D - SRC_FILENAME=3D$EDK_TOOLS_PATH/$SRC_FILENAME=0D - cp $SRC_FILENAME $DST_FILENAME=0D -=0D -}=0D -=0D -CopyTemplateFiles() {=0D -=0D - CopySingleTemplateFile build_rule=0D - CopySingleTemplateFile tools_def=0D - CopySingleTemplateFile target=0D -=0D -}=0D -=0D -ScriptMain() {=0D -=0D - SetWorkspace=0D - if [ -z $WORKSPACE ]=0D - then=0D - echo "Failure setting WORKSPACE"=0D - return 1=0D - fi=0D -=0D - RestorePreviousConfiguration=0D -=0D - SetEdkToolsPath=0D - if [ -z $EDK_TOOLS_PATH ]=0D - then=0D - return 1=0D - fi=0D -=0D - AddEdkToolsToPath=0D - if [ $? -ne 0 ]=0D - then=0D - echo "Failure adding EDK Tools into PATH!"=0D - return 1=0D - fi=0D -=0D - StoreCurrentConfiguration=0D -=0D - echo WORKSPACE: $WORKSPACE=0D - echo EDK_TOOLS_PATH: $EDK_TOOLS_PATH=0D - echo CONF_PATH: $CONF_PATH=0D -=0D - CopyTemplateFiles=0D -=0D -}=0D -=0D -#=0D -# Run the main function=0D -#=0D -ScriptMain=0D -=0D +## @file=0D +# Setup the environment for unix-like systems running a bash-like shell.=0D +# This file must be "sourced" not merely executed. For example: ". edksetu= p.sh"=0D +#=0D +# Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
=0D +# Copyright (c) 2016, Linaro Ltd. All rights reserved.
=0D +# SPDX-License-Identifier: BSD-2-Clause-Patent=0D +#=0D +=0D +SetWorkspace() {=0D +=0D + #=0D + # If WORKSPACE is already set, then we can return right now=0D + #=0D + if [ -n "$WORKSPACE" ]=0D + then=0D + return 0=0D + fi=0D +=0D + #=0D + # Set $WORKSPACE=0D + #=0D + export WORKSPACE=3D`pwd`=0D +=0D + return 0=0D +=0D +}=0D +=0D +RestorePreviousConfiguration() {=0D + #=0D + # Restore previous configuration=0D + #=0D + if [ -z "$CONF_PATH" ]=0D + then=0D + export CONF_PATH=3D$WORKSPACE/Conf=0D + if [ ! -d $WORKSPACE/Conf ] && [ -n "$PACKAGES_PATH" ]=0D + then=0D + PATH_LIST=3D${PACKAGES_PATH//:/ }=0D + for DIR in $PATH_LIST=0D + do=0D + if [ -d $DIR/Conf ]=0D + then=0D + export CONF_PATH=3D$DIR/Conf=0D + break=0D + fi=0D + done=0D + fi=0D + fi=0D +=0D + PREVIOUS_CONF_FILE=3D$CONF_PATH/BuildEnv.sh=0D + if [ -e $PREVIOUS_CONF_FILE ]=0D + then=0D + echo Loading previous configuration from $PREVIOUS_CONF_FILE=0D + . $PREVIOUS_CONF_FILE=0D + fi=0D +}=0D +=0D +GenerateShellCodeToSetVariable() {=0D + VARIABLE=3D$1=0D + OUTPUT_FILE=3D$2=0D + VAR_VALUE=3D"echo \${${VARIABLE}}"=0D + VAR_VALUE=3D`eval $VAR_VALUE`=0D + echo "if [ -z \"\$${VARIABLE}\" ]" >> $OUTPUT_FILE=0D + echo "then" >> $OUTPUT_FILE=0D + echo " export ${VARIABLE}=3D${VAR_VALUE}" >> $OUTPUT_FILE=0D + echo "fi" >> $OUTPUT_FILE=0D +}=0D +=0D +GenerateShellCodeToUpdatePath() {=0D + OUTPUT_FILE=3D$1=0D + echo "if [ -e $EDK_TOOLS_PATH_BIN ]" >> $OUTPUT_F= ILE=0D + echo "then" >> $OUTPUT_F= ILE=0D + echo " if [ "\${PATH/$EDK_TOOLS_PATH_BIN/}" =3D=3D "\$PATH" ]" >> $OUTP= UT_FILE=0D + echo " then" >> $OUTPUT_F= ILE=0D + echo " export PATH=3D$EDK_TOOLS_PATH_BIN:\$PATH" >> $OUTPUT= _FILE=0D + echo " fi" >> $OUTPUT_F= ILE=0D + echo "fi" >> $OUTPUT_F= ILE=0D +}=0D +=0D +StoreCurrentConfiguration() {=0D + #=0D + # Write configuration to a shell script to allow for configuration to be= =0D + # easily reloaded.=0D + #=0D + OUTPUT_FILE=3D$CONF_PATH/BuildEnv.sh=0D + #echo Storing current configuration into $OUTPUT_FILE=0D + echo "# Auto-generated by ${BASH_SOURCE[0]}" >| $OUTPUT_FILE=0D + GenerateShellCodeToSetVariable WORKSPACE $OUTPUT_FILE=0D + GenerateShellCodeToSetVariable EDK_TOOLS_PATH $OUTPUT_FILE=0D + GenerateShellCodeToUpdatePath $OUTPUT_FILE=0D +}=0D +=0D +SetEdkToolsPath() {=0D +=0D + #=0D + # If EDK_TOOLS_PATH is already set, then we can return right now=0D + #=0D + if [ -n "$EDK_TOOLS_PATH" ]=0D + then=0D + return 0=0D + fi=0D +=0D + #=0D + # Try $CONF_PATH/EdkTools=0D + #=0D + if [ -e $CONF_PATH/EdkTools ]=0D + then=0D + export EDK_TOOLS_PATH=3D$CONF_PATH/EdkTools=0D + return 0=0D + fi=0D +=0D + #=0D + # Try $CONF_PATH/BaseToolsSource=0D + #=0D + if [ -e $CONF_PATH/BaseToolsSource ]=0D + then=0D + export EDK_TOOLS_PATH=3D$CONF_PATH/BaseToolsSource=0D + return 0=0D + fi=0D +=0D + #=0D + # Try $WORKSPACE/BaseTools=0D + #=0D + if [ -e $WORKSPACE/BaseTools ]=0D + then=0D + export EDK_TOOLS_PATH=3D$WORKSPACE/BaseTools=0D + return 0=0D + fi=0D +=0D + #=0D + # Try $PACKAGES_PATH=0D + #=0D + if [ -n "$PACKAGES_PATH"]=0D + then=0D + PATH_LIST=3D${PACKAGES_PATH//:/ }=0D + for DIR in $PATH_LIST=0D + do=0D + if [ -d $DIR/BaseTools ]=0D + then=0D + export EDK_TOOLS_PATH=3D$DIR/BaseTools=0D + return 0=0D + fi=0D + done=0D + fi=0D +=0D + echo "Unable to determine EDK_TOOLS_PATH"=0D + echo=0D + echo "You may need to download the 'BaseTools' from buildtools.tianocore= .org."=0D + echo "After downloading, either create a symbolic link to the source at"= =0D + echo "\$WORKSPACE/Conf/BaseToolsSource, or set the EDK_TOOLS_PATH enviro= nment"=0D + echo "variable."=0D +=0D +}=0D +=0D +GetBaseToolsBinSubDir() {=0D + #=0D + # Figure out a uniq directory name from the uname command=0D + #=0D + UNAME_DIRNAME=3D`uname -sm`=0D + UNAME_DIRNAME=3D${UNAME_DIRNAME// /-}=0D + UNAME_DIRNAME=3D${UNAME_DIRNAME//\//-}=0D + echo $UNAME_DIRNAME=0D +}=0D +=0D +GetEdkToolsPathBinDirectory() {=0D + #=0D + # Figure out a uniq directory name from the uname command=0D + #=0D + BIN_SUB_DIR=3D`GetBaseToolsBinSubDir`=0D +=0D + if [ -e $EDK_TOOLS_PATH/BinWrappers/$BIN_SUB_DIR ]=0D + then=0D + EDK_TOOLS_PATH_BIN=3D$EDK_TOOLS_PATH/BinWrappers/$BIN_SUB_DIR=0D + else=0D + EDK_TOOLS_PATH_BIN=3D$EDK_TOOLS_PATH/Bin/$BIN_SUB_DIR=0D + fi=0D +=0D + echo $EDK_TOOLS_PATH_BIN=0D +}=0D +=0D +AddDirToStartOfPath() {=0D + DIRNAME=3D$1=0D + PATH=3D$DIRNAME:$DIRNAME:$DIRNAME:$PATH=0D + PATH=3D${PATH//$DIRNAME:/}=0D + PATH=3D$DIRNAME:$PATH=0D + export PATH=0D +}=0D +=0D +AddEdkToolsToPath() {=0D +=0D + #=0D + # If EDK_TOOLS_PATH is not set, then we cannot update PATH=0D + #=0D + if [ -z "$EDK_TOOLS_PATH" ]=0D + then=0D + return 1=0D + fi=0D +=0D + EDK_TOOLS_PATH_BIN=3D`GetEdkToolsPathBinDirectory`=0D +=0D + # check if the edk2basetools pip package is available=0D + if $PYTHON_COMMAND -c "import edk2basetools" &> /dev/null; then=0D + # if it is, use the pip version of the wrappers=0D + echo "Using Pip Basetools"=0D + AddDirToStartOfPath $EDK_TOOLS_PATH/BinPipWrappers/PosixLike=0D + else=0D + echo "Using EDK2 in-source Basetools"=0D + AddDirToStartOfPath $EDK_TOOLS_PATH/BinWrappers/PosixLike=0D + fi=0D +=0D +=0D + AddDirToStartOfPath $EDK_TOOLS_PATH_BIN=0D +=0D +}=0D +=0D +CopySingleTemplateFile() {=0D +=0D + SRC_FILENAME=3DConf/$1.template=0D + DST_FILENAME=3D$CONF_PATH/$1.txt=0D +=0D + if [ -e $DST_FILENAME ]=0D + then=0D + [ $RECONFIG !=3D TRUE ] && return=0D + fi=0D +=0D + echo "Copying \$EDK_TOOLS_PATH/$SRC_FILENAME"=0D + echo " to $DST_FILENAME"=0D + SRC_FILENAME=3D$EDK_TOOLS_PATH/$SRC_FILENAME=0D + cp $SRC_FILENAME $DST_FILENAME=0D +=0D +}=0D +=0D +CopyTemplateFiles() {=0D +=0D + CopySingleTemplateFile build_rule=0D + CopySingleTemplateFile tools_def=0D + CopySingleTemplateFile target=0D +=0D +}=0D +=0D +ScriptMain() {=0D +=0D + SetWorkspace=0D + if [ -z $WORKSPACE ]=0D + then=0D + echo "Failure setting WORKSPACE"=0D + return 1=0D + fi=0D +=0D + RestorePreviousConfiguration=0D +=0D + SetEdkToolsPath=0D + if [ -z $EDK_TOOLS_PATH ]=0D + then=0D + return 1=0D + fi=0D +=0D + AddEdkToolsToPath=0D + if [ $? -ne 0 ]=0D + then=0D + echo "Failure adding EDK Tools into PATH!"=0D + return 1=0D + fi=0D +=0D + StoreCurrentConfiguration=0D +=0D + echo WORKSPACE: $WORKSPACE=0D + echo EDK_TOOLS_PATH: $EDK_TOOLS_PATH=0D + echo CONF_PATH: $CONF_PATH=0D +=0D + CopyTemplateFiles=0D +=0D +}=0D +=0D +#=0D +# Run the main function=0D +#=0D +ScriptMain=0D +=0D diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck= .py=0D index 68c984ed0e4d..80754e763c5a 100755=0D --- a/BaseTools/Scripts/PatchCheck.py=0D +++ b/BaseTools/Scripts/PatchCheck.py=0D @@ -359,6 +359,7 @@ class GitDiffCheck:=0D self.force_notabs =3D True=0D if self.filename.endswith('.sh') or \=0D self.filename.startswith('BaseTools/BinWrappers/PosixL= ike/') or \=0D + self.filename.startswith('BaseTools/BinPipWrappers/Pos= ixLike/') or \=0D self.filename.startswith('BaseTools/Bin/CYGWIN_NT-5.1-= i686/') or \=0D self.filename =3D=3D 'BaseTools/BuildEnv':=0D #=0D diff --git a/BaseTools/toolsetup.bat b/BaseTools/toolsetup.bat=0D index 61ebf4ae09bc..4b5256ab6e93 100755=0D --- a/BaseTools/toolsetup.bat=0D +++ b/BaseTools/toolsetup.bat=0D @@ -393,12 +393,31 @@ goto end=0D goto check_freezer_path=0D )=0D =0D +=0D +=0D :check_freezer_path=0D endlocal=0D +=0D + %PYTHON_COMMAND% -c "import edk2basetools" >NUL 2>NUL=0D + if %ERRORLEVEL% EQU 0 (=0D + goto use_pip_basetools=0D + ) else (=0D + goto use_builtin_basetools=0D + )=0D +=0D +:use_builtin_basetools=0D + @echo Using EDK2 in-source Basetools=0D if defined BASETOOLS_PYTHON_SOURCE goto print_python_info=0D set "PATH=3D%BASE_TOOLS_PATH%\BinWrappers\WindowsLike;%PATH%"=0D set BASETOOLS_PYTHON_SOURCE=3D%BASE_TOOLS_PATH%\Source\Python=0D set PYTHONPATH=3D%BASETOOLS_PYTHON_SOURCE%;%PYTHONPATH%=0D + goto print_python_info=0D +=0D +:use_pip_basetools=0D + @echo Using Pip Basetools=0D + set "PATH=3D%BASE_TOOLS_PATH%\BinPipWrappers\WindowsLike;%PATH%"=0D + set BASETOOLS_PYTHON_SOURCE=3Dedk2basetools=0D + goto print_python_info=0D =0D :print_python_info=0D echo PATH =3D %PATH%=0D diff --git a/pip-requirements.txt b/pip-requirements.txt=0D index 0fecd37f2a83..0ab18eaea64e 100644=0D --- a/pip-requirements.txt=0D +++ b/pip-requirements.txt=0D @@ -14,4 +14,5 @@=0D =0D edk2-pytool-library=3D=3D0.10.*=0D edk2-pytool-extensions~=3D0.13.3=0D +edk2-basetools=3D=3D0.1.0=0D antlr4-python3-runtime=3D=3D4.7.1=0D -- =0D 2.28.0.vfs.0.0=0D =0D