blob: 1f0bdd7fa54de4d485ada98b9dcaf677aa8d2464 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
|
#!/bin/bash
# Script used by CI to build the ARM Trusted Firmware
error_count=0
built_count=0
function count_errors {
if [ $1 -ne 0 ]; then
error_count=$(($error_count + 1))
else
built_count=$(($built_count + 1))
fi
return $1
}
set -e
if [ -z "${WORKSPACE}" ]; then
# Local build
export WORKSPACE=`pwd`
export BUILD_NUMBER=${BUILD_NUMBER:-0}
export JOB_NAME=${JOB_NAME:-fvp-pre-boot}
fi
case "${JOB_NAME}" in
fvp-pre-boot)
repo=arm-trusted-firmware
repo_url=/linaro/g.l.o/arm/models/
branch=linaro
;;
fvp-pre-boot-master)
repo=arm-trusted-firmware
repo_url=git://git.linaro.org/arm/models
branch=master
;;
fvp-pre-boot-integration)
repo=arm-trusted-firmware
repo_url=git://git.linaro.org/arm/models
branch=integration
;;
fvp-pre-boot-upstream)
repo=arm-trusted-firmware
repo_url=http://github.com/ARM-software
branch=master
;;
*)
echo "Invalid JOB_NAME $JOB_NAME"
exit 1
;;
esac
echo "WORKSPACE ${WORKSPACE}"
echo "BUILD_NUMBER ${BUILD_NUMBER}"
echo "JOB_NAME ${JOB_NAME}"
echo "repo ${repo}"
echo "repo_url ${repo_url}"
echo "branch ${branch}"
pkg_source=${JOB_NAME}
pkg_repository=$repo_url/${repo}.git
if [ "${BUILD_NUMBER}" -eq 0 ]; then
git clone --depth 1 ${pkg_repository} -b ${branch}
fi
scm_commit=`cd ${repo} && git log -n1 --pretty=format:%h`
if [ -z "${scm_commit}" ]; then
echo "Invalid git revision: ${scm_commit}" >&2
exit 1
fi
base_version=0.2.`date +%Y%m%d`
pkg_version=${base_version}+git${BUILD_NUMBER}+${scm_commit}
pkg_dir=${pkg_source}-${pkg_version}
unset ARCH
export builddir=${WORKSPACE}/${JOB_NAME}-build
export REPO_WORKSPACE=${WORKSPACE}/${repo}
export CROSS_COMPILE=${CROSS_COMPILE:-aarch64-linux-gnu-}
rm -rf ${builddir} && mkdir -p ${builddir}
# Create source tarball
cd ${REPO_WORKSPACE}
git checkout ${branch}
git archive --format=tar --prefix=${pkg_dir}/ ${branch} | bzip2 > ${pkg_source}_${pkg_version}.orig.tar.bz2
mv ${pkg_source}_${pkg_version}.orig.tar.bz2 ${builddir}
cd ${WORKSPACE}
# disable exit on error
set +e
cd ${REPO_WORKSPACE}
make PLAT=fvp all fip
count_errors $?
cp -a ${REPO_WORKSPACE}/build/fvp/release/*.bin ${builddir}
# If nothing build, return an error
if [ $built_count -eq 0 ]; then
exit $error_count
fi
# We want to return 0 if something built so that the files get copied to snapshots.linaro.org
exit 0
|