-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-mix6000-buildserver
executable file
·186 lines (133 loc) · 5.21 KB
/
install-mix6000-buildserver
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
#!/bin/bash
NOT_SOURCED=0
test "X$(basename -- "$0")" = "Xinstall-mix6000-linux" && NOT_SOURCED=1
if [ $NOT_SOURCED = 1 ]; then
echo
echo "$(tput setaf 2)""Please source the script: source install-mix6000-linux""$(tput sgr 0)"
echo
exit 1
fi
CPWD=`pwd`
USERN=`whoami`
echo
echo "$(tput setaf 2)""$(tput bold)""MIX6000 Installer:" "$(tput sgr 0)"
echo
echo "$(tput setaf 2)""Please enter your sudo password:""$(tput sgr 0)"
sudo -p "" -v
echo
echo "$(tput setaf 2)""Installing missing components on Ubuntu...""$(tput sgr 0)"
echo
sudo apt-get -y install git gawk wget diffstat unzip texinfo gcc-multilib build-essential chrpath libsdl1.2-dev xterm eclipse-cdt
#openjdk-7-jre wine kdiff3 gitk
git clone https://github.com/Angstrom-distribution/setup-scripts oe
# Enable caching of username and password
git config --global credential.helper cache
git config --global user.email "${USERN}@mixtelematics.com"
git config --global user.name "${USERN}"
# Open Embedded want bash (not dash)
sudo chsh -s /bin/bash `whoami`
sudo ln -s -f /bin/bash /bin/sh
# Add additional layers
cd ${CPWD}/oe/sources
echo
echo "$(tput setaf 2)""Adding META-ATMEL to layers.txt:""$(tput sgr 0)"
grep -q "meta-atmel,https://github.com/linux4sam/meta-atmel,master,HEAD" layers.txt || echo meta-atmel,https://github.com/linux4sam/meta-atmel,master,HEAD >> layers.txt
echo
echo "$(tput setaf 2)""Adding META-MIX6000 to layers.txt (GutHub login required):""$(tput sgr 0)"
echo
grep -q "meta-mix6000,https://github.com/MiXTelematics/meta-mix6000,master,HEAD" layers.txt || echo meta-mix6000,https://github.com/MiXTelematics/meta-mix6000,master,HEAD >> layers.txt
cd ${CPWD}/oe
MACHINE=sama5d3xek ./oebb.sh config sama5d3xek
# Tuning Open Embedded for ATMEL board
cd ${CPWD}/oe/conf
# Modifying bblayers.conf
echo
echo "$(tput setaf 2)""Modifying oe/conf/bblayers.conf:""$(tput sgr 0)"
echo
if [[ ! -f bblayers.conf.orig ]]; then
cp bblayers.conf bblayers.conf.orig
fi
grep -q '${TOPDIR}/sources/meta-mix6000 \\' bblayers.conf || sed -i '/${TOPDIR}\/sources\/openembedded-core\/meta \\/a\ ${TOPDIR}\/sources\/meta-mix6000 \\' bblayers.conf
grep -q '${TOPDIR}/sources/meta-atmel \\' bblayers.conf || sed -i '/${TOPDIR}\/sources\/meta-mix6000 \\/a\ ${TOPDIR}\/sources\/meta-atmel \\' bblayers.conf
# Modifying local.conf
echo
echo "$(tput setaf 2)""Modifying oe/conf/local.conf:""$(tput sgr 0)"
echo
if [[ ! -f local.conf.orig ]]; then
cp local.conf local.conf.orig
fi
grep -q '#INHERIT += "rm_work"' local.conf || sed -i 's/INHERIT += "rm_work"/#INHERIT += "rm_work"/' local.conf
grep -q 'NO32LIBS="1"' local.conf || sed -i '/INHERIT += "rm_work"/aNO32LIBS="1"' local.conf
echo
echo "$(tput setaf 2)""Installing DS-5 debugger (and Eclipse IDE)""$(tput sgr 0)"
echo
cd ${CPWD}
mkdir -p downloads
cd ${CPWD}/downloads
#if [ ! -e DS500-BN-00019-r5p0-18rel0.tgz ]; then
# wget http://10.34.203.100/TOOLS/DS500-BN-00019-r5p0-18rel0.tgz
wget http://10.34.203.100/TOOLS/workspace.tar.gz
# wget http://10.34.203.100/TOOLS/lint.tar.gz
# wget http://10.34.203.100/TOOLS/uboot.env
# tar xvzf DS500-BN-00019-r5p0-18rel0.tgz
#fi
#if [ ! -d ${CPWD}/ds-5 ]; then
# sudo ${CPWD}/downloads/install.sh --i-agree-to-the-contained-eula --force --destination ${CPWD}/ds-5 --no-interactive --quiet --skip-menu-install
#fi
if [ ! -d ${CPWD}/workspace ]; then
cd ${CPWD}
tar xzf ${CPWD}/downloads/workspace.tar.gz
fi
#echo
#echo "$(tput setaf 2)""Adding CROSSGCC plugin to Eclipse""$(tput sgr 0)"
#echo
#cd ${CPWD}/ds-5/sw/eclipse
#./eclipse -application org.eclipse.equinox.p2.director -noSplash -repository http://download.eclipse.org/releases/kepler -installIUs org.eclipse.cdt.build.crossgcc.feature.group
#echo
#echo "$(tput setaf 2)""$(tput bold)""Creating source workspace for MIX6000 development.""$(tput sgr 0)"
#echo
mkdir -p ${CPWD}/workspace
cd ${CPWD}/workspace
echo
echo "$(tput setaf 2)""Checking out MESA and MIX6000 (Develop) repositories:""$(tput sgr 0)"
echo
if [ ! -d ${CPWD}/workspace/MESA ]; then
git clone -b Develop https://github.com/MiXTelematics/MESA
fi
if [ ! -d ${CPWD}/workspace/mix6000 ]; then
git clone -b Develop https://github.com/MiXTelematics/mix6000
fi
echo
echo "$(tput setaf 2)""Creating new MESA and MIX6000 branches for development""$(tput sgr 0)"
echo
cd ${CPWD}/workspace/MESA
MESA_DEV=0
test "$(git status | grep "On branch" | grep -o Develop)" = "Develop" && MESA_DEV=1
if [ $MESA_DEV = 1 ]; then
echo
echo "$(tput setaf 2)""Branching (Develop) MESA ==> (${USERN}-linux) MESA for your development""$(tput sgr 0)"
echo
git branch ${USERN}-linux
git checkout ${USERN}-linux
fi
cd ${CPWD}/workspace/mix6000
MIX6000_DEV=0
test "$(git status | grep "On branch" | grep -o Develop)" = "Develop" && MIX6000_DEV=1
if [ $MIX6000_DEV = 1 ]; then
echo
echo "$(tput setaf 2)""Branching (Develop) MESA ==> (${USERN}-linux) MESA for your development""$(tput sgr 0)"
echo
git branch ${USERN}-linux
git checkout ${USERN}-linux
fi
echo
echo "$(tput setaf 2)""OpenEmbedded environment setup.""$(tput sgr 0)"
echo
cd ${CPWD}/oe
ENVIR=`ls | grep environment`
source ${ENVIR}
echo
echo "$(tput setaf 2)""$(tput bold)""Building MIX6000 image""$(tput sgr 0)"
echo
cd ${CPWD}/oe
bitbake -k mix6000-image