From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:4864:20::342; helo=mail-wm1-x342.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9482A20957B06 for ; Tue, 6 Nov 2018 04:45:48 -0800 (PST) Received: by mail-wm1-x342.google.com with SMTP id t15-v6so3796986wmt.0 for ; Tue, 06 Nov 2018 04:45:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=YWgw0Mpj5JytZc3W92BKofkjv1rUWOs6MriH/N0P1ps=; b=d672U0kNipsgFvqdANHen2uSTejisxnu+PLDdgvFAj3z9p4VNblW+NcZP+ZL5f8uR2 tzRIFHMbFZr8ibm576aBUIVzxmNzsU61DJDulEFGnpJappvu89vWzjLHfO9gPkzzTAB/ dqxvBQ31IjOg0ClsE3WMP3MwnFIKjtynI9YgI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=YWgw0Mpj5JytZc3W92BKofkjv1rUWOs6MriH/N0P1ps=; b=TuciVzwXcQTnxtUVWxV08T66p6P7bSjWvh4hUHNPvQA9DIRRTqlo0TUgxNlJt1jyAh fNRvERwKoSaz05hK5T80wRAK7utJvWP/+AwDTb5kGVeA74KPiMXKd10nNYUpnFuyKESg NpILBGe0IthfA3s1/Ag8HDRWBPpfOPNwHHFGGaL+4CviqaQXjbMSHUzwcBB9OFJI4oqP wYmrg4AxjtQqGLArDi63EIOD+nsP99Uw/PrgXzWN3GogvYULewxtmPQnYjnedMAX0im+ FOiMfnKWnbpt7Z5DoqV+fFsZKW3K01f7uUIhPXyvfVG1bPbcCzhFE9wKPUcoF67QpuFn 0o1w== X-Gm-Message-State: AGRZ1gKezggi+iObrjQ8WdpDH50lcfdkYxdL6/pcwrfTMcpAPVa4u50W tDsje+lvMDo8duJHdT4odhDcqA== X-Google-Smtp-Source: AJdET5cgfL4CB41BCbMqaCN5c0B0mQo/GNGIrI29UJ9ewunYzGlyfA/GMyQ8dofgc3BUL2mCvtpYkA== X-Received: by 2002:a1c:104:: with SMTP id 4-v6mr1820489wmb.69.1541508346773; Tue, 06 Nov 2018 04:45:46 -0800 (PST) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id t198-v6sm3521075wmd.9.2018.11.06.04.45.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 06 Nov 2018 04:45:45 -0800 (PST) Date: Tue, 6 Nov 2018 12:45:43 +0000 From: Leif Lindholm To: Sakar Arora Cc: edk2-devel@lists.01.org, prasanth.pulla@arm.com, Eric Jin , Supreeth Venkatesh Message-ID: <20181106124543.y5xhvkio6ay4qtgt@bivouac.eciton.net> References: <1541494066-16288-1-git-send-email-sakar.arora@arm.com> MIME-Version: 1.0 In-Reply-To: <1541494066-16288-1-git-send-email-sakar.arora@arm.com> User-Agent: NeoMutt/20170113 (1.7.2) 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 12:45:49 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Sakar, Glad to see you guys already contributing to the newly(ish) open SCT. I do have some comments on this patch - starting with: please cc the maintainers. I have added Eric/Supreeth to this reply. 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. > + 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/Support/ > NUL > + cp $ProcessorType/ManagedNetworkMonitor.efi $Framework/Ents/Support/ > NUL > + cp $ProcessorType/IP4NetworkMonitor.efi $Framework/Ents/Support/ > 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? > +# > +# > +#/*++ > +# > +# 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. > + 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/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf > + UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.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/UefiMemoryAllocationLib.inf > + UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf > + UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.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/EntsLib.inf > + EasLib|SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasDispatcher/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.inf > +SctPkg/TestInfrastructure/SCT/Drivers/TestProfile/TestProfile.inf > +SctPkg/TestInfrastructure/SCT/Drivers/TestRecovery/TestRecovery.inf > +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/BlackBoxTest/MiscRuntimeServicesBBTest.inf > +#SctPkg/TestCase/UEFI/EFI/RuntimeServices/TimeServices/BlackBoxTest/TimeServicesBBTest.inf > +#SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/VariableServicesBBTest.inf > + > +# > +# Dependency files > +# > + > +# > +# Support Files > +# > +SctPkg/TestInfrastructure/SCT/Framework/ENTS/Eftp/Eftp.inf > +SctPkg/TestInfrastructure/SCT/Framework/ENTS/MonitorServices/SerialMonitor/SerialMonitor.inf > +SctPkg/TestInfrastructure/SCT/Framework/ENTS/MonitorServices/ManagedNetworkMonitor/ManagedNetworkMonitor.inf > +SctPkg/TestInfrastructure/SCT/Framework/ENTS/MonitorServices/IP4NetworkMonitor/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/PosixLike > + 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