aboutsummaryrefslogtreecommitdiff
path: root/optee
diff options
context:
space:
mode:
authorIgor Opaniuk <igor.opaniuk@linaro.org>2017-05-04 15:44:46 +0300
committerFathi Boudra <fathi.boudra@linaro.org>2017-05-11 08:10:42 +0000
commit6fd22307ddc6ae32f4e2e3004bc5202140bf66e0 (patch)
tree57aaf5fafd211a9600cd5ecf41414eff842d6285 /optee
parentcac2be71e8891edb114b7ccd0046d586c0e0b495 (diff)
optee-build: initial build repository job configuration
Change-Id: I138d28f12ac3433f7dbc75f62f6e1c0ae326d468 Signed-off-by: Igor Opaniuk <igor.opaniuk@linaro.org>
Diffstat (limited to 'optee')
-rwxr-xr-xoptee/build/builders.sh72
1 files changed, 72 insertions, 0 deletions
diff --git a/optee/build/builders.sh b/optee/build/builders.sh
new file mode 100755
index 00000000..d4ad3fd9
--- /dev/null
+++ b/optee/build/builders.sh
@@ -0,0 +1,72 @@
+#!/bin/bash
+
+set -e
+
+sudo dpkg --add-architecture i386
+if ! sudo DEBIAN_FRONTEND=noninteractive apt-get -q=2 update; then
+ echo "INFO: apt update error - try again in a moment"
+ sleep 15
+ sudo DEBIAN_FRONTEND=noninteractive apt-get -q=2 update || true
+fi
+# Install packages mentioned in the main README.md
+pkg_list="android-tools-adb android-tools-fastboot autoconf automake bc bison"
+pkg_list+=" build-essential ccache cscope curl device-tree-compiler flex"
+pkg_list+=" ftp-upload gdisk git iasl libattr1-dev libc6:i386 libcap-dev"
+pkg_list+=" libfdt-dev libftdi-dev libglib2.0-dev libhidapi-dev libncurses5-dev"
+pkg_list+=" libpixman-1-dev libssl-dev libstdc++6:i386 libtool libz1:i386"
+pkg_list+=" mtools netcat python-crypto python-requests python-serial"
+pkg_list+=" python-wand unzip uuid-dev xdg-utils xterm xz-utils zlib1g-dev"
+if ! sudo DEBIAN_FRONTEND=noninteractive apt-get -q=2 install -y ${pkg_list}; then
+ echo "INFO: apt install error - try again in a moment"
+ sleep 15
+ sudo DEBIAN_FRONTEND=noninteractive apt-get -q=2 install -y ${pkg_list}
+fi
+
+CCACHE_DIR="${HOME}/srv/ccache"
+CCACHE_UNIFY=1
+CCACHE_SLOPPINESS=file_macro,include_file_mtime,time_macros
+PATH=/usr/lib/ccache:${PATH}
+export CCACHE_DIR CCACHE_UNIFY CCACHE_SLOPPINESS PATH
+
+# Store the home repository
+if [ -z "${WORKSPACE}" ]; then
+ # Local build
+ export WORKSPACE=${PWD}
+fi
+
+export JENKINS_WORKSPACE=${WORKSPACE}
+unset WORKSPACE
+export make="make -j$(nproc) -s"
+
+# Tools required
+mkdir -p ${HOME}/bin
+curl https://storage.googleapis.com/git-repo-downloads/repo > ${HOME}/bin/repo && chmod a+x ${HOME}/bin/repo
+export PATH=${HOME}/bin:${PATH}
+
+supported_platforms="default fvp hikey juno mt8173-evb qemu_v8 rpi3"
+for repo_proj in ${supported_platforms}; do
+ echo "INFO: Building OP-TEE for ${repo_proj}"
+
+ mkdir -p ${JENKINS_WORKSPACE}/${repo_proj}
+
+ if [ "${repo_proj}" == "fvp" ]; then
+ mkdir -p ${JENKINS_WORKSPACE}/${repo_proj}/Foundation_Platformpkg
+ fi
+
+ (cd ${JENKINS_WORKSPACE}/${repo_proj} && repo init -u https://github.com/OP-TEE/manifest.git -m ${repo_proj}.xml < /dev/null && repo sync --no-clone-bundle --no-tags --quiet -j$(nproc))
+
+ # FIXME grub master fails to build
+ # grub-mkimage: error: undefined symbol grub_arch_sync_dma_caches
+ # Fetch a known working grub commit revision from the stable manifests
+ if [ "${repo_proj}" == "hikey" ]; then
+ (cd ${JENKINS_WORKSPACE}/${repo_proj}/grub && git checkout 007f0b407f72314ec832d77e15b83ea40b160037)
+ fi
+
+ # Fetch a local copy of dtc+libfdt to avoid issues with a possibly outdated libfdt-dev
+ # DTC (libfdt) version >= 1.4.2 is required
+ if [ "${repo_proj}" == "qemu_v8" ]; then
+ (cd ${JENKINS_WORKSPACE}/${repo_proj}/qemu && git submodule update --init dtc)
+ fi
+
+ (cd ${JENKINS_WORKSPACE}/${repo_proj}/build && ${make} -f toolchain.mk toolchains && ${make} all)
+done