From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web11.4843.1612425870842977256 for ; Thu, 04 Feb 2021 00:04:34 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: gaoliming@byosoft.com.cn) Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Thu, 04 Feb 2021 16:04:16 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: , Cc: "'Bob Feng'" , "'Yuwei Chen'" References: <20210128211720.1317-1-matthewfcarlson@gmail.com> <20210128211720.1317-2-matthewfcarlson@gmail.com> In-Reply-To: <20210128211720.1317-2-matthewfcarlson@gmail.com> Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0gW1BBVENIIHY0IDEvMV0gQmFzZVRvb2xzOiBVc2UgcGlwIG1vZHVsZSBpZiBhdmFpbGFibGUsIENJIHVzZXMgaXQgYnkgZGVmYXVsdA==?= Date: Thu, 4 Feb 2021 16:04:24 +0800 Message-ID: <007401d6facc$5a768f00$0f63ad00$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQIDhyfhffHNTLphl63JPXC3a2J3NgHkYmZBqd9mKyA= Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Matthew: I compare BaseTools\BinWrappers and BaseTools\BinPipWrappers. There = are two different files.=20 1. New added BaseTools\BinWrappers\WindowsLike\Split.bat should be added into BaseTools\BinPipWrappers 2. BaseTools\BinPipWrappers\WindowsLike\BrotliCompress.bat has been = removed. It is also removed from BaseTools\BinPipWrappers Thanks Liming > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > =B7=A2=BC=FE=C8=CB: bounce+27952+70867+4905953+8761045@groups.io > =B4=FA=B1=ED Matthew > Carlson > =B7=A2=CB=CD=CA=B1=BC=E4: 2021=C4=EA1=D4=C229=C8=D5 5:17 > =CA=D5=BC=FE=C8=CB: devel@edk2.groups.io > =B3=AD=CB=CD: Bob Feng ; Liming Gao > ; Yuwei Chen ; > Matthew Carlson > =D6=F7=CC=E2: [edk2-devel] [PATCH v4 1/1] BaseTools: Use pip module if = available, CI > uses it by default >=20 > From: Matthew Carlson >=20 > Use the new edk2-basetools pip module. > Includes a helpful message in setup to let users know which has been > selected. >=20 > Cc: Bob Feng > Cc: Liming Gao > Cc: Yuwei Chen >=20 > Reviewed-by: Bob Feng >=20 > Signed-off-by: Matthew Carlson > --- > .pytool/CISettings.py > | 51 +++++++++++++----- > BaseTools/BinPipWrappers/PosixLike/AmlToC > | 14 +++++ > BaseTools/BinPipWrappers/PosixLike/BPDG > | 12 +++++ > BaseTools/BinPipWrappers/PosixLike/BrotliCompress > | 34 ++++++++++++ > BaseTools/BinPipWrappers/PosixLike/DevicePath > | 29 +++++++++++ > BaseTools/BinPipWrappers/PosixLike/Ecc > | 13 +++++ > BaseTools/BinPipWrappers/PosixLike/EfiRom > | 29 +++++++++++ > BaseTools/BinPipWrappers/PosixLike/GenCrc32 > | 29 +++++++++++ > BaseTools/BinPipWrappers/PosixLike/GenDepex > | 12 +++++ > BaseTools/BinPipWrappers/PosixLike/GenFds > | 12 +++++ > BaseTools/BinPipWrappers/PosixLike/GenFfs > | 29 +++++++++++ > BaseTools/BinPipWrappers/PosixLike/GenFv > | 29 +++++++++++ > BaseTools/BinPipWrappers/PosixLike/GenFw > | 29 +++++++++++ > BaseTools/BinPipWrappers/PosixLike/GenPatchPcdTable > | 12 +++++ > BaseTools/BinPipWrappers/PosixLike/GenSec > | 29 +++++++++++ > BaseTools/BinPipWrappers/PosixLike/GenerateCapsule > | 12 +++++ > BaseTools/BinPipWrappers/PosixLike/LzmaCompress > | 29 +++++++++++ > BaseTools/BinPipWrappers/PosixLike/LzmaF86Compress > | 19 +++++++ > BaseTools/BinPipWrappers/PosixLike/PatchPcdValue > | 12 +++++ > BaseTools/BinPipWrappers/PosixLike/Pkcs7Sign > | 12 +++++ > BaseTools/BinPipWrappers/PosixLike/Rsa2048Sha256GenerateKeys > | 12 +++++ > BaseTools/BinPipWrappers/PosixLike/Rsa2048Sha256Sign > | 12 +++++ > BaseTools/BinPipWrappers/PosixLike/Split > | 29 +++++++++++ > BaseTools/BinPipWrappers/PosixLike/TargetTool > | 12 +++++ > BaseTools/BinPipWrappers/PosixLike/TianoCompress > | 29 +++++++++++ > BaseTools/BinPipWrappers/PosixLike/Trim > | 13 +++++ > BaseTools/BinPipWrappers/PosixLike/UPT > | 12 +++++ > BaseTools/BinPipWrappers/PosixLike/VfrCompile > | 29 +++++++++++ > BaseTools/BinPipWrappers/PosixLike/VolInfo > | 29 +++++++++++ > BaseTools/BinPipWrappers/PosixLike/build > | 12 +++++ > BaseTools/{BinWrappers =3D> > BinPipWrappers}/PosixLike/posix_path_env.yaml | 21 > ++++---- > BaseTools/BinPipWrappers/WindowsLike/AmlToC.bat > | 3 ++ > BaseTools/BinPipWrappers/WindowsLike/BPDG.bat > | 3 ++ > BaseTools/BinPipWrappers/WindowsLike/BrotliCompress.bat > | 55 ++++++++++++++++++++ > BaseTools/BinPipWrappers/WindowsLike/Ecc.bat > | 3 ++ > BaseTools/BinPipWrappers/WindowsLike/GenDepex.bat > | 3 ++ > BaseTools/BinPipWrappers/WindowsLike/GenFds.bat > | 3 ++ > BaseTools/BinPipWrappers/WindowsLike/GenPatchPcdTable.bat > | 3 ++ > BaseTools/BinPipWrappers/WindowsLike/GenerateCapsule.bat > | 1 + > BaseTools/BinPipWrappers/WindowsLike/PatchPcdValue.bat > | 3 ++ > BaseTools/BinPipWrappers/WindowsLike/Pkcs7Sign.bat > | 3 ++ > BaseTools/BinPipWrappers/WindowsLike/Rsa2048Sha256GenerateKeys.bat > | 1 + > BaseTools/BinPipWrappers/WindowsLike/Rsa2048Sha256Sign.bat > | 3 ++ > BaseTools/BinPipWrappers/WindowsLike/TargetTool.bat > | 3 ++ > BaseTools/BinPipWrappers/WindowsLike/Trim.bat > | 3 ++ > BaseTools/BinPipWrappers/WindowsLike/UPT.bat > | 3 ++ > BaseTools/BinPipWrappers/WindowsLike/build.bat > | 3 ++ > BaseTools/{BinWrappers =3D> > BinPipWrappers}/WindowsLike/win_build_tools_path_env.yaml | 3 +- > BaseTools/BinWrappers/PosixLike/posix_path_env.yaml > | 1 + > BaseTools/BinWrappers/WindowsLike/win_build_tools_path_env.yaml > | 1 + > BaseTools/BuildEnv > | 14 ++++- > BaseTools/Scripts/PatchCheck.py > | 1 + > BaseTools/Source/Python/README.md > | 29 +++++++++++ > BaseTools/toolsetup.bat > | 19 +++++++ > pip-requirements.txt > | 1 + > 55 files changed, 797 insertions(+), 25 deletions(-) >=20 > diff --git a/.pytool/CISettings.py b/.pytool/CISettings.py > index e6c5ac700ab2..5f71eca1992e 100644 > --- a/.pytool/CISettings.py > +++ b/.pytool/CISettings.py > @@ -22,16 +22,24 @@ class Settings(CiBuildSettingsManager, > UpdateSettingsManager, SetupSettingsManag > self.ActualTargets =3D [] >=20 > self.ActualArchitectures =3D [] >=20 > self.ActualToolChainTag =3D "" >=20 > + self.UseBuiltInBaseTools =3D None >=20 > + self.ActualScopes =3D None >=20 >=20 >=20 > # > ############################################################## > ######################### # >=20 > # Extra CmdLine configuration > # >=20 > # > ############################################################## > ######################### # >=20 >=20 >=20 > def AddCommandLineOptions(self, parserObj): >=20 > - pass >=20 > + group =3D parserObj.add_mutually_exclusive_group() >=20 > + group.add_argument("-force_piptools", "--fpt", > dest=3D"force_piptools", action=3D"store_true", default=3DFalse, = help=3D"Force the > system to use pip tools") >=20 > + group.add_argument("-no_piptools", "--npt", = dest=3D"no_piptools", > action=3D"store_true", default=3DFalse, help=3D"Force the system to = not use pip > tools") >=20 >=20 >=20 > def RetrieveCommandLineOptions(self, args): >=20 > - pass >=20 > + super().RetrieveCommandLineOptions(args) >=20 > + if args.force_piptools: >=20 > + self.UseBuiltInBaseTools =3D True >=20 > + if args.no_piptools: >=20 > + self.UseBuiltInBaseTools =3D False >=20 >=20 >=20 > # > ############################################################## > ######################### # >=20 > # Default Support for this Ci Build > # >=20 > @@ -128,19 +136,38 @@ class Settings(CiBuildSettingsManager, > UpdateSettingsManager, SetupSettingsManag >=20 >=20 > def GetActiveScopes(self): >=20 > ''' return tuple containing scopes that should be active for = this > process ''' >=20 > - scopes =3D ("cibuild", "edk2-build", "host-based-test") >=20 > + if self.ActualScopes is None: >=20 > + scopes =3D ("cibuild", "edk2-build", "host-based-test") >=20 >=20 >=20 > - self.ActualToolChainTag =3D > shell_environment.GetBuildVars().GetValue("TOOL_CHAIN_TAG", "") >=20 > + self.ActualToolChainTag =3D > shell_environment.GetBuildVars().GetValue("TOOL_CHAIN_TAG", "") >=20 >=20 >=20 > - if GetHostInfo().os.upper() =3D=3D "LINUX" and > self.ActualToolChainTag.upper().startswith("GCC"): >=20 > - if "AARCH64" in self.ActualArchitectures: >=20 > - scopes +=3D ("gcc_aarch64_linux",) >=20 > - if "ARM" in self.ActualArchitectures: >=20 > - scopes +=3D ("gcc_arm_linux",) >=20 > - if "RISCV64" in self.ActualArchitectures: >=20 > - scopes +=3D ("gcc_riscv64_unknown",) >=20 > + is_linux =3D GetHostInfo().os.upper() =3D=3D "LINUX" >=20 >=20 >=20 > - return scopes >=20 > + if self.UseBuiltInBaseTools is None: >=20 > + is_linux =3D GetHostInfo().os.upper() =3D=3D "LINUX" >=20 > + # try and import the pip module for basetools >=20 > + try: >=20 > + import edk2basetools >=20 > + self.UseBuiltInBaseTools =3D True >=20 > + except ImportError: >=20 > + self.UseBuiltInBaseTools =3D False >=20 > + pass >=20 > + >=20 > + if self.UseBuiltInBaseTools =3D=3D True: >=20 > + scopes +=3D ('pipbuild-unix',) if is_linux else ('pipbuild-win',) >=20 > + logging.warning("Using Pip Tools based BaseTools") >=20 > + else: >=20 > + logging.warning("Falling back to using in-tree > BaseTools") >=20 > + >=20 > + if is_linux and > self.ActualToolChainTag.upper().startswith("GCC"): >=20 > + if "AARCH64" in self.ActualArchitectures: >=20 > + scopes +=3D ("gcc_aarch64_linux",) >=20 > + if "ARM" in self.ActualArchitectures: >=20 > + scopes +=3D ("gcc_arm_linux",) >=20 > + if "RISCV64" in self.ActualArchitectures: >=20 > + scopes +=3D ("gcc_riscv64_unknown",) >=20 > + self.ActualScopes =3D scopes >=20 > + return self.ActualScopes >=20 >=20 >=20 > def GetRequiredSubmodules(self): >=20 > ''' return iterable containing RequiredSubmodule objects. >=20 > diff --git a/BaseTools/BinPipWrappers/PosixLike/AmlToC > b/BaseTools/BinPipWrappers/PosixLike/AmlToC > new file mode 100755 > index 000000000000..1dd28e966288 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/PosixLike/AmlToC > @@ -0,0 +1,14 @@ > +#!/usr/bin/env bash > +#python `dirname $0`/RunToolFromSource.py `basename $0` $* > + > +# If a ${PYTHON_COMMAND} command is available, use it in preference = to > python > +if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then > + python_exe=3D${PYTHON_COMMAND} > +fi > + > +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 > +dir=3D$(dirname "$full_cmd") > +exe=3D$(basename "$full_cmd") > + > +export > PYTHONPATH=3D"$dir/../../Source/Python${PYTHONPATH:+:"$PYTHONPATH"}" > +exec "${python_exe:-python}" "$dir/../../Source/Python/$exe/$exe.py" > "$@" > diff --git a/BaseTools/BinPipWrappers/PosixLike/BPDG > b/BaseTools/BinPipWrappers/PosixLike/BPDG > new file mode 100755 > index 000000000000..a08cbd8de5c5 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/PosixLike/BPDG > @@ -0,0 +1,12 @@ > +#!/usr/bin/env bash > +#python `dirname $0`/RunToolFromSource.py `basename $0` $* > + > +# If a ${PYTHON_COMMAND} command is available, use it in preference = to > python > +if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then > + python_exe=3D${PYTHON_COMMAND} > +fi > + > +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 > +cmd=3D${full_cmd##*/} > + > +exec "${python_exe:-python}" -m edk2basetools.$cmd.EccMain "$@" > diff --git a/BaseTools/BinPipWrappers/PosixLike/BrotliCompress > b/BaseTools/BinPipWrappers/PosixLike/BrotliCompress > new file mode 100755 > index 000000000000..663860bb3e57 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/PosixLike/BrotliCompress > @@ -0,0 +1,34 @@ > +#!/usr/bin/env bash > +# > +# This script will exec Brotli tool with -e/-d options. > +# > +# Copyright (c) 2017 - 2018, Intel Corporation. All rights = reserved.
> +# SPDX-License-Identifier: BSD-2-Clause-Patent > +# > +QLT=3D"-q 9 -w 22" > +ARGS=3D > + > +while test $# -gt 0 > +do > + case $1 in > + -e) > + ;; > + -d) > + ARGS+=3D"$1 " > + ;; > + -o|-g) > + ARGS+=3D"$1 $2 " > + shift > + ;; > + -q) > + QLT=3D"$1 $2 " > + shift > + ;; > + *) > + ARGS+=3D"$1 " > + ;; > + esac > + shift > +done > + > +exec Brotli $QLT $ARGS > diff --git a/BaseTools/BinPipWrappers/PosixLike/DevicePath > b/BaseTools/BinPipWrappers/PosixLike/DevicePath > new file mode 100755 > index 000000000000..0945d86d9209 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/PosixLike/DevicePath > @@ -0,0 +1,29 @@ > +#!/usr/bin/env bash > + > +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 > +dir=3D$(dirname "$full_cmd") > +cmd=3D${full_cmd##*/} > + > +if [ -n "$WORKSPACE" ] && [ -e "$WORKSPACE/Conf/BaseToolsCBinaries" ] > +then > + exec "$WORKSPACE/Conf/BaseToolsCBinaries/$cmd" > +elif [ -n "$WORKSPACE" ] && [ -e "$EDK_TOOLS_PATH/Source/C" ] > +then > + if [ ! -e "$EDK_TOOLS_PATH/Source/C/bin/$cmd" ] > + then > + echo "BaseTools C Tool binary was not found ($cmd)" > + echo "You may need to run:" > + echo " make -C $EDK_TOOLS_PATH/Source/C" > + else > + exec "$EDK_TOOLS_PATH/Source/C/bin/$cmd" "$@" > + fi > +elif [ -e "$dir/../../Source/C/bin/$cmd" ] > +then > + exec "$dir/../../Source/C/bin/$cmd" "$@" > +else > + echo "Unable to find the real '$cmd' to run" > + echo "This message was printed by" > + echo " $0" > + exit 127 > +fi > + > diff --git a/BaseTools/BinPipWrappers/PosixLike/Ecc > b/BaseTools/BinPipWrappers/PosixLike/Ecc > new file mode 100755 > index 000000000000..598728915095 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/PosixLike/Ecc > @@ -0,0 +1,13 @@ > +#!/usr/bin/env bash > +#python `dirname $0`/RunToolFromSource.py `basename $0` $* > + > +# If a ${PYTHON_COMMAND} command is available, use it in preference = to > python > +if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then > + python_exe=3D${PYTHON_COMMAND} > +fi > + > +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 > +cmd=3D${full_cmd##*/} > + > +export > PYTHONPATH=3D"$dir/../../Source/Python${PYTHONPATH:+:"$PYTHONPATH"}" > +exec "${python_exe:-python}" -m $cmd.EccMain "$@" > diff --git a/BaseTools/BinPipWrappers/PosixLike/EfiRom > b/BaseTools/BinPipWrappers/PosixLike/EfiRom > new file mode 100755 > index 000000000000..0945d86d9209 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/PosixLike/EfiRom > @@ -0,0 +1,29 @@ > +#!/usr/bin/env bash > + > +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 > +dir=3D$(dirname "$full_cmd") > +cmd=3D${full_cmd##*/} > + > +if [ -n "$WORKSPACE" ] && [ -e "$WORKSPACE/Conf/BaseToolsCBinaries" ] > +then > + exec "$WORKSPACE/Conf/BaseToolsCBinaries/$cmd" > +elif [ -n "$WORKSPACE" ] && [ -e "$EDK_TOOLS_PATH/Source/C" ] > +then > + if [ ! -e "$EDK_TOOLS_PATH/Source/C/bin/$cmd" ] > + then > + echo "BaseTools C Tool binary was not found ($cmd)" > + echo "You may need to run:" > + echo " make -C $EDK_TOOLS_PATH/Source/C" > + else > + exec "$EDK_TOOLS_PATH/Source/C/bin/$cmd" "$@" > + fi > +elif [ -e "$dir/../../Source/C/bin/$cmd" ] > +then > + exec "$dir/../../Source/C/bin/$cmd" "$@" > +else > + echo "Unable to find the real '$cmd' to run" > + echo "This message was printed by" > + echo " $0" > + exit 127 > +fi > + > diff --git a/BaseTools/BinPipWrappers/PosixLike/GenCrc32 > b/BaseTools/BinPipWrappers/PosixLike/GenCrc32 > new file mode 100755 > index 000000000000..0945d86d9209 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/PosixLike/GenCrc32 > @@ -0,0 +1,29 @@ > +#!/usr/bin/env bash > + > +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 > +dir=3D$(dirname "$full_cmd") > +cmd=3D${full_cmd##*/} > + > +if [ -n "$WORKSPACE" ] && [ -e "$WORKSPACE/Conf/BaseToolsCBinaries" ] > +then > + exec "$WORKSPACE/Conf/BaseToolsCBinaries/$cmd" > +elif [ -n "$WORKSPACE" ] && [ -e "$EDK_TOOLS_PATH/Source/C" ] > +then > + if [ ! -e "$EDK_TOOLS_PATH/Source/C/bin/$cmd" ] > + then > + echo "BaseTools C Tool binary was not found ($cmd)" > + echo "You may need to run:" > + echo " make -C $EDK_TOOLS_PATH/Source/C" > + else > + exec "$EDK_TOOLS_PATH/Source/C/bin/$cmd" "$@" > + fi > +elif [ -e "$dir/../../Source/C/bin/$cmd" ] > +then > + exec "$dir/../../Source/C/bin/$cmd" "$@" > +else > + echo "Unable to find the real '$cmd' to run" > + echo "This message was printed by" > + echo " $0" > + exit 127 > +fi > + > diff --git a/BaseTools/BinPipWrappers/PosixLike/GenDepex > b/BaseTools/BinPipWrappers/PosixLike/GenDepex > new file mode 100755 > index 000000000000..df75e43f9ec1 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/PosixLike/GenDepex > @@ -0,0 +1,12 @@ > +#!/usr/bin/env bash > +#python `dirname $0`/RunToolFromSource.py `basename $0` $* > + > +# If a ${PYTHON_COMMAND} command is available, use it in preference = to > python > +if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then > + python_exe=3D${PYTHON_COMMAND} > +fi > + > +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 > +cmd=3D${full_cmd##*/} > + > +exec "${python_exe:-python}" -m edk2basetools.AutoGen.$cmd "$@" > diff --git a/BaseTools/BinPipWrappers/PosixLike/GenFds > b/BaseTools/BinPipWrappers/PosixLike/GenFds > new file mode 100755 > index 000000000000..b27e84eaa210 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/PosixLike/GenFds > @@ -0,0 +1,12 @@ > +#!/usr/bin/env bash > +#python `dirname $0`/RunToolFromSource.py `basename $0` $* > + > +# If a ${PYTHON_COMMAND} command is available, use it in preference = to > python > +if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then > + python_exe=3D${PYTHON_COMMAND} > +fi > + > +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 > +cmd=3D${full_cmd##*/} > + > +exec "${python_exe:-python}" -m edk2basetools.$cmd "$@" > diff --git a/BaseTools/BinPipWrappers/PosixLike/GenFfs > b/BaseTools/BinPipWrappers/PosixLike/GenFfs > new file mode 100755 > index 000000000000..0945d86d9209 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/PosixLike/GenFfs > @@ -0,0 +1,29 @@ > +#!/usr/bin/env bash > + > +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 > +dir=3D$(dirname "$full_cmd") > +cmd=3D${full_cmd##*/} > + > +if [ -n "$WORKSPACE" ] && [ -e "$WORKSPACE/Conf/BaseToolsCBinaries" ] > +then > + exec "$WORKSPACE/Conf/BaseToolsCBinaries/$cmd" > +elif [ -n "$WORKSPACE" ] && [ -e "$EDK_TOOLS_PATH/Source/C" ] > +then > + if [ ! -e "$EDK_TOOLS_PATH/Source/C/bin/$cmd" ] > + then > + echo "BaseTools C Tool binary was not found ($cmd)" > + echo "You may need to run:" > + echo " make -C $EDK_TOOLS_PATH/Source/C" > + else > + exec "$EDK_TOOLS_PATH/Source/C/bin/$cmd" "$@" > + fi > +elif [ -e "$dir/../../Source/C/bin/$cmd" ] > +then > + exec "$dir/../../Source/C/bin/$cmd" "$@" > +else > + echo "Unable to find the real '$cmd' to run" > + echo "This message was printed by" > + echo " $0" > + exit 127 > +fi > + > diff --git a/BaseTools/BinPipWrappers/PosixLike/GenFv > b/BaseTools/BinPipWrappers/PosixLike/GenFv > new file mode 100755 > index 000000000000..0945d86d9209 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/PosixLike/GenFv > @@ -0,0 +1,29 @@ > +#!/usr/bin/env bash > + > +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 > +dir=3D$(dirname "$full_cmd") > +cmd=3D${full_cmd##*/} > + > +if [ -n "$WORKSPACE" ] && [ -e "$WORKSPACE/Conf/BaseToolsCBinaries" ] > +then > + exec "$WORKSPACE/Conf/BaseToolsCBinaries/$cmd" > +elif [ -n "$WORKSPACE" ] && [ -e "$EDK_TOOLS_PATH/Source/C" ] > +then > + if [ ! -e "$EDK_TOOLS_PATH/Source/C/bin/$cmd" ] > + then > + echo "BaseTools C Tool binary was not found ($cmd)" > + echo "You may need to run:" > + echo " make -C $EDK_TOOLS_PATH/Source/C" > + else > + exec "$EDK_TOOLS_PATH/Source/C/bin/$cmd" "$@" > + fi > +elif [ -e "$dir/../../Source/C/bin/$cmd" ] > +then > + exec "$dir/../../Source/C/bin/$cmd" "$@" > +else > + echo "Unable to find the real '$cmd' to run" > + echo "This message was printed by" > + echo " $0" > + exit 127 > +fi > + > diff --git a/BaseTools/BinPipWrappers/PosixLike/GenFw > b/BaseTools/BinPipWrappers/PosixLike/GenFw > new file mode 100755 > index 000000000000..0945d86d9209 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/PosixLike/GenFw > @@ -0,0 +1,29 @@ > +#!/usr/bin/env bash > + > +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 > +dir=3D$(dirname "$full_cmd") > +cmd=3D${full_cmd##*/} > + > +if [ -n "$WORKSPACE" ] && [ -e "$WORKSPACE/Conf/BaseToolsCBinaries" ] > +then > + exec "$WORKSPACE/Conf/BaseToolsCBinaries/$cmd" > +elif [ -n "$WORKSPACE" ] && [ -e "$EDK_TOOLS_PATH/Source/C" ] > +then > + if [ ! -e "$EDK_TOOLS_PATH/Source/C/bin/$cmd" ] > + then > + echo "BaseTools C Tool binary was not found ($cmd)" > + echo "You may need to run:" > + echo " make -C $EDK_TOOLS_PATH/Source/C" > + else > + exec "$EDK_TOOLS_PATH/Source/C/bin/$cmd" "$@" > + fi > +elif [ -e "$dir/../../Source/C/bin/$cmd" ] > +then > + exec "$dir/../../Source/C/bin/$cmd" "$@" > +else > + echo "Unable to find the real '$cmd' to run" > + echo "This message was printed by" > + echo " $0" > + exit 127 > +fi > + > diff --git a/BaseTools/BinPipWrappers/PosixLike/GenPatchPcdTable > b/BaseTools/BinPipWrappers/PosixLike/GenPatchPcdTable > new file mode 100755 > index 000000000000..9d143c7fc6c2 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/PosixLike/GenPatchPcdTable > @@ -0,0 +1,12 @@ > +#!/usr/bin/env bash > +#python `dirname $0`/RunToolFromSource.py `basename $0` $* > + > +# If a ${PYTHON_COMMAND} command is available, use it in preference = to > python > +if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then > + python_exe=3D${PYTHON_COMMAND} > +fi > + > +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 > +cmd=3D${full_cmd##*/} > + > +exec "${python_exe:-python}" -m edk2basetools.$cmd.$cmd "$@" > diff --git a/BaseTools/BinPipWrappers/PosixLike/GenSec > b/BaseTools/BinPipWrappers/PosixLike/GenSec > new file mode 100755 > index 000000000000..0945d86d9209 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/PosixLike/GenSec > @@ -0,0 +1,29 @@ > +#!/usr/bin/env bash > + > +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 > +dir=3D$(dirname "$full_cmd") > +cmd=3D${full_cmd##*/} > + > +if [ -n "$WORKSPACE" ] && [ -e "$WORKSPACE/Conf/BaseToolsCBinaries" ] > +then > + exec "$WORKSPACE/Conf/BaseToolsCBinaries/$cmd" > +elif [ -n "$WORKSPACE" ] && [ -e "$EDK_TOOLS_PATH/Source/C" ] > +then > + if [ ! -e "$EDK_TOOLS_PATH/Source/C/bin/$cmd" ] > + then > + echo "BaseTools C Tool binary was not found ($cmd)" > + echo "You may need to run:" > + echo " make -C $EDK_TOOLS_PATH/Source/C" > + else > + exec "$EDK_TOOLS_PATH/Source/C/bin/$cmd" "$@" > + fi > +elif [ -e "$dir/../../Source/C/bin/$cmd" ] > +then > + exec "$dir/../../Source/C/bin/$cmd" "$@" > +else > + echo "Unable to find the real '$cmd' to run" > + echo "This message was printed by" > + echo " $0" > + exit 127 > +fi > + > diff --git a/BaseTools/BinPipWrappers/PosixLike/GenerateCapsule > b/BaseTools/BinPipWrappers/PosixLike/GenerateCapsule > new file mode 100755 > index 000000000000..366a268802c4 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/PosixLike/GenerateCapsule > @@ -0,0 +1,12 @@ > +#!/usr/bin/env bash > +#python `dirname $0`/RunToolFromSource.py `basename $0` $* > + > +# If a ${PYTHON_COMMAND} command is available, use it in preference = to > python > +if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then > + python_exe=3D${PYTHON_COMMAND} > +fi > + > +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 > +cmd=3D${full_cmd##*/} > + > +exec "${python_exe:-python}" -m edk2basetools.Capsule.$cmd "$@" > diff --git a/BaseTools/BinPipWrappers/PosixLike/LzmaCompress > b/BaseTools/BinPipWrappers/PosixLike/LzmaCompress > new file mode 100755 > index 000000000000..0945d86d9209 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/PosixLike/LzmaCompress > @@ -0,0 +1,29 @@ > +#!/usr/bin/env bash > + > +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 > +dir=3D$(dirname "$full_cmd") > +cmd=3D${full_cmd##*/} > + > +if [ -n "$WORKSPACE" ] && [ -e "$WORKSPACE/Conf/BaseToolsCBinaries" ] > +then > + exec "$WORKSPACE/Conf/BaseToolsCBinaries/$cmd" > +elif [ -n "$WORKSPACE" ] && [ -e "$EDK_TOOLS_PATH/Source/C" ] > +then > + if [ ! -e "$EDK_TOOLS_PATH/Source/C/bin/$cmd" ] > + then > + echo "BaseTools C Tool binary was not found ($cmd)" > + echo "You may need to run:" > + echo " make -C $EDK_TOOLS_PATH/Source/C" > + else > + exec "$EDK_TOOLS_PATH/Source/C/bin/$cmd" "$@" > + fi > +elif [ -e "$dir/../../Source/C/bin/$cmd" ] > +then > + exec "$dir/../../Source/C/bin/$cmd" "$@" > +else > + echo "Unable to find the real '$cmd' to run" > + echo "This message was printed by" > + echo " $0" > + exit 127 > +fi > + > diff --git a/BaseTools/BinPipWrappers/PosixLike/LzmaF86Compress > b/BaseTools/BinPipWrappers/PosixLike/LzmaF86Compress > new file mode 100755 > index 000000000000..b55352ae4c79 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/PosixLike/LzmaF86Compress > @@ -0,0 +1,19 @@ > +#!/usr/bin/env bash > +# > +# This script will exec LzmaCompress tool with --f86 option that = enables > converter for x86 code. > +# > +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP
> +# Copyright (c) 2012, Intel Corporation. All rights reserved.
> +# SPDX-License-Identifier: BSD-2-Clause-Patent > +# > + > +for arg; do > + case $arg in > + -e|-d) > + set -- "$@" --f86 > + break > + ;; > + esac > +done > + > +exec LzmaCompress "$@" > diff --git a/BaseTools/BinPipWrappers/PosixLike/PatchPcdValue > b/BaseTools/BinPipWrappers/PosixLike/PatchPcdValue > new file mode 100755 > index 000000000000..9d143c7fc6c2 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/PosixLike/PatchPcdValue > @@ -0,0 +1,12 @@ > +#!/usr/bin/env bash > +#python `dirname $0`/RunToolFromSource.py `basename $0` $* > + > +# If a ${PYTHON_COMMAND} command is available, use it in preference = to > python > +if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then > + python_exe=3D${PYTHON_COMMAND} > +fi > + > +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 > +cmd=3D${full_cmd##*/} > + > +exec "${python_exe:-python}" -m edk2basetools.$cmd.$cmd "$@" > diff --git a/BaseTools/BinPipWrappers/PosixLike/Pkcs7Sign > b/BaseTools/BinPipWrappers/PosixLike/Pkcs7Sign > new file mode 100755 > index 000000000000..9d143c7fc6c2 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/PosixLike/Pkcs7Sign > @@ -0,0 +1,12 @@ > +#!/usr/bin/env bash > +#python `dirname $0`/RunToolFromSource.py `basename $0` $* > + > +# If a ${PYTHON_COMMAND} command is available, use it in preference = to > python > +if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then > + python_exe=3D${PYTHON_COMMAND} > +fi > + > +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 > +cmd=3D${full_cmd##*/} > + > +exec "${python_exe:-python}" -m edk2basetools.$cmd.$cmd "$@" > diff --git > a/BaseTools/BinPipWrappers/PosixLike/Rsa2048Sha256GenerateKeys > b/BaseTools/BinPipWrappers/PosixLike/Rsa2048Sha256GenerateKeys > new file mode 100755 > index 000000000000..aca2f3a6fe2a > --- /dev/null > +++ b/BaseTools/BinPipWrappers/PosixLike/Rsa2048Sha256GenerateKeys > @@ -0,0 +1,12 @@ > +#!/usr/bin/env bash > +#python `dirname $0`/RunToolFromSource.py `basename $0` $* > + > +# If a ${PYTHON_COMMAND} command is available, use it in preference = to > python > +if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then > + python_exe=3D${PYTHON_COMMAND} > +fi > + > +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 > +cmd=3D${full_cmd##*/} > + > +exec "${python_exe:-python}" -m edk2basetools.Rsa2048Sha256Sign.$cmd > "$@" > diff --git a/BaseTools/BinPipWrappers/PosixLike/Rsa2048Sha256Sign > b/BaseTools/BinPipWrappers/PosixLike/Rsa2048Sha256Sign > new file mode 100755 > index 000000000000..068364070518 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/PosixLike/Rsa2048Sha256Sign > @@ -0,0 +1,12 @@ > +#!/usr/bin/env bash > +#python `dirname $0`/RunToolFromSource.py `basename $0` $* > + > +# If a ${PYTHON_COMMAND} command is available, use it in preference = to > python > +if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then > + python_exe=3D${PYTHON_COMMAND} > +fi > + > +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 > +cmd=3D${full_cmd##*/} > + > +exec "${python_exe:-python}" -m edk2basetools.$cmd.$cmd "$@" > \ No newline at end of file > diff --git a/BaseTools/BinPipWrappers/PosixLike/Split > b/BaseTools/BinPipWrappers/PosixLike/Split > new file mode 100755 > index 000000000000..0945d86d9209 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/PosixLike/Split > @@ -0,0 +1,29 @@ > +#!/usr/bin/env bash > + > +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 > +dir=3D$(dirname "$full_cmd") > +cmd=3D${full_cmd##*/} > + > +if [ -n "$WORKSPACE" ] && [ -e "$WORKSPACE/Conf/BaseToolsCBinaries" ] > +then > + exec "$WORKSPACE/Conf/BaseToolsCBinaries/$cmd" > +elif [ -n "$WORKSPACE" ] && [ -e "$EDK_TOOLS_PATH/Source/C" ] > +then > + if [ ! -e "$EDK_TOOLS_PATH/Source/C/bin/$cmd" ] > + then > + echo "BaseTools C Tool binary was not found ($cmd)" > + echo "You may need to run:" > + echo " make -C $EDK_TOOLS_PATH/Source/C" > + else > + exec "$EDK_TOOLS_PATH/Source/C/bin/$cmd" "$@" > + fi > +elif [ -e "$dir/../../Source/C/bin/$cmd" ] > +then > + exec "$dir/../../Source/C/bin/$cmd" "$@" > +else > + echo "Unable to find the real '$cmd' to run" > + echo "This message was printed by" > + echo " $0" > + exit 127 > +fi > + > diff --git a/BaseTools/BinPipWrappers/PosixLike/TargetTool > b/BaseTools/BinPipWrappers/PosixLike/TargetTool > new file mode 100755 > index 000000000000..9d143c7fc6c2 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/PosixLike/TargetTool > @@ -0,0 +1,12 @@ > +#!/usr/bin/env bash > +#python `dirname $0`/RunToolFromSource.py `basename $0` $* > + > +# If a ${PYTHON_COMMAND} command is available, use it in preference = to > python > +if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then > + python_exe=3D${PYTHON_COMMAND} > +fi > + > +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 > +cmd=3D${full_cmd##*/} > + > +exec "${python_exe:-python}" -m edk2basetools.$cmd.$cmd "$@" > diff --git a/BaseTools/BinPipWrappers/PosixLike/TianoCompress > b/BaseTools/BinPipWrappers/PosixLike/TianoCompress > new file mode 100755 > index 000000000000..0945d86d9209 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/PosixLike/TianoCompress > @@ -0,0 +1,29 @@ > +#!/usr/bin/env bash > + > +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 > +dir=3D$(dirname "$full_cmd") > +cmd=3D${full_cmd##*/} > + > +if [ -n "$WORKSPACE" ] && [ -e "$WORKSPACE/Conf/BaseToolsCBinaries" ] > +then > + exec "$WORKSPACE/Conf/BaseToolsCBinaries/$cmd" > +elif [ -n "$WORKSPACE" ] && [ -e "$EDK_TOOLS_PATH/Source/C" ] > +then > + if [ ! -e "$EDK_TOOLS_PATH/Source/C/bin/$cmd" ] > + then > + echo "BaseTools C Tool binary was not found ($cmd)" > + echo "You may need to run:" > + echo " make -C $EDK_TOOLS_PATH/Source/C" > + else > + exec "$EDK_TOOLS_PATH/Source/C/bin/$cmd" "$@" > + fi > +elif [ -e "$dir/../../Source/C/bin/$cmd" ] > +then > + exec "$dir/../../Source/C/bin/$cmd" "$@" > +else > + echo "Unable to find the real '$cmd' to run" > + echo "This message was printed by" > + echo " $0" > + exit 127 > +fi > + > diff --git a/BaseTools/BinPipWrappers/PosixLike/Trim > b/BaseTools/BinPipWrappers/PosixLike/Trim > new file mode 100755 > index 000000000000..0bd14ee03872 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/PosixLike/Trim > @@ -0,0 +1,13 @@ > +#!/usr/bin/env bash > +#python `dirname $0`/RunToolFromSource.py `basename $0` $* > + > +# If a ${PYTHON_COMMAND} command is available, use it in preference = to > python > +if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then > + python_exe=3D${PYTHON_COMMAND} > +fi > + > +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 > +cmd=3D$(basename "$full_cmd") > + > +exec "${python_exe:-python}" -m edk2basetools.$cmd.$cmd "$@" > + > diff --git a/BaseTools/BinPipWrappers/PosixLike/UPT > b/BaseTools/BinPipWrappers/PosixLike/UPT > new file mode 100755 > index 000000000000..068364070518 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/PosixLike/UPT > @@ -0,0 +1,12 @@ > +#!/usr/bin/env bash > +#python `dirname $0`/RunToolFromSource.py `basename $0` $* > + > +# If a ${PYTHON_COMMAND} command is available, use it in preference = to > python > +if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then > + python_exe=3D${PYTHON_COMMAND} > +fi > + > +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 > +cmd=3D${full_cmd##*/} > + > +exec "${python_exe:-python}" -m edk2basetools.$cmd.$cmd "$@" > \ No newline at end of file > diff --git a/BaseTools/BinPipWrappers/PosixLike/VfrCompile > b/BaseTools/BinPipWrappers/PosixLike/VfrCompile > new file mode 100755 > index 000000000000..0945d86d9209 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/PosixLike/VfrCompile > @@ -0,0 +1,29 @@ > +#!/usr/bin/env bash > + > +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 > +dir=3D$(dirname "$full_cmd") > +cmd=3D${full_cmd##*/} > + > +if [ -n "$WORKSPACE" ] && [ -e "$WORKSPACE/Conf/BaseToolsCBinaries" ] > +then > + exec "$WORKSPACE/Conf/BaseToolsCBinaries/$cmd" > +elif [ -n "$WORKSPACE" ] && [ -e "$EDK_TOOLS_PATH/Source/C" ] > +then > + if [ ! -e "$EDK_TOOLS_PATH/Source/C/bin/$cmd" ] > + then > + echo "BaseTools C Tool binary was not found ($cmd)" > + echo "You may need to run:" > + echo " make -C $EDK_TOOLS_PATH/Source/C" > + else > + exec "$EDK_TOOLS_PATH/Source/C/bin/$cmd" "$@" > + fi > +elif [ -e "$dir/../../Source/C/bin/$cmd" ] > +then > + exec "$dir/../../Source/C/bin/$cmd" "$@" > +else > + echo "Unable to find the real '$cmd' to run" > + echo "This message was printed by" > + echo " $0" > + exit 127 > +fi > + > diff --git a/BaseTools/BinPipWrappers/PosixLike/VolInfo > b/BaseTools/BinPipWrappers/PosixLike/VolInfo > new file mode 100755 > index 000000000000..0945d86d9209 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/PosixLike/VolInfo > @@ -0,0 +1,29 @@ > +#!/usr/bin/env bash > + > +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 > +dir=3D$(dirname "$full_cmd") > +cmd=3D${full_cmd##*/} > + > +if [ -n "$WORKSPACE" ] && [ -e "$WORKSPACE/Conf/BaseToolsCBinaries" ] > +then > + exec "$WORKSPACE/Conf/BaseToolsCBinaries/$cmd" > +elif [ -n "$WORKSPACE" ] && [ -e "$EDK_TOOLS_PATH/Source/C" ] > +then > + if [ ! -e "$EDK_TOOLS_PATH/Source/C/bin/$cmd" ] > + then > + echo "BaseTools C Tool binary was not found ($cmd)" > + echo "You may need to run:" > + echo " make -C $EDK_TOOLS_PATH/Source/C" > + else > + exec "$EDK_TOOLS_PATH/Source/C/bin/$cmd" "$@" > + fi > +elif [ -e "$dir/../../Source/C/bin/$cmd" ] > +then > + exec "$dir/../../Source/C/bin/$cmd" "$@" > +else > + echo "Unable to find the real '$cmd' to run" > + echo "This message was printed by" > + echo " $0" > + exit 127 > +fi > + > diff --git a/BaseTools/BinPipWrappers/PosixLike/build > b/BaseTools/BinPipWrappers/PosixLike/build > new file mode 100755 > index 000000000000..9d143c7fc6c2 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/PosixLike/build > @@ -0,0 +1,12 @@ > +#!/usr/bin/env bash > +#python `dirname $0`/RunToolFromSource.py `basename $0` $* > + > +# If a ${PYTHON_COMMAND} command is available, use it in preference = to > python > +if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then > + python_exe=3D${PYTHON_COMMAND} > +fi > + > +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 > +cmd=3D${full_cmd##*/} > + > +exec "${python_exe:-python}" -m edk2basetools.$cmd.$cmd "$@" > diff --git a/BaseTools/BinWrappers/PosixLike/posix_path_env.yaml > b/BaseTools/BinPipWrappers/PosixLike/posix_path_env.yaml > similarity index 74% > copy from BaseTools/BinWrappers/PosixLike/posix_path_env.yaml > copy to BaseTools/BinPipWrappers/PosixLike/posix_path_env.yaml > index 8b32e010bb1d..830670305c0c 100644 > --- a/BaseTools/BinWrappers/PosixLike/posix_path_env.yaml > +++ b/BaseTools/BinPipWrappers/PosixLike/posix_path_env.yaml > @@ -1,10 +1,11 @@ > -## @file >=20 > -# Set this folder on the path for all linux builds >=20 > -# >=20 > -# Copyright (c) Microsoft Corporation. >=20 > -# SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > -## >=20 > -{ >=20 > - "scope": "global-nix", >=20 > - "flags": ["set_path"] >=20 > -} >=20 > +## @file > +# Set this folder on the path for all linux builds > +# > +# Copyright (c) Microsoft Corporation. > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +## > +{ > + "scope": "pipbuild-unix", > + "override_id": "binwrappers", > + "flags": ["set_path"] > +} > diff --git a/BaseTools/BinPipWrappers/WindowsLike/AmlToC.bat > b/BaseTools/BinPipWrappers/WindowsLike/AmlToC.bat > new file mode 100644 > index 000000000000..d347d6484467 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/WindowsLike/AmlToC.bat > @@ -0,0 +1,3 @@ > +@setlocal >=20 > +@set ToolName=3D%~n0% >=20 > +@%PYTHON_COMMAND% -m > edk2basetools.%ToolName%.%ToolName% %* >=20 > diff --git a/BaseTools/BinPipWrappers/WindowsLike/BPDG.bat > b/BaseTools/BinPipWrappers/WindowsLike/BPDG.bat > new file mode 100644 > index 000000000000..d347d6484467 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/WindowsLike/BPDG.bat > @@ -0,0 +1,3 @@ > +@setlocal >=20 > +@set ToolName=3D%~n0% >=20 > +@%PYTHON_COMMAND% -m > edk2basetools.%ToolName%.%ToolName% %* >=20 > diff --git a/BaseTools/BinPipWrappers/WindowsLike/BrotliCompress.bat > b/BaseTools/BinPipWrappers/WindowsLike/BrotliCompress.bat > new file mode 100644 > index 000000000000..788c99a1307d > --- /dev/null > +++ b/BaseTools/BinPipWrappers/WindowsLike/BrotliCompress.bat > @@ -0,0 +1,55 @@ > +@REM @file >=20 > +@REM This script will exec Brotli tool with -e/-d options. >=20 > +@REM >=20 > +@REM Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.
>=20 > +@REM SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > +@REM >=20 > + >=20 > +@echo off >=20 > +@setlocal >=20 > + >=20 > +set QLT=3D-q 9 -w 22 >=20 > +set ARGS=3D >=20 > + >=20 > +:Begin >=20 > +if "%1"=3D=3D"" goto End >=20 > + >=20 > +if "%1"=3D=3D"-d" ( >=20 > + set ARGS=3D%ARGS% %1 >=20 > + shift >=20 > + goto Begin >=20 > +) >=20 > + >=20 > +if "%1"=3D=3D"-e" ( >=20 > + shift >=20 > + goto Begin >=20 > +) >=20 > + >=20 > +if "%1"=3D=3D"-g" ( >=20 > + set ARGS=3D%ARGS% %1 %2 >=20 > + shift >=20 > + shift >=20 > + goto Begin >=20 > +) >=20 > + >=20 > +if "%1"=3D=3D"-o" ( >=20 > + set ARGS=3D%ARGS% %1 %2 >=20 > + shift >=20 > + shift >=20 > + goto Begin >=20 > +) >=20 > + >=20 > +if "%1"=3D=3D"-q" ( >=20 > + set QLT=3D%1 %2 >=20 > + shift >=20 > + shift >=20 > + goto Begin >=20 > +) >=20 > + >=20 > +set ARGS=3D%ARGS% %1 >=20 > +shift >=20 > +goto Begin >=20 > + >=20 > +:End >=20 > +Brotli %QLT% %ARGS% >=20 > +@echo on >=20 > diff --git a/BaseTools/BinPipWrappers/WindowsLike/Ecc.bat > b/BaseTools/BinPipWrappers/WindowsLike/Ecc.bat > new file mode 100644 > index 000000000000..16a0a799a43b > --- /dev/null > +++ b/BaseTools/BinPipWrappers/WindowsLike/Ecc.bat > @@ -0,0 +1,3 @@ > +@setlocal >=20 > +@set ToolName=3D%~n0% >=20 > +@%PYTHON_COMMAND% -m edk2basetools.%ToolName%.EccMain %* >=20 > diff --git a/BaseTools/BinPipWrappers/WindowsLike/GenDepex.bat > b/BaseTools/BinPipWrappers/WindowsLike/GenDepex.bat > new file mode 100644 > index 000000000000..481b5ac47d24 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/WindowsLike/GenDepex.bat > @@ -0,0 +1,3 @@ > +@setlocal >=20 > +@set ToolName=3D%~n0% >=20 > +@%PYTHON_COMMAND% -m edk2basetools.AutoGen.%ToolName% %* >=20 > diff --git a/BaseTools/BinPipWrappers/WindowsLike/GenFds.bat > b/BaseTools/BinPipWrappers/WindowsLike/GenFds.bat > new file mode 100644 > index 000000000000..d347d6484467 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/WindowsLike/GenFds.bat > @@ -0,0 +1,3 @@ > +@setlocal >=20 > +@set ToolName=3D%~n0% >=20 > +@%PYTHON_COMMAND% -m > edk2basetools.%ToolName%.%ToolName% %* >=20 > diff --git a/BaseTools/BinPipWrappers/WindowsLike/GenPatchPcdTable.bat > b/BaseTools/BinPipWrappers/WindowsLike/GenPatchPcdTable.bat > new file mode 100644 > index 000000000000..d347d6484467 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/WindowsLike/GenPatchPcdTable.bat > @@ -0,0 +1,3 @@ > +@setlocal >=20 > +@set ToolName=3D%~n0% >=20 > +@%PYTHON_COMMAND% -m > edk2basetools.%ToolName%.%ToolName% %* >=20 > diff --git a/BaseTools/BinPipWrappers/WindowsLike/GenerateCapsule.bat > b/BaseTools/BinPipWrappers/WindowsLike/GenerateCapsule.bat > new file mode 100644 > index 000000000000..34c43ac7fc99 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/WindowsLike/GenerateCapsule.bat > @@ -0,0 +1 @@ > +@%PYTHON_COMMAND% -m edk2basetools.Capsule.GenerateCapsule %* >=20 > diff --git a/BaseTools/BinPipWrappers/WindowsLike/PatchPcdValue.bat > b/BaseTools/BinPipWrappers/WindowsLike/PatchPcdValue.bat > new file mode 100644 > index 000000000000..d347d6484467 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/WindowsLike/PatchPcdValue.bat > @@ -0,0 +1,3 @@ > +@setlocal >=20 > +@set ToolName=3D%~n0% >=20 > +@%PYTHON_COMMAND% -m > edk2basetools.%ToolName%.%ToolName% %* >=20 > diff --git a/BaseTools/BinPipWrappers/WindowsLike/Pkcs7Sign.bat > b/BaseTools/BinPipWrappers/WindowsLike/Pkcs7Sign.bat > new file mode 100644 > index 000000000000..d347d6484467 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/WindowsLike/Pkcs7Sign.bat > @@ -0,0 +1,3 @@ > +@setlocal >=20 > +@set ToolName=3D%~n0% >=20 > +@%PYTHON_COMMAND% -m > edk2basetools.%ToolName%.%ToolName% %* >=20 > diff --git > a/BaseTools/BinPipWrappers/WindowsLike/Rsa2048Sha256GenerateKeys.ba > t > b/BaseTools/BinPipWrappers/WindowsLike/Rsa2048Sha256GenerateKeys.ba > t > new file mode 100644 > index 000000000000..cdc2e3ea373d > --- /dev/null > +++ > b/BaseTools/BinPipWrappers/WindowsLike/Rsa2048Sha256GenerateKeys.ba > t > @@ -0,0 +1 @@ > +@%PYTHON_COMMAND% -m > edk2basetools.Rsa2048Sha256Sign.Rsa2048Sha256GenerateKeys %* >=20 > diff --git = a/BaseTools/BinPipWrappers/WindowsLike/Rsa2048Sha256Sign.bat > b/BaseTools/BinPipWrappers/WindowsLike/Rsa2048Sha256Sign.bat > new file mode 100644 > index 000000000000..d347d6484467 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/WindowsLike/Rsa2048Sha256Sign.bat > @@ -0,0 +1,3 @@ > +@setlocal >=20 > +@set ToolName=3D%~n0% >=20 > +@%PYTHON_COMMAND% -m > edk2basetools.%ToolName%.%ToolName% %* >=20 > diff --git a/BaseTools/BinPipWrappers/WindowsLike/TargetTool.bat > b/BaseTools/BinPipWrappers/WindowsLike/TargetTool.bat > new file mode 100644 > index 000000000000..d347d6484467 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/WindowsLike/TargetTool.bat > @@ -0,0 +1,3 @@ > +@setlocal >=20 > +@set ToolName=3D%~n0% >=20 > +@%PYTHON_COMMAND% -m > edk2basetools.%ToolName%.%ToolName% %* >=20 > diff --git a/BaseTools/BinPipWrappers/WindowsLike/Trim.bat > b/BaseTools/BinPipWrappers/WindowsLike/Trim.bat > new file mode 100644 > index 000000000000..d347d6484467 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/WindowsLike/Trim.bat > @@ -0,0 +1,3 @@ > +@setlocal >=20 > +@set ToolName=3D%~n0% >=20 > +@%PYTHON_COMMAND% -m > edk2basetools.%ToolName%.%ToolName% %* >=20 > diff --git a/BaseTools/BinPipWrappers/WindowsLike/UPT.bat > b/BaseTools/BinPipWrappers/WindowsLike/UPT.bat > new file mode 100644 > index 000000000000..d347d6484467 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/WindowsLike/UPT.bat > @@ -0,0 +1,3 @@ > +@setlocal >=20 > +@set ToolName=3D%~n0% >=20 > +@%PYTHON_COMMAND% -m > edk2basetools.%ToolName%.%ToolName% %* >=20 > diff --git a/BaseTools/BinPipWrappers/WindowsLike/build.bat > b/BaseTools/BinPipWrappers/WindowsLike/build.bat > new file mode 100644 > index 000000000000..d347d6484467 > --- /dev/null > +++ b/BaseTools/BinPipWrappers/WindowsLike/build.bat > @@ -0,0 +1,3 @@ > +@setlocal >=20 > +@set ToolName=3D%~n0% >=20 > +@%PYTHON_COMMAND% -m > edk2basetools.%ToolName%.%ToolName% %* >=20 > diff --git > a/BaseTools/BinWrappers/WindowsLike/win_build_tools_path_env.yaml > b/BaseTools/BinPipWrappers/WindowsLike/win_build_tools_path_env.yaml > similarity index 70% > copy from > BaseTools/BinWrappers/WindowsLike/win_build_tools_path_env.yaml > copy to > BaseTools/BinPipWrappers/WindowsLike/win_build_tools_path_env.yaml > index 83f5856e75c6..9fdbe1bcb06b 100644 > --- a/BaseTools/BinWrappers/WindowsLike/win_build_tools_path_env.yaml > +++ > b/BaseTools/BinPipWrappers/WindowsLike/win_build_tools_path_env.yaml > @@ -5,6 +5,7 @@ > # SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ## >=20 > { >=20 > - "scope": "global-win", >=20 > + "scope": "pipbuild-win", >=20 > + "override_id": "binwrappers", >=20 > "flags": ["set_path"] >=20 > } >=20 > diff --git a/BaseTools/BinWrappers/PosixLike/posix_path_env.yaml > b/BaseTools/BinWrappers/PosixLike/posix_path_env.yaml > index 8b32e010bb1d..99529235ec9a 100644 > --- a/BaseTools/BinWrappers/PosixLike/posix_path_env.yaml > +++ b/BaseTools/BinWrappers/PosixLike/posix_path_env.yaml > @@ -5,6 +5,7 @@ > # SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ## >=20 > { >=20 > + "id": "binwrappers", >=20 > "scope": "global-nix", >=20 > "flags": ["set_path"] >=20 > } >=20 > diff --git > a/BaseTools/BinWrappers/WindowsLike/win_build_tools_path_env.yaml > b/BaseTools/BinWrappers/WindowsLike/win_build_tools_path_env.yaml > index 83f5856e75c6..43da76f354e5 100644 > --- a/BaseTools/BinWrappers/WindowsLike/win_build_tools_path_env.yaml > +++ b/BaseTools/BinWrappers/WindowsLike/win_build_tools_path_env.yaml > @@ -5,6 +5,7 @@ > # SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ## >=20 > { >=20 > + "id": "binwrappers", >=20 > "scope": "global-win", >=20 > "flags": ["set_path"] >=20 > } >=20 > diff --git a/BaseTools/BuildEnv b/BaseTools/BuildEnv > index 5943bb9ef908..275f4c5901aa 100755 > --- a/BaseTools/BuildEnv > +++ b/BaseTools/BuildEnv > @@ -46,7 +46,7 @@ RestorePreviousConfiguration() { > done > fi > fi > - > + > PREVIOUS_CONF_FILE=3D$CONF_PATH/BuildEnv.sh > if [ -e $PREVIOUS_CONF_FILE ] > then > @@ -198,7 +198,17 @@ AddEdkToolsToPath() { >=20 > EDK_TOOLS_PATH_BIN=3D`GetEdkToolsPathBinDirectory` >=20 > - AddDirToStartOfPath $EDK_TOOLS_PATH/BinWrappers/PosixLike > + # check if the edk2basetools pip package is available > + if $PYTHON_COMMAND -c "import edk2basetools" &> /dev/null; then > + # if it is, use the pip version of the wrappers > + echo "Using Pip Basetools" > + AddDirToStartOfPath $EDK_TOOLS_PATH/BinPipWrappers/PosixLike > + else > + echo "Using EDK2 in-source Basetools" > + AddDirToStartOfPath $EDK_TOOLS_PATH/BinWrappers/PosixLike > + fi > + > + > AddDirToStartOfPath $EDK_TOOLS_PATH_BIN >=20 > } > diff --git a/BaseTools/Scripts/PatchCheck.py > b/BaseTools/Scripts/PatchCheck.py > index 68c984ed0e4d..80754e763c5a 100755 > --- a/BaseTools/Scripts/PatchCheck.py > +++ b/BaseTools/Scripts/PatchCheck.py > @@ -359,6 +359,7 @@ class GitDiffCheck: > self.force_notabs =3D True >=20 > if self.filename.endswith('.sh') or \ >=20 >=20 > self.filename.startswith('BaseTools/BinWrappers/PosixLike/') or \ >=20 > + > self.filename.startswith('BaseTools/BinPipWrappers/PosixLike/') or \ >=20 >=20 > self.filename.startswith('BaseTools/Bin/CYGWIN_NT-5.1-i686/') or \ >=20 > self.filename =3D=3D 'BaseTools/BuildEnv': >=20 > # >=20 > diff --git a/BaseTools/Source/Python/README.md > b/BaseTools/Source/Python/README.md > new file mode 100644 > index 000000000000..56f5b0ff027b > --- /dev/null > +++ b/BaseTools/Source/Python/README.md > @@ -0,0 +1,29 @@ > +# Edk2 Basetools >=20 > + >=20 > +This folder has traditionally held the source of Python based tools = used by > EDK2. >=20 > +The official repo this source has moved to > https://github.com/tianocore/edk2-basetools. >=20 > +This folder will remain in the tree until the next stable release (expected > 202102). >=20 > +There is a new folder under Basetools `BinPipWrappers` that uses the = pip > module rather than this tree for Basetools. >=20 > +By adding the scope `pipbuild-win` or `pipbuild-unix` (depending on = your host > system), the SDE will use the >=20 > +`BinPipWrappers` instead of the regular `BinWrappers`. >=20 > + >=20 > +## Why Move It? >=20 > + >=20 > +The discussion is on the mailing list. The RFC is here: > https://edk2.groups.io/g/rfc/topic/74009714#270 >=20 > +The benefits allow for the Basetools project to be used separately = from EDK2 > itself as well as offering it in a >=20 > +globally accessible manner. >=20 > +This makes it much easier to build a module using Basetools. >=20 > +Separating the Basetools into their own repo allows for easier CI and > contribution process. >=20 > +Additional pros, cons, and process can be found on the mailing list. >=20 > + >=20 > +## How Do I Install It? >=20 > + >=20 > +By default, EDK2 is tied to and tested with a specific version of the Basetools > through `pip-requirements.txt`. >=20 > +You can simply run: >=20 > + >=20 > +```bash >=20 > +pip install -r pip-requirements.txt >=20 > +``` >=20 > + >=20 > +This will install the required module, thought we strongly suggest setting up > a virtual environment. >=20 > +Additionally, you can also install a local clone of the Basetools as = well as a > specific git commit. >=20 > diff --git a/BaseTools/toolsetup.bat b/BaseTools/toolsetup.bat > index 61ebf4ae09bc..4b5256ab6e93 100755 > --- a/BaseTools/toolsetup.bat > +++ b/BaseTools/toolsetup.bat > @@ -393,12 +393,31 @@ goto end > goto check_freezer_path >=20 > ) >=20 >=20 >=20 > + >=20 > + >=20 > :check_freezer_path >=20 > endlocal >=20 > + >=20 > + %PYTHON_COMMAND% -c "import edk2basetools" >NUL 2>NUL >=20 > + if %ERRORLEVEL% EQU 0 ( >=20 > + goto use_pip_basetools >=20 > + ) else ( >=20 > + goto use_builtin_basetools >=20 > + ) >=20 > + >=20 > +:use_builtin_basetools >=20 > + @echo Using EDK2 in-source Basetools >=20 > if defined BASETOOLS_PYTHON_SOURCE goto print_python_info >=20 > set "PATH=3D%BASE_TOOLS_PATH%\BinWrappers\WindowsLike;%PATH%" >=20 > set > BASETOOLS_PYTHON_SOURCE=3D%BASE_TOOLS_PATH%\Source\Python >=20 > set PYTHONPATH=3D%BASETOOLS_PYTHON_SOURCE%;%PYTHONPATH% >=20 > + goto print_python_info >=20 > + >=20 > +:use_pip_basetools >=20 > + @echo Using Pip Basetools >=20 > + set > "PATH=3D%BASE_TOOLS_PATH%\BinPipWrappers\WindowsLike;%PATH%" >=20 > + set BASETOOLS_PYTHON_SOURCE=3Dedk2basetools >=20 > + goto print_python_info >=20 >=20 >=20 > :print_python_info >=20 > echo PATH =3D %PATH% >=20 > diff --git a/pip-requirements.txt b/pip-requirements.txt > index 0fecd37f2a83..aea2e6ece431 100644 > --- a/pip-requirements.txt > +++ b/pip-requirements.txt > @@ -14,4 +14,5 @@ >=20 >=20 > edk2-pytool-library=3D=3D0.10.* >=20 > edk2-pytool-extensions~=3D0.13.3 >=20 > +edk2-basetools=3D=3D0.1.2 >=20 > antlr4-python3-runtime=3D=3D4.7.1 >=20 > -- > 2.29.0.vfs.0.0 >=20 >=20 >=20 > -=3D-=3D-=3D-=3D-=3D-=3D > Groups.io Links: You receive all messages sent to this group. > View/Reply Online (#70867): = https://edk2.groups.io/g/devel/message/70867 > Mute This Topic: https://groups.io/mt/80194948/4905953 > Group Owner: devel+owner@edk2.groups.io > Unsubscribe: https://edk2.groups.io/g/devel/unsub > [gaoliming@byosoft.com.cn] > -=3D-=3D-=3D-=3D-=3D-=3D >=20