Commit 92efde18 authored by Grant Likely's avatar Grant Likely Committed by G Edhaya Chandran
Browse files

edk2-test: Helper script to build SCT+Shell in a bootable format



The buildzip.sh script builds the SCT and the EFI Shell, and then zips
them up in a file structure that can be booted when unzipped to a USB
drive or other block storage.
Signed-off-by: Grant Likely's avatarGrant Likely <grant.likely@arm.com>
Reviewed-by: Samer El-Haj-Mahmoud's avatarSamer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
Reviewed-by: G Edhaya Chandran<edhaya.chandran@arm.com>
parent cff3686e
#!/bin/bash
#
# EDK2 SCT build script for SCT+Shell in a zip file
#
# Copyright (c) 2021, 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.
set -e
TARGET_ARCH=$1
if [ X"${TARGET_ARCH}" == X"" ]
then
echo "Usage: $0 <ARM|AARCH64>"
exit
fi
case $TARGET_ARCH in
AARCH64)
BOOT_IMAGE_NAME=BOOTAA64.efi;;
*)
BOOT_IMAGE_NAME=BOOT${TARGET_ARCH}.efi;;
esac
# clear all positional parameters
set --
source ./edk2/edksetup.sh
NUM_CPUS=$((`getconf _NPROCESSORS_ONLN` + 2))
make -j"$NUM_CPUS" -C edk2/BaseTools/
# Build the SCT and the shell
DSC_EXTRA=ShellPkg/ShellPkg.dsc ./SctPkg/build.sh ${TARGET_ARCH} GCC RELEASE -j"$NUM_CPUS"
# Assemble all the files that need to be in the zip file
mkdir -p ${TARGET_ARCH}_SCT/EFI/BOOT
cp Build/Shell/RELEASE_GCC5/${TARGET_ARCH}/Shell_EA4BB293-2D7F-4456-A681-1F22F42CD0BC.efi ${TARGET_ARCH}_SCT/EFI/BOOT/${BOOT_IMAGE_NAME}
mkdir -p ${TARGET_ARCH}_SCT/SCT
cp -r Build/UefiSct/RELEASE_GCC5/SctPackage${TARGET_ARCH}/${TARGET_ARCH}/* ${TARGET_ARCH}_SCT/SCT/
cp Build/UefiSct/RELEASE_GCC5/SctPackage${TARGET_ARCH}/SctStartup.nsh ${TARGET_ARCH}_SCT/Startup.nsh
# Copy the SCT Parser tool into the repo
cp sct_parser/* ${TARGET_ARCH}_SCT/SCT/Sequence/
# Put some version information into the ESP directory
cat > ./${TARGET_ARCH}_SCT/versions.txt << EOF
EDK2_VER=`git -C ./edk2 describe`
EDK2_TEST_VER=`git -C ./edk2-test describe`
BUILD_DATE="`date`"
EOF
# Zip up the test folder
cd ${TARGET_ARCH}_SCT
zip -r ../edk2-test-${TARGET_ARCH,,}.zip *
cd ..
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment