-
Notifications
You must be signed in to change notification settings - Fork 139
/
setup-environment
62 lines (48 loc) · 1.33 KB
/
setup-environment
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
#!/bin/sh
# Inspired by "probe" in oe-init-build-env
if [ -n "$BASH_SOURCE" ]; then
this_script=$BASH_SOURCE
elif [ -n "$ZSH_NAME" ]; then
this_script=$0
else
this_script="$(pwd)/setup-environment"
fi
script_dir=$(dirname "$this_script")
script_dir=$(readlink -f "$script_dir")
mender_community_dir=${script_dir}/sources/meta-mender-community
build_dir=${script_dir}/build
target=""
targets=(
"qemu"
"raspberrypi"
"renesas"
"rockchip"
"sunxi"
"toradex-nxp"
"variscite")
for i in ${targets[@]}
do
if [[ $i == $1 ]]
then
target=$1
break
fi
done
if [ -z "${target}" ]; then
echo "Sorry, it does not seem that *$1* is a valid target"
echo ""
printf "Supported targets are:\n"
printf '%s\n' "${targets[@]}"
return 1
fi
target_templates=${mender_community_dir}/meta-mender-${target}/templates
. ${script_dir}/sources/poky/oe-init-build-env ${build_dir}
if [ -f ${build_dir}/conf/mender_append_complete ]; then
return 1
fi
# Common entries for Mender
cat ${mender_community_dir}/templates/local.conf.append >> ${build_dir}/conf/local.conf
# Board specific entries
cp ${target_templates}/bblayers.conf.sample ${build_dir}/conf/bblayers.conf
cat ${target_templates}/local.conf.append >> ${build_dir}/conf/local.conf
touch ${build_dir}/conf/mender_append_complete