-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-environment
executable file
·119 lines (85 loc) · 2.82 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
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
117
#!/bin/sh
#
if [ "$(whoami)" = "root" ]; then
echo "ERROR: do not use the BSP as root. Exiting..."
fi
if [ -z "$MACHINE" ]; then
MACHINE='am437x-evm'
fi
if [ -z "$SDKMACHINE" ]; then
SDKMACHINE='i686'
fi
if [ -z "$DISTRO" ]; then
DISTRO='poky'
fi
CWD=`pwd`
cd sources/poky
. ./oe-init-build-env $CWD/$1 > /dev/null
# Clean up PATH, because if it includes tokens to current directories somehow,
# wrong binaries can be used instead of the expected ones during task execution
export PATH="`echo $PATH | sed 's/\(:.\|:\)*:/:/g;s/^.\?://;s/:.\?$//'`"
generated_config=
if [ ! -e conf/local.conf.sample ]; then
mv conf/local.conf conf/local.conf.sample
# Generate the local.conf based on the Yocto defaults
TEMPLATES=$CWD/sources/base/conf
NCPU=`grep -c processor /proc/cpuinfo`
grep -v '^#\|^$' conf/local.conf.sample > conf/local.conf
cat >> conf/local.conf <<EOF
BB_NUMBER_THREADS = '$NCPU'
PARALLEL_MAKE = '-j $NCPU'
PACKAGE_CLASSES = "package_ipk"
PREFERRED_PROVIDER_libqwt-dev = "libqwt"
PREFERRED_PROVIDER_qwt = "libqwt"
PREFERRED_PROVIDER_virtual/libgl = "mesa-gl"
PREFERRED_PROVIDER_virtual/mesa = "mesa-gl"
PREFERRED_PROVIDER_virtual/egl = "ti-sgx-ddk-um"
PREFERRED_PROVIDER_virtual/libgles1 = "ti-sgx-ddk-um"
PREFERRED_PROVIDER_virtual/libgles2 = "ti-sgx-ddk-um"
PREFERRED_PROVIDER_libgbm = "libgbm"
PREFERRED_PROVIDER_libgbm-dev = "libgbm-dev"
PREFERRED_PROVIDER_jpeg = "libjpeg-turbo"
PREFERRED_PROVIDER_jpeg-native = "libjpeg-turbo-native"
INHERIT = "rm_work"
#INHERIT += "archiver"
#ARCHIVER_MODE[src] = "original"
#LICENSE_FLAGS_WHITELIST = "commercial"
IMAGE_CMD_TAR = "find ${IMAGE_ROOTFS} -type f |\
grep -vF md5sum.txt | xargs -d '\n' md5sum > md5sum-full.txt && \
awk -F "${WORKDIR}/rootfs/" '{print $1 $2}' md5sum-full.txt > ${IMAGE_ROOTFS}/md5sum.txt && tar"
EOF
# Change settings according environment
sed -e "s,MACHINE ??=.*,MACHINE ??= '$MACHINE',g" \
-e "s,SDKMACHINE ??=.*,SDKMACHINE ??= '$SDKMACHINE',g" \
-e "s,DISTRO ?=.*,DISTRO ?= '$DISTRO',g" \
-i conf/local.conf
cp $TEMPLATES/* conf/
generated_config=1
fi
cat <<EOF
Welcome to MIBTEC BSP
The Yocto Project has extensive documentation about OE including a
reference manual which can be found at:
http://yoctoproject.org/documentation
For more information about OpenEmbedded see their website:
http://www.openembedded.org/
You can now run 'bitbake <target>'
Mibtec targets are for example:
demo-image
Common targets are:
core-image-minimal
meta-toolchain
meta-toolchain-sdk
adt-installer
meta-ide-support
EOF
if [ -n "$generated_config" ]; then
cat <<EOF
Your build environemnt has been configured with:
MACHINE=$MACHINE
SDKMACHINE=$SDKMACHINE
DISTRO=$DISTRO
EOF
else
echo "Your configuration files at $1 has not been touched."
fi