From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=217.140.101.70; helo=foss.arm.com; envelope-from=supreeth.venkatesh@arm.com; receiver=edk2-devel@lists.01.org Received: from foss.arm.com (foss.arm.com [217.140.101.70]) by ml01.01.org (Postfix) with ESMTP id 7639D21188C31 for ; Tue, 6 Nov 2018 09:39:26 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B041BA78; Tue, 6 Nov 2018 09:39:25 -0800 (PST) Received: from supven01-VirtualBox (unknown [10.119.48.155]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 289EA3F5C0; Tue, 6 Nov 2018 09:39:25 -0800 (PST) Message-ID: <6a5a39fcaa45135855ad7385d7c726a728d06dc1.camel@arm.com> From: Supreeth Venkatesh To: Leif Lindholm , Sakar Arora Cc: "edk2-devel@lists.01.org" , Prasanth Pulla , Eric Jin Date: Tue, 06 Nov 2018 11:39:22 -0600 In-Reply-To: <20181106124543.y5xhvkio6ay4qtgt@bivouac.eciton.net> References: <1541494066-16288-1-git-send-email-sakar.arora@arm.com> <20181106124543.y5xhvkio6ay4qtgt@bivouac.eciton.net> X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1 Mime-Version: 1.0 Subject: Re: [edk2-test][RFC PATCH 01/12] uefi-sct/SctPkg: sbbr: Add support to build SBBR v1.0 test cases. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2018 17:39:26 -0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit On Tue, 2018-11-06 at 06:45 -0600, Leif Lindholm wrote: > Hi Sakar, > > Glad to see you guys already contributing to the newly(ish) open SCT. Indeed. > > I do have some comments on this patch - starting with: please cc the > maintainers. I have added Eric/Supreeth to this reply. We (me and Eric) have setup or in the process of setting up email filters that has a subject line of "edk2-test". So, Its ok, but will be more convenient if we are copied on CC. > > On Tue, Nov 06, 2018 at 02:17:35PM +0530, Sakar Arora wrote: > > Provide a framework for building SBBR Test Cases using the existing > > UEFI-SCT Framework. Separate out build-scripts/install scripts to > > carve out SBBR test cases. > > > > To build SBBR SCT, > > > > ./build_sbbr.sh AARCH64 GCC > > > > Change-Id: I3d7612dbb42a4dc3bce40e4e9b351fd1f5f84dcd > > Signed-off-by: Sakar Arora > > --- > > uefi-sct/SctPkg/CommonGenFramework.sh | 33 ++++ > > uefi-sct/SctPkg/UEFI/SBBR_SCT.dsc | 205 ++++++++++++++++++++++ > > uefi-sct/SctPkg/build_sbbr.sh | 312 > > ++++++++++++++++++++++++++++++++++ > > 3 files changed, 550 insertions(+) > > create mode 100644 uefi-sct/SctPkg/UEFI/SBBR_SCT.dsc > > create mode 100755 uefi-sct/SctPkg/build_sbbr.sh > > > > diff --git a/uefi-sct/SctPkg/CommonGenFramework.sh b/uefi- > > sct/SctPkg/CommonGenFramework.sh > > index 299f0d6..4bb68ce 100755 > > --- a/uefi-sct/SctPkg/CommonGenFramework.sh > > +++ b/uefi-sct/SctPkg/CommonGenFramework.sh > > @@ -335,4 +335,37 @@ then > > CopyDependency Ebc > > CopyDependency PxeBaseCode > > fi > > +# ********************************************* > > +# For SBBR v1.0 SCT > > +# ********************************************* > > + > > +if [ $1 = "sbbr_sct" ] > > +then > > + # ********************************************* > > + # Copy the SBBR v1.0 Test Cases > > + # ********************************************* > > + > > + mkdir -p $Framework/SCRT > > + cp > > $ProcessorType/SCRTDRIVER.efi $Framework/ > > SCRT > NUL > > This "> NUL" comes from someone cargo-culting when translating from a > Windows .bat file. On any unix-like system, this means you end up > with > a file called NUL. (Read through the thread at > https://twitter.com/Foone/status/1058676834940776450 for a recent > hilarious twitter rant.) > > So please don't add any new "> NUL" statements. > I would argue since the unix cp is silent by default, it can be > dropped completely. > > Someone with some free time on their hands could go through and > delete > all of the Windows-isms from the original script. I agree. Since this is a unix/linux shell script, there is no need for windows related quirks. > > > + cp > > $ProcessorType/SCRTAPP.efi $Framework/ > > SCRT > NUL > > + cp > > ../../../SctPkg/Config/Data/SCRT.conf $Framework/ > > SCRT > NUL > > 1) Is there no way of doing this without ../../..? > 2) Which SctPkg is this? This file is already in SctPkg, yet this > brings us 3 levels of hierarchy up? > > > + > > + # ********************************************* > > + # Copy your test cases here > > + # ********************************************* > > + > > > > + # ********************************************* > > + # Copy ENTS binary > > + # ********************************************* > > + > > + cp > > $ProcessorType/SerialMonitor.efi $Framework/Ents/Sup > > port/ > NUL > > + cp > > $ProcessorType/ManagedNetworkMonitor.efi $Framework/Ents/Sup > > port/ > NUL > > + cp > > $ProcessorType/IP4NetworkMonitor.efi $Framework/Ents/Sup > > port/ > NUL > > + cp $ProcessorType/Eftp.efi $Framework/ > > Ents/Support/ > NUL > > + > > + # ********************************************* > > + # Copy the test dependency files > > + # ********************************************* > > + > > +fi > > diff --git a/uefi-sct/SctPkg/UEFI/SBBR_SCT.dsc b/uefi- > > sct/SctPkg/UEFI/SBBR_SCT.dsc > > new file mode 100644 > > index 0000000..ff6abd9 > > --- /dev/null > > +++ b/uefi-sct/SctPkg/UEFI/SBBR_SCT.dsc > > @@ -0,0 +1,205 @@ > > +# > > +# The material contained herein is not a license, either > > +# expressly or impliedly, to any intellectual property owned > > +# or controlled by any of the authors or developers of this > > +# material or to any contribution thereto. The material > > +# contained herein is provided on an "AS IS" basis and, to the > > +# maximum extent permitted by applicable law, this information > > +# is provided AS IS AND WITH ALL FAULTS, and the authors and > > +# developers of this material hereby disclaim all other > > +# warranties and conditions, either express, implied or > > +# statutory, including, but not limited to, any (if any) > > +# implied warranties, duties or conditions of merchantability, > > +# of fitness for a particular purpose, of accuracy or > > +# completeness of responses, of results, of workmanlike > > +# effort, of lack of viruses and of lack of negligence, all > > +# with regard to this material and any contribution thereto. > > +# Designers must not rely on the absence or characteristics of > > +# any features or instructions marked "reserved" or > > +# "undefined." The Unified EFI Forum, Inc. reserves any > > +# features or instructions so marked for future definition and > > +# shall have no responsibility whatsoever for conflicts or > > +# incompatibilities arising from future changes to them. ALSO, > > +# THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, > > +# QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR > > +# NON-INFRINGEMENT WITH REGARD TO THE TEST SUITE AND ANY > > +# CONTRIBUTION THERETO. > > +# > > +# IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR > > +# ANY CONTRIBUTION THERETO BE LIABLE TO ANY OTHER PARTY FOR > > +# THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST > > +# PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, > > +# CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER > > +# UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY > > +# WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS > > +# DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF > > +# THE POSSIBILITY OF SUCH DAMAGES. > > +# > > +# Copyright 2006 - 2016 Unified EFI, Inc. All > > +# Rights Reserved, subject to all existing rights in all > > +# matters included within this Test Suite, to which United > > +# EFI, Inc. makes no claim of right. > > +# > > +# Copyright (c) 2010 - 2016, Intel Corporation. All rights > > reserved.
> > Question for maintainers: is this a license header we want to be > using > for new submissions? No. The new license file is as follows: /** @file Copyright 2006 - 2018 Unified EFI, Inc.
Copyright (c) 2018, Arm LTD. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ > > > +# > > +# > > +#/*++ > > +# > > +# Module Name: > > +# > > +# SBBR_SCT.dsc > > +# > > +# Abstract: > > +# > > +# This is a build description file used to build the test > > modules of SBBR SCT. > > +# > > +# Notes: > > +# > > +# The info in this file is broken down into sections. The start > > of a section > > +# is designated by a "[" in the first column. So the [=====] > > separater ends > > +# a section. > > +# > > +#--*/ > > + > > +################################################################## > > ############## > > +# > > +# Defines Section - statements that will be processed to create a > > Makefile. > > +# > > +################################################################## > > ############## > > +[Defines] > > + PLATFORM_NAME = SbbrSct > > + PLATFORM_GUID = d513138b-9d4a-479c-8058- > > 4a5160018663 > > + PLATFORM_VERSION = 0.1 > > + DSC_SPECIFICATION = 0x00010005 > > Please bump substantially. I think current version is 0x0001001a, > but it may have gone further. I concur. Please look into DSC specification and use the latest version. > > > + OUTPUT_DIRECTORY = Build/SbbrSct > > + SUPPORTED_ARCHITECTURES = AARCH64 > > + BUILD_TARGETS = DEBUG|RELEASE > > Preferably add NOOPT as well for new submissions. > > > + SKUID_IDENTIFIER = DEFAULT > > + > > + DEFINE GCC_VER_MACRO = -D > > EFI_SPECIFICATION_VERSION=0x00020028 -D > > TIANO_RELEASE_VERSION=0x00080006 > > + DEFINE MSFT_VER_MACRO = /D > > EFI_SPECIFICATION_VERSION=0x00020028 /D > > TIANO_RELEASE_VERSION=0x00080006 > > + > > + > > +################################################################## > > ############## > > +# > > +# SKU Identification section - list of all SKU IDs supported by > > this > > +# Platform. > > +# > > +################################################################## > > ############## > > +[SkuIds] > > + 0|DEFAULT # The entry: 0|DEFAULT is reserved and > > always required. > > + > > +[BuildOptions] > > + *_*_AARCH64_CC_FLAGS = -D EFIAARCH64 > > -I$(WORKSPACE)/MdePkg/Include/AArch64 $(GCC_VER_MACRO) > > Why -D EFIAARCH64? If such a filter is truly needed, test against > already defined MDE_CPU_AARCH64. > > > + GCC:*_*_AARCH64_CC_FLAGS = -D EFIAARCH64 $(GCC_VER_MACRO) > > -ffreestanding -nostdinc -nostdlib -Wno-error=unused-function -Wno- > > error=unused-but-set-variable -Wno-error > > Why do we need these special flags? -Wno-error particularly looks > like > an unfortunate addition, but I don't see why we need the others at > all. > > > + *_*_AARCH64_VFRPP_FLAGS = -D EFIAARCH64 $(GCC_VER_MACRO) > > + *_*_AARCH64_APP_FLAGS = -D EFIAARCH64 $(GCC_VER_MACRO) > > + *_*_AARCH64_PP_FLAGS = -D EFIAARCH64 $(GCC_VER_MACRO) > > + RVCT:*_*_AARCH64_DLINK_FLAGS = --muldefweak > > So, this one I can see may be valid, but it deserves a comment as to > why it is needed. > > > + > > + DEBUG_*_*_CC_FLAGS = -DEFI_DEBUG > > Why is this needed? > You can test against !MDEPKG_NDEBUG for the DEBUG targets. This is a > common pattern in edk2. > > > + RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG > > + > > +[Libraries] > > + SctPkg/Library/SctLib/SctLib.inf > > + SctPkg/Library/SctGuidLib/SctGuidLib.inf > > + SctPkg/Library/EfiTestLib/EfiTestLib.inf > > + > > + SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/EntsLib.inf > > + > > + MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf > > + > > +[Libraries.ARM] > > + ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf > > + > > SUPPORTED_ARCHITECTURES is set to AARCH64 only, so no need to keep > this .ARM section. > > > +[Libraries.AARCH64] > > + ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf > > + > > +[LibraryClasses.common] > > + UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoi > > nt/UefiApplicationEntryPoint.inf > > + UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDri > > verEntryPoint.inf > > + UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib > > /UefiBootServicesTableLib.inf > > + BaseLib|MdePkg/Library/BaseLib/BaseLib.inf > > + BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf > > + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf > > + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf > > + MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiM > > emoryAllocationLib.inf > > + UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTa > > bleLib/UefiRuntimeServicesTableLib.inf > > + UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiH > > iiServicesLib.inf > > + HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf > > + PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf > > + UefiLib|MdePkg/Library/UefiLib/UefiLib.inf > > + DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib > > .inf > > + > > + SctLib|SctPkg/Library/SctLib/SctLib.inf > > + NetLib|SctPkg/Library/NetLib/NetLib.inf > > + EntsLib|SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Ents > > Lib.inf > > + EasLib|SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasDispatche > > r/Eas.inf > > + EfiTestLib|SctPkg/Library/EfiTestLib/EfiTestLib.inf > > + > > +[LibraryClasses.ARM] > > + NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib. > > inf > > Can drop this .ARM section. > > > + > > +[LibraryClasses.AARCH64] > > + NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib. > > inf > > + > > +################################################################## > > ############# > > +# > > +# These are the components that will be built by the master > > makefile > > +# > > +################################################################## > > ############# > > + > > +[Components] > > + > > +# > > +# The default package > > +# > > +DEFINE PACKAGE=Default > > + > > +# > > +# Components > > +# > > + > > +# > > +# Following are the SCT suite & related drivers > > +# > > + > > +SctPkg/TestInfrastructure/SCT/Framework/Sct.inf > > +SctPkg/TestInfrastructure/SCT/Drivers/StandardTest/StandardTest.in > > f > > +SctPkg/TestInfrastructure/SCT/Drivers/TestProfile/TestProfile.inf > > +SctPkg/TestInfrastructure/SCT/Drivers/TestRecovery/TestRecovery.in > > f > > +SctPkg/TestInfrastructure/SCT/Drivers/TestLogging/TestLogging.inf > > + > > +# > > +# Related SCT applications > > +# > > + > > +SctPkg/Application/InstallSct/InstallSct.inf > > +SctPkg/Application/StallForKey/StallForKey.inf > > + > > +SctPkg/SCRT/SCRTApp/SCRTApp.inf > > +SctPkg/SCRT/SCRTDriver/SCRTDriver.inf > > + > > +# > > +# Test cases for SBBR SCT > > +# > > + > > +# Add Your test cases here: > > + > > +# Runtime Services Tests > > +#SctPkg/TestCase/UEFI/EFI/RuntimeServices/MiscRuntimeServices/Blac > > kBoxTest/MiscRuntimeServicesBBTest.inf > > +#SctPkg/TestCase/UEFI/EFI/RuntimeServices/TimeServices/BlackBoxTes > > t/TimeServicesBBTest.inf > > +#SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBo > > xTest/VariableServicesBBTest.inf > > + > > +# > > +# Dependency files > > +# > > + > > +# > > +# Support Files > > +# > > +SctPkg/TestInfrastructure/SCT/Framework/ENTS/Eftp/Eftp.inf > > +SctPkg/TestInfrastructure/SCT/Framework/ENTS/MonitorServices/Seria > > lMonitor/SerialMonitor.inf > > +SctPkg/TestInfrastructure/SCT/Framework/ENTS/MonitorServices/Manag > > edNetworkMonitor/ManagedNetworkMonitor.inf > > +SctPkg/TestInfrastructure/SCT/Framework/ENTS/MonitorServices/IP4Ne > > tworkMonitor/IP4NetworkMonitor.inf > > + > > diff --git a/uefi-sct/SctPkg/build_sbbr.sh b/uefi- > > sct/SctPkg/build_sbbr.sh > > new file mode 100755 > > index 0000000..6956e9b > > --- /dev/null > > +++ b/uefi-sct/SctPkg/build_sbbr.sh > > Do we need to completely duplicate build.sh? > Since most of the functionality is identical, can we not add a flag > to > build.sh, or make this a thin wrapper script instead? > > / > Leif > > > @@ -0,0 +1,312 @@ > > +#!/bin/bash > > +# The material contained herein is not a license, either > > +# expressly or impliedly, to any intellectual property owned > > +# or controlled by any of the authors or developers of this > > +# material or to any contribution thereto. The material > > +# contained herein is provided on an "AS IS" basis and, to the > > +# maximum extent permitted by applicable law, this information > > +# is provided AS IS AND WITH ALL FAULTS, and the authors and > > +# developers of this material hereby disclaim all other > > +# warranties and conditions, either express, implied or > > +# statutory, including, but not limited to, any (if any) > > +# implied warranties, duties or conditions of merchantability, > > +# of fitness for a particular purpose, of accuracy or > > +# completeness of responses, of results, of workmanlike > > +# effort, of lack of viruses and of lack of negligence, all > > +# with regard to this material and any contribution thereto. > > +# Designers must not rely on the absence or characteristics of > > +# any features or instructions marked "reserved" or > > +# "undefined." The Unified EFI Forum, Inc. reserves any > > +# features or instructions so marked for future definition and > > +# shall have no responsibility whatsoever for conflicts or > > +# incompatibilities arising from future changes to them. ALSO, > > +# THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, > > +# QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR > > +# NON-INFRINGEMENT WITH REGARD TO THE TEST SUITE AND ANY > > +# CONTRIBUTION THERETO. > > +# > > +# IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR > > +# ANY CONTRIBUTION THERETO BE LIABLE TO ANY OTHER PARTY FOR > > +# THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST > > +# PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, > > +# CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER > > +# UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY > > +# WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS > > +# DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF > > +# THE POSSIBILITY OF SUCH DAMAGES. > > +# > > +# Copyright 2006 - 2015 Unified EFI, Inc. All > > +# Rights Reserved, subject to all existing rights in all > > +# matters included within this Test Suite, to which United > > +# EFI, Inc. makes no claim of right. > > +# > > +# Copyright (c) 2011, 2015 ARM Ltd. All rights reserved.
> > +# > > + > > +SctpackageDependencyList=(EdkCompatibilityPkg SctPkg BaseTools) > > + > > +function get_build_arch > > +{ > > + case `uname -m` in > > + aarch64*) > > + BUILD_ARCH=AARCH64;; > > + *) > > + BUILD_ARCH=other;; > > + esac > > +} > > + > > +function set_cross_compile > > +{ > > + get_build_arch > > + > > + echo "Target: $SCT_TARGET_ARCH" > > + echo "Build: $BUILD_ARCH" > > + if [ "$SCT_TARGET_ARCH" = "$BUILD_ARCH" ]; then > > + TEMP_CROSS_COMPILE= > > + elif [ "$SCT_TARGET_ARCH" == "AARCH64" ]; then > > + if [ X"$CROSS_COMPILE_64" != X"" ]; then > > + TEMP_CROSS_COMPILE="$CROSS_COMPILE_64" > > + else > > + TEMP_CROSS_COMPILE=aarch64-linux-gnu- > > + fi > > + else > > + echo "Unsupported target architecture '$SCT_TARGET_ARCH'!" > > >&2 > > + fi > > +} > > + > > +function get_gcc_version > > +{ > > + gcc_version=$($1 -dumpversion) > > + case $gcc_version in > > + 4.6*|4.7*|4.8*|4.9*) > > + echo GCC$(echo ${gcc_version} | awk -F. '{print > > $1$2}') > > + ;; > > + *) > > + echo "Unknown toolchain version '$gcc_version'" > > >&2 > > + echo "Attempting to build using GCC49 profile." > > >&2 > > + echo GCC49 > > + ;; > > + esac > > +} > > + > > +function get_clang_version > > +{ > > + clang_version=`$1 --version | head -1 | sed > > 's/^.*version\s*\([0-9]*\).\([0-9]*\).*/\1\2/g'` > > + echo "CLANG$clang_version" > > +} > > + > > + > > +GetBaseToolsBinSubDir() { > > + # > > + # Figure out a uniq directory name from the uname command > > + # > > + UNAME_DIRNAME=`uname -sm` > > + UNAME_DIRNAME=${UNAME_DIRNAME// /-} > > + UNAME_DIRNAME=${UNAME_DIRNAME//\//-} > > + echo $UNAME_DIRNAME > > +} > > + > > +GetEdkToolsPathBinDirectory() { > > + # > > + # Figure out a uniq directory name from the uname > > + # command > > + # > > + BIN_SUB_DIR=`GetBaseToolsBinSubDir` > > + > > + if [ -e $EDK_TOOLS_PATH/BinWrappers/$BIN_SUB_DIR ] > > + then > > + EDK_TOOLS_PATH_BIN=$EDK_TOOLS_PATH/BinWrappers/$BIN_SUB > > _DIR > > + else > > + EDK_TOOLS_PATH_BIN=$EDK_TOOLS_PATH/BinWrappers/PosixLik > > e > > + fi > > + echo $EDK_TOOLS_PATH_BIN > > +} > > + > > +PrintUsage() { > > + # > > + #Print Help > > + # > > + echo "Usage:" > > + echo " $0 \ > > + \ > > +[build type (RELEASE OR DEBUG, DEFAULT: DEBUG)]" > > +} > > + > > +#Iterate through the SCT package dependency list and check if they > > exist in the current directory > > +for pkg in ${names[@]} > > +do > > + if [ ! -d `pwd`/$name] > > + then > > + echo "Couldn't build SCT:" > > + echo The directory `pwd`/$name does not exist. > > + exit -1 > > + fi > > +done > > + > > +export EFI_SOURCE=`pwd` > > +export EDK_SOURCE=`pwd`/EdkCompatibilityPkg > > + > > +# check if the last command was successful > > +status=$? > > +if test $status -ne 0; then > > + echo Could not Run the edksetup.sh script > > + exit -1 > > +fi > > + > > +SCT_TARGET_ARCH=${1} > > + > > +# > > +# Pick a default tool type for a given OS > > +# > > +case `uname` in > > + Linux*) > > + case ${2} in > > + RVCT | rvct) > > + TARGET_TOOLS=RVCTLINUX > > + ;; > > + > > + ARMGCC | armgcc) > > + TARGET_TOOLS=ARMGCC > > + ;; > > + > > + GCC | gcc) > > + set_cross_compile > > + CROSS_COMPILE="$TEMP_CROSS_COMPILE" > > + export TARGET_TOOLS=`get_gcc_version > > "$CROSS_COMPILE"gcc` > > + > > + ;; > > + > > + *) > > + echo "Couldn't build SBBR SCT:" > > + PrintUsage > > + exit -1 > > + ;; > > + esac > > + ;; > > + CYGWIN*) > > + case ${2} in > > + RVCT | rvct) > > + TARGET_TOOLS=RVCT31CYGWIN > > + ;; > > + > > + ARMGCC | armgcc) > > + TARGET_TOOLS=ARMGCCCYGWIN > > + ;; > > + > > + *) > > + echo "Couldn't build SBBR SCT:" > > + PrintUsage > > + exit -1 > > + ;; > > + esac > > + ;; > > + *) > > + echo "Couldn't build SBBR SCT:" > > + echo "Unknown OS, Use this script either in Unix or Cygwin > > environment". > > + PrintUsage > > + exit -1 > > + ;; > > +esac > > + > > +echo "TOOLCHAIN is ${TARGET_TOOLS}" > > +export ${TARGET_TOOLS}_${SCT_TARGET_ARCH}_PREFIX=$CROSS_COMPILE > > +echo "Toolchain prefix: > > ${TARGET_TOOLS}_${SCT_TARGET_ARCH}_PREFIX=$CROSS_COMPILE" > > + > > +SCT_BUILD=DEBUG > > +if [ "$3" = "RELEASE" -o "$3" = "DEBUG" ]; then > > + SCT_BUILD=$3 > > + shift > > +fi > > + > > +# > > +# Setup workspace if it is not set > > +# > > +if [ -z "${WORKSPACE:-}" ]; then > > + echo Initializing workspace > > + # Uses an external BaseTools project > > + # Uses the BaseTools in edk2 > > + export EDK_TOOLS_PATH=`pwd`/BaseTools > > + # We do not pass BuildArmSct.sh arguments to edksetup.sh > > + while (( "$#" )); do > > + shift > > + done > > + source ./edksetup.sh > > +else > > + echo Building from: $WORKSPACE > > +fi > > + > > +if [[ ! -e $EDK_TOOLS_PATH/Source/C/bin ]] > > +then > > + # build the tools if they don't yet exist > > + echo Building tools: $EDK_TOOLS_PATH > > + make -C $EDK_TOOLS_PATH > > + status=$? > > + if test $status -ne 0 > > + then > > + echo Error while building EDK tools > > + exit -1 > > + fi > > +else > > + echo using prebuilt tools > > +fi > > + > > +# Copy GenBin file to Base tools directory > > +DEST_DIR=`GetEdkToolsPathBinDirectory` > > +# Ensure the directory exist > > +mkdir -p $DEST_DIR > > +case `uname -m` in > > + x86_64) > > + cp SctPkg/Tools/Bin/GenBin_lin_64 $DEST_DIR/GenBin > > + ;; > > + x86_32) > > + cp SctPkg/Tools/Bin/GenBin_lin_32 $DEST_DIR/GenBin > > + ;; > > + *) > > + cp SctPkg/Tools/Bin/GenBin_lin_32 $DEST_DIR/GenBin > > + ;; > > +esac > > + > > +# > > +# Build the SCT package > > +# > > +build -p SctPkg/UEFI/SBBR_SCT.dsc -a $SCT_TARGET_ARCH -t > > $TARGET_TOOLS -b $SCT_BUILD $3 $4 $5 $6 $7 $8 $9 > > + > > +# Check if there is any error > > +status=$? > > +if test $status -ne 0 > > +then > > +echo Could not build the SBBR SCT package > > + exit -1 > > +fi > > + > > +# > > +# If the argument is clean, then don't have to generate Sct > > binary. > > +# > > +for arg in "$@" > > +do > > + if [ $arg == clean ] || [ $arg == cleanall ] > > + then > > + # no need to post process if we are doing a clean > > + exit 1 > > + fi > > +done > > + > > +# > > +# Change directory to Build directory > > +# > > +cd Build/SbbrSct/${SCT_BUILD}_${TARGET_TOOLS} > > +pwd > > + > > +# > > +# Run a script to generate Sct binary for the target architecture > > +# > > +../../../SctPkg/CommonGenFramework.sh sbbr_sct $SCT_TARGET_ARCH > > Install$SCT_TARGET_ARCH.efi > > + > > +status=$? > > +if test $status -ne 0 > > +then > > +echo Could not generate SBBR SCT binary > > + exit -1 > > +else > > +echo The SBBR SCT binary "SctPackage${SCT_TARGET_ARCH}" is located > > at "$EFI_SOURCE/Build/SbbrSct/${SCT_BUILD}_${TARGET_TOOLS}" > > +fi > > -- > > 2.7.4 > > > > _______________________________________________ > > edk2-devel mailing list > > edk2-devel@lists.01.org > > https://lists.01.org/mailman/listinfo/edk2-devel