summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Harkin <ryan.harkin@linaro.org>2014-03-25 14:31:04 +0000
committerRyan Harkin <ryan.harkin@linaro.org>2014-03-25 16:08:29 +0000
commit6bd0e0d591afbfafdc4099b1796908ff5776d68f (patch)
tree46748ff21bc8604aa2709bf33022dbe1d6217f8d
parent7744a16e429e05bb5cbc72956e289e9b72bd48b5 (diff)
use uefi-tools
Use uefi-tools to build the UEFI code rather than incorporate lots of commands to build UEFI. Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
-rwxr-xr-xfvp-pre-boot.sh60
1 files changed, 37 insertions, 23 deletions
diff --git a/fvp-pre-boot.sh b/fvp-pre-boot.sh
index a416962..957b93d 100755
--- a/fvp-pre-boot.sh
+++ b/fvp-pre-boot.sh
@@ -62,7 +62,18 @@ pkg_source=${JOB_NAME}
pkg_repository=$repo_url/${repo}.git
if [ "${BUILD_NUMBER}" -eq 0 ]; then
- git clone --depth 1 ${pkg_repository} -b ${branch}
+ rm -rf ${repo}
+fi
+
+if [ ! -d ${repo} ]; then
+ echo "Cloning ${repo}"
+ git clone --depth 1 ${pkg_repository} -b ${branch}
+else
+ echo "${repo} already exists; cleaning..."
+ pushd ${repo}
+ git reset --hard HEAD
+ git clean -dfx
+ popd
fi
scm_commit=`cd ${repo} && git log -n1 --pretty=format:%h`
@@ -99,6 +110,12 @@ cd ${WORKSPACE}
set +e
################################################################################
+# Get the UEFI tools
+UEFI_TOOLS_DIR=${WORKSPACE}/uefi-tools
+if [ ! -d ${UEFI_TOOLS_DIR} ]; then
+ git clone git://git.linaro.org/arm/uefi/uefi-tools.git
+fi
+
# Build the latest UEFI binary
export EDK_REPO=linaro-edk2
export EDK_WORKSPACE=${WORKSPACE}/${EDK_REPO}
@@ -112,11 +129,14 @@ if [ ! -d ${EDK_REPO} ]; then
echo "UEFI dir does not exist"
git clone --depth 1 git://git.linaro.org/uefi/${EDK_REPO}.git -b ${EDK_BRANCH}
else
- echo "UEFI dir already exists"
+ echo "UEFI dir already exists; cleaning..."
+ cd ${EDK_WORKSPACE}
+ git reset --hard HEAD
+ git clean -dfx
fi
# Create the tarball of the UEFI source
-cd ${EDK_REPO}
+cd ${EDK_WORKSPACE}
scm_commit=`git log -n1 --pretty=format:%h`
if [ -z "${scm_commit}" ]; then
echo "Invalid git revision: ${scm_commit}" >&2
@@ -139,28 +159,22 @@ cd ${EDK_WORKSPACE}
# Fix WORKSPACE environment variable conflict with Jenkins
find ${EDK_WORKSPACE} -type f | xargs sed -i 's/WORKSPACE/EDK_WORKSPACE/g'
-edksetup=`find ${EDK_WORKSPACE} -type f -name 'edksetup.sh'`
-source ${edksetup} BaseTools
+export TARGET=${TARGET:-RELEASE}
-basetools=`find ${EDK_WORKSPACE} -type d -name BaseTools`
-make -C ${basetools}
-export TARGET=${TARGET:-RELEASE}
-export TOOLCHAIN=${TOOLCHAIN:-ARMLINUXGCC}
-
-if [ "${platform}" == "fvp" ];
-then
- CROSS_COMPILE=aarch64-linux-gnu- \
- build \
- -a AARCH64 \
- -b ${TARGET} \
- -t ${TOOLCHAIN} \
- -p ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-FVP-AArch64.dsc \
- -D ARM_FOUNDATION_FVP=1
- export BL33=${EDK_WORKSPACE}/Build/ArmVExpress-FVP-AArch64/${TARGET}_${TOOLCHAIN}/FV/FVP_AARCH64_EFI.fd
- count_errors $?
- cp -a ${BL33} ${builddir}/uefi_fvp-base.bin
-fi
+case "${platform}" in
+ juno)
+ ${UEFI_TOOLS_DIR}/uefi-build.sh -b ${TARGET} juno
+ export BL33=`pwd`/`find . -name BL32_AP_UEFI.fd`
+ cp -a ${BL33} ${builddir}/uefi_juno.bin
+ ;;
+ fvp)
+ ${UEFI_TOOLS_DIR}/uefi-build.sh -b ${TARGET} fvp_minimal
+ export BL33=`pwd`/`find . -name FVP_AARCH64_EFI.fd`
+ cp -a ${BL33} ${builddir}/uefi_fvp-base.bin
+ ;;
+esac
+count_errors $?
################################################################################
# Build the ARM Trusted Firmware binaries (BL1, BL2 and BL31)