summaryrefslogtreecommitdiff
path: root/init-and-build.sh
blob: c66d72407fc9306a4e0fe0da3c2e75863f56b41f (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
105
106
107
108
109
110
111
112
113
114
115
116
#!/bin/bash

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation version 2.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>

# set some defaults
release=13.06
arch=armv8
gcc=6.2
numproc=`getconf _NPROCESSORS_ONLN`
external_url=
manifest_branch=${manifest_branch:-master}
manifest_repository=${manifest_repository:-git://git.linaro.org/openembedded/manifest.git}
manifest_groups=
bitbake_verbose=
sstatedir=
binarytoolchain="aarch64-linux-gnu"
base_dir="/mnt/ci_build"
ptest_enabled=0

export PATH=$PATH:$HOME/bin

source $(dirname $0)/functions.sh

while getopts “ha:b:m:r:g:u:i:s:vp” OPTION
do
	case $OPTION in
		h)
			usage
			exit
			;;
		a)
			arch=$OPTARG
			;;
		b)
			manifest_branch=$OPTARG
			;;
		m)
			manifest_groups="-g $OPTARG"
			;;
		r)
			manifest_repository=$OPTARG
			;;
		g)
			gcc=$OPTARG
			;;
		u)
			external_url=$OPTARG
			;;
		i)
			init_env="$OPTARG"
			;;
		s)
			sstatedir="$OPTARG"
			;;
		v)
			bitbake_verbose="-v"
			;;
		p)
			ptest_enabled=1
			;;
	esac
done

shift $(( OPTIND-1 ))

if [ -n "${WORKSPACE}" ]; then
    WORKBASE=${base_dir}/workspace
fi

show_setup

git_clone_update

if [ ${MACHINE} == hikey-ilp32 ] || [ ${MACHINE} == genericarmv8-ilp32 ]; then
   fix_oe_core_git
fi

# the purpose of the 'init' function is to prepare the <build> folder
# the default init function suitable for Linaro Platform builds, but
# the user can specify a custom function if needed. In any case, the
# init function must ensure :
#  - oe-init-build-env is called
#  - path is changed to <build> folder
#  - user configuration files (local.conf, bblayers.conf, ..) are
#    created.
# Once the build init is done, we are adding some Linaro CI specific
# build options, when running on Jenkins.
if [ -z "$init_env" ]; then
    init_env
else
    eval $init_env
fi

# when running on Linaro CI, only.
if [ -n "${WORKSPACE}" ]; then
    init_env_linaro_ci
    cleanup_auto
fi

#bitbake gcc-cross || true
bitbake $bitbake_verbose $@
# propagate bad return codes to caller
rc=$?
if [[ $rc != 0 ]] ; then
    exit $rc
fi