Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 512 lines (422 sloc) 16.609 kB
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
1 #!/bin/bash
2
3 # Original script done by Don Darling
4 # Later changes by Koen Kooi and Brijesh Singh
5
6 # Revision history:
108c034 @koenkooi oebb: switch to git managed local.conf
koenkooi authored
7 # 20090902: download from twiki
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
8 # 20090903: Weakly assign MACHINE and DISTRO
9 # 20090904: * Don't recreate local.conf is it already exists
10 # * Pass 'unknown' machines to OE directly
11 # 20090918: Fix /bin/env location
12 # Don't pass MACHINE via env if it's not set
13 # Changed 'build' to 'bitbake' to prepare people for non-scripted usage
14 # Print bitbake command it executes
15 # 20091012: Add argument to accept commit id.
16 # 20091202: Fix proxy setup
7de547c @koenkooi oebb: don't generate mirror tarballs by default
koenkooi authored
17 #
18 # For further changes consult 'git log' or browse to:
108c034 @koenkooi oebb: switch to git managed local.conf
koenkooi authored
19 # http://git.angstrom-distribution.org/cgi-bin/cgit.cgi/setup-scripts/
7de547c @koenkooi oebb: don't generate mirror tarballs by default
koenkooi authored
20 # to see the latest revision history
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
21
1f3cc14 @koenkooi oebb: move to release tag
koenkooi authored
22 # Use this till we get a maintenance branch based of the release tag
23
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
24 ###############################################################################
25 # User specific vars like proxy servers
26 ###############################################################################
27
28 #PROXYHOST=wwwgate.ti.com
29 #PROXYPORT=80
6a43974 @koenkooi oebb: generate sourceable env file
koenkooi authored
30 PROXYHOST=""
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
31
32 ###############################################################################
33 # OE_BASE - The root directory for all OE sources and development.
34 ###############################################################################
35 OE_BASE=${PWD}
52e9530 @koenkooi oebb: recreate environment file on BASE_VERSION mismatch
koenkooi authored
36 # incremement this to force recreation of config files
e6af504 @kraj angstrom-next: Move DEPLOY_DIR outside tmpdir w.r.t. TCLIBC
kraj authored
37 BASE_VERSION=9
79cc86c @koenkooi oebb: next -> v2014.12
koenkooi authored
38 OE_ENV_FILE=environment-angstrom-v2014.12
f6f42a1 @koenkooi oebb: add infrastructure for using git submodules, disabled for now
koenkooi authored
39
85122ab @koenkooi oebb.sh: have git 2.x
koenkooi authored
40 GITMAJOR="$(git --version | awk '{print $3}' | awk -F. '{print $1}')"
6596d85 @koenkooi oebb.sh: test for git 1.8 and fall back to old test if older
koenkooi authored
41 GITMINOR="$(git --version | awk '{print $3}' | awk -F. '{print $2}')"
801fd1f @koenkooi oebb: check for outdated 'git' binary
koenkooi authored
42
85122ab @koenkooi oebb.sh: have git 2.x
koenkooi authored
43 if [ ${GITMAJOR} -lt 2 ] ; then
44 if [ ${GITMINOR} -lt 8 ] ; then
45 if ! git help log | grep -q no-abbrev ; then
46 echo "Your installed version of git is too old, it lacks --no-abbrev. Please install 1.7.6 or newer"
47 exit 1
48 fi
6596d85 @koenkooi oebb.sh: test for git 1.8 and fall back to old test if older
koenkooi authored
49 fi
50 fi
801fd1f @koenkooi oebb: check for outdated 'git' binary
koenkooi authored
51
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
52 ###############################################################################
67b1792 @koenkooi oebb: recreate site.conf if needed
koenkooi authored
53 # CONFIG_OE() - Configure OpenEmbedded
54 ###############################################################################
55 function config_oe()
56 {
57
58 MACHINE="${CL_MACHINE}"
59
60 #--------------------------------------------------------------------------
61 # Write out the OE bitbake configuration file.
62 #--------------------------------------------------------------------------
63 mkdir -p ${OE_BUILD_DIR}/conf
64
65 # There's no need to rewrite site.conf when changing MACHINE
66 if [ ! -e ${OE_BUILD_DIR}/conf/site.conf ]; then
67 cat > ${OE_BUILD_DIR}/conf/site.conf <<_EOF
68
69 SCONF_VERSION = "1"
70
71 # Where to store sources
72 DL_DIR = "${OE_SOURCE_DIR}/downloads"
73
74 # Where to save shared state
75 SSTATE_DIR = "${OE_BUILD_DIR}/build/sstate-cache"
76
77 # Which files do we want to parse:
78 BBFILES ?= "${OE_SOURCE_DIR}/openembedded-core/meta/recipes-*/*/*.bb"
79
80 TMPDIR = "${OE_BUILD_TMPDIR}"
81
82 # Go through the Firewall
83 #HTTP_PROXY = "http://${PROXYHOST}:${PROXYPORT}/"
84
85 _EOF
86 fi
87 if [ ! -e ${OE_BUILD_DIR}/conf/auto.conf ]; then
88 cat > ${OE_BUILD_DIR}/conf/auto.conf <<_EOF
89 MACHINE ?= "${MACHINE}"
90 _EOF
91 else
92 eval "sed -i -e 's/^MACHINE.*$/MACHINE ?= \"${MACHINE}\"/g' ${OE_BUILD_DIR}/conf/auto.conf"
93 fi
94 }
95
96 ###############################################################################
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
97 # SET_ENVIRONMENT() - Setup environment variables for OE development
98 ###############################################################################
99 function set_environment()
100 {
6a43974 @koenkooi oebb: generate sourceable env file
koenkooi authored
101
03810d5 @koenkooi oebb: work with bitbake master
koenkooi authored
102 # Workaround for differences between yocto bitbake and vanilla bitbake
103 export BBFETCH2=True
104
87920f5 @koenkooi oebb: hook up tag and changelog functionality from layerman
koenkooi authored
105 export TAG
106
6a43974 @koenkooi oebb: generate sourceable env file
koenkooi authored
107 #--------------------------------------------------------------------------
108 # If an env already exists, use it, otherwise generate it
109 #--------------------------------------------------------------------------
52e9530 @koenkooi oebb: recreate environment file on BASE_VERSION mismatch
koenkooi authored
110
8f81ffd @koenkooi oebb: make environment file configurable
koenkooi authored
111 if [ -e ${OE_ENV_FILE} ] ; then
112 . ${OE_ENV_FILE}
63ceb90 @kraj oebb.sh, .gitignore, build/conf: Add capability to issue bitbake comm…
kraj authored
113 fi
52e9530 @koenkooi oebb: recreate environment file on BASE_VERSION mismatch
koenkooi authored
114
115 if [ x"${BASE_VERSION}" != x"${SCRIPTS_BASE_VERSION}" ] ; then
8f81ffd @koenkooi oebb: make environment file configurable
koenkooi authored
116 echo "BASE_VERSION mismatch, recreating ${OE_ENV_FILE}"
e2c610b @koenkooi oebb: also remove site.conf when BASE_VERSION doesn't match
koenkooi authored
117 rm -f ${OE_ENV_FILE} ${OE_BUILD_DIR}/conf/site.conf
63ceb90 @kraj oebb.sh, .gitignore, build/conf: Add capability to issue bitbake comm…
kraj authored
118 fi
52e9530 @koenkooi oebb: recreate environment file on BASE_VERSION mismatch
koenkooi authored
119
8f81ffd @koenkooi oebb: make environment file configurable
koenkooi authored
120 if [ -e ${OE_ENV_FILE} ] ; then
121 . ${OE_ENV_FILE}
6a43974 @koenkooi oebb: generate sourceable env file
koenkooi authored
122 else
123
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
124 #--------------------------------------------------------------------------
125 # Specify distribution information
126 #--------------------------------------------------------------------------
3670c9b @ebenard oebb.sh: grep for word DISTRO
ebenard authored
127 DISTRO=$(grep -w DISTRO conf/local.conf | grep -v '^#' | awk -F\" '{print $2}')
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
128 DISTRO_DIRNAME=`echo $DISTRO | sed s#[.-]#_#g`
129
8f81ffd @koenkooi oebb: make environment file configurable
koenkooi authored
130 echo "export SCRIPTS_BASE_VERSION=${BASE_VERSION}" > ${OE_ENV_FILE}
131 echo "export BBFETCH2=True" >> ${OE_ENV_FILE}
03810d5 @koenkooi oebb: work with bitbake master
koenkooi authored
132
8f81ffd @koenkooi oebb: make environment file configurable
koenkooi authored
133 echo "export DISTRO=\"${DISTRO}\"" >> ${OE_ENV_FILE}
134 echo "export DISTRO_DIRNAME=\"${DISTRO_DIRNAME}\"" >> ${OE_ENV_FILE}
6a43974 @koenkooi oebb: generate sourceable env file
koenkooi authored
135
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
136 #--------------------------------------------------------------------------
137 # Specify the root directory for your OpenEmbedded development
138 #--------------------------------------------------------------------------
63ceb90 @kraj oebb.sh, .gitignore, build/conf: Add capability to issue bitbake comm…
kraj authored
139 OE_BUILD_DIR=${OE_BASE}
140 OE_BUILD_TMPDIR="${OE_BUILD_DIR}/build/tmp-${DISTRO_DIRNAME}"
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
141 OE_SOURCE_DIR=${OE_BASE}/sources
1604759 @shr-project oebb.sh: use OE_LAYERS_TXT variable instead of repeating layers.txt path
shr-project authored
142 OE_LAYERS_TXT="${OE_SOURCE_DIR}/layers.txt"
448286d @koenkooi oebb: add some missing vars to environment script, reported by Gregg …
koenkooi authored
143
559117d @koenkooi oebb: catch up with yocto bitbake wrapper usage for pseude
koenkooi authored
144 export BUILDDIR=${OE_BUILD_DIR}
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
145 mkdir -p ${OE_BUILD_DIR}
146 mkdir -p ${OE_SOURCE_DIR}
147 export OE_BASE
148
8f81ffd @koenkooi oebb: make environment file configurable
koenkooi authored
149 echo "export OE_BUILD_DIR=\"${OE_BUILD_DIR}\"" >> ${OE_ENV_FILE}
150 echo "export BUILDDIR=\"${OE_BUILD_DIR}\"" >> ${OE_ENV_FILE}
151 echo "export OE_BUILD_TMPDIR=\"${OE_BUILD_TMPDIR}\"" >> ${OE_ENV_FILE}
152 echo "export OE_SOURCE_DIR=\"${OE_SOURCE_DIR}\"" >> ${OE_ENV_FILE}
7e5c2ae @kraj oebb.sh: Export OE_LAYERS_TXT into env file
kraj authored
153 echo "export OE_LAYERS_TXT=\"${OE_LAYERS_TXT}\"" >> ${OE_ENV_FILE}
448286d @koenkooi oebb: add some missing vars to environment script, reported by Gregg …
koenkooi authored
154
8f81ffd @koenkooi oebb: make environment file configurable
koenkooi authored
155 echo "export OE_BASE=\"${OE_BASE}\"" >> ${OE_ENV_FILE}
6a43974 @koenkooi oebb: generate sourceable env file
koenkooi authored
156
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
157 #--------------------------------------------------------------------------
158 # Include up-to-date bitbake in our PATH.
159 #--------------------------------------------------------------------------
c36e086 @koenkooi oebb: convert from yocto to oe-core
koenkooi authored
160 export PATH=${OE_SOURCE_DIR}/openembedded-core/scripts:${OE_SOURCE_DIR}/bitbake/bin:${PATH}
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
161
8f81ffd @koenkooi oebb: make environment file configurable
koenkooi authored
162 echo "export PATH=\"${PATH}\"" >> ${OE_ENV_FILE}
6a43974 @koenkooi oebb: generate sourceable env file
koenkooi authored
163
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
164 #--------------------------------------------------------------------------
165 # Make sure Bitbake doesn't filter out the following variables from our
166 # environment.
167 #--------------------------------------------------------------------------
be691f6 @kraj oebb.sh: Export TCLIBC,TCMODE and delete ANGSTROMLIBC
kraj authored
168 export BB_ENV_EXTRAWHITE="MACHINE DISTRO TCLIBC TCMODE GIT_PROXY_COMMAND http_proxy ftp_proxy https_proxy all_proxy ALL_PROXY no_proxy SSH_AGENT_PID SSH_AUTH_SOCK BB_SRCREV_POLICY SDKMACHINE BB_NUMBER_THREADS"
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
169
8f81ffd @koenkooi oebb: make environment file configurable
koenkooi authored
170 echo "export BB_ENV_EXTRAWHITE=\"${BB_ENV_EXTRAWHITE}\"" >> ${OE_ENV_FILE}
6a43974 @koenkooi oebb: generate sourceable env file
koenkooi authored
171
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
172 #--------------------------------------------------------------------------
173 # Specify proxy information
174 #--------------------------------------------------------------------------
6a43974 @koenkooi oebb: generate sourceable env file
koenkooi authored
175 if [ "x$PROXYHOST" != "x" ] ; then
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
176 export http_proxy=http://${PROXYHOST}:${PROXYPORT}/
177 export ftp_proxy=http://${PROXYHOST}:${PROXYPORT}/
178
179 export SVN_CONFIG_DIR=${OE_BUILD_DIR}/subversion_config
180 export GIT_CONFIG_DIR=${OE_BUILD_DIR}/git_config
181
8f81ffd @koenkooi oebb: make environment file configurable
koenkooi authored
182 echo "export http_proxy=\"${http_proxy}\"" >> ${OE_ENV_FILE}
183 echo "export ftp_proxy=\"${ftp_proxy}\"" >> ${OE_ENV_FILE}
184 echo "export SVN_CONFIG_DIR=\"${SVN_CONFIG_DIR}\"" >> ${OE_ENV_FILE}
185 echo "export GIT_CONFIG_DIR=\"${GIT_CONFIG_DIR}\"" >> ${OE_ENV_FILE}
66f12b9 @koenkooi oebb: only write to env file from a single place
koenkooi authored
186 echo "export GIT_PROXY_COMMAND=\"\${GIT_CONFIG_DIR}/git-proxy.sh\"" >> ${OE_ENV_FILE}
6a43974 @koenkooi oebb: generate sourceable env file
koenkooi authored
187
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
188 config_svn_proxy
189 config_git_proxy
d9bdbe2 @koenkooi oebb: replace all tabs with 4 spaces for consistency
koenkooi authored
190 fi
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
191
192 #--------------------------------------------------------------------------
193 # Set up the bitbake path to find the OpenEmbedded recipes.
194 #--------------------------------------------------------------------------
c36e086 @koenkooi oebb: convert from yocto to oe-core
koenkooi authored
195 export BBPATH=${OE_BUILD_DIR}:${OE_SOURCE_DIR}/openembedded-core/meta${BBPATH_EXTRA}
00a0c9e @jadonk Utilize commit ID in updates
jadonk authored
196
8f81ffd @koenkooi oebb: make environment file configurable
koenkooi authored
197 echo "export BBPATH=\"${BBPATH}\"" >> ${OE_ENV_FILE}
00a0c9e @jadonk Utilize commit ID in updates
jadonk authored
198
d9bdbe2 @koenkooi oebb: replace all tabs with 4 spaces for consistency
koenkooi authored
199 #--------------------------------------------------------------------------
bb16b33 @koenkooi oebb: remove hidden sudo
koenkooi authored
200 # Look for dash
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
201 #--------------------------------------------------------------------------
0ed3d15 @koenkooi oebb.sh: fix autorun logic
koenkooi authored
202 if [ "$(readlink /bin/sh)" = "dash" ] ; then
bb16b33 @koenkooi oebb: remove hidden sudo
koenkooi authored
203 echo "/bin/sh is a symlink to dash, please point it to bash instead"
204 exit 1
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
205 fi
8f98636 @koenkooi oebb: add usage note for ~/.oe/environment
koenkooi authored
206
79f4fb8 @TheTasslehoff Fix message to give the correct path to the environment setup script
TheTasslehoff authored
207 echo "There now is a sourceable script in ${OE_ENV_FILE} You can do '. ${OE_ENV_FILE}' and run 'bitbake something' without using $0 as wrapper"
8f81ffd @koenkooi oebb: make environment file configurable
koenkooi authored
208 fi # if -e ${OE_ENV_FILE}
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
209
67b1792 @koenkooi oebb: recreate site.conf if needed
koenkooi authored
210 if ! [ -e ${OE_BUILD_DIR}/conf/site.conf ] ; then
211 config_oe
212 fi
213
214 }
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
215
216 ###############################################################################
217 # UPDATE_ALL() - Make sure everything is up to date
218 ###############################################################################
219 function update_all()
220 {
221 set_environment
222 update_oe
223 }
224
be08896 @koenkooi oebb: add clean command
koenkooi authored
225 ###############################################################################
226 # CLEAN_OE() - Delete TMPDIR
227 ###############################################################################
228 function clean_oe()
229 {
230 set_environment
00a0c9e @jadonk Utilize commit ID in updates
jadonk authored
231 echo "Cleaning ${OE_BUILD_TMPDIR}"
232 rm -rf ${OE_BUILD_TMPDIR}
be08896 @koenkooi oebb: add clean command
koenkooi authored
233 }
234
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
235
236 ###############################################################################
237 # OE_BUILD() - Build an OE package or image
238 ###############################################################################
239 function oe_build()
240 {
088be90 @koenkooi oebb: put machine in auto.conf
koenkooi authored
241 if [ ! -e ${OE_BUILD_DIR}/conf/auto.conf ] ; then
1631d04 @koenkooi oebb.sh: if MACHINE is set in env on first invocation autorun the con…
koenkooi authored
242 if [ -z $MACHINE ] ; then
243 echo "No config found, please run $0 config <machine> first"
244 else
245 CL_MACHINE=$MACHINE
0ed3d15 @koenkooi oebb.sh: fix autorun logic
koenkooi authored
246 set_environment
1631d04 @koenkooi oebb.sh: if MACHINE is set in env on first invocation autorun the con…
koenkooi authored
247 config_oe && update_all
248 fi
249 fi
250
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
251 set_environment
8f81ffd @koenkooi oebb: make environment file configurable
koenkooi authored
252 if [ -e ${OE_ENV_FILE} ] ; then
253 echo "Using ${OE_ENV_FILE} to setup needed variables. It is recommended to do '. ${OE_ENV_FILE}' and run 'bitbake something' without using $0 as wrapper"
8161238 @koenkooi oebb: improve messaging to user
koenkooi authored
254 fi
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
255 cd ${OE_BUILD_DIR}
256 if [ -z $MACHINE ] ; then
257 echo "Executing: bitbake" $*
258 bitbake $*
0ab7e88 @koenkooi oebb.sh: pass bitbake error code back to shell
koenkooi authored
259 rc=$?
0d13b6b @koenkooi oebb.sh: add workaround for -k propagating errors
koenkooi authored
260 if [ -z $IGNOREERRORS ] ; then
261 if [[ $rc != 0 ]] ; then
262 exit $rc
263 fi
0ab7e88 @koenkooi oebb.sh: pass bitbake error code back to shell
koenkooi authored
264 fi
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
265 else
266 echo "Executing: MACHINE=${MACHINE} bitbake" $*
267 MACHINE=${MACHINE} bitbake $*
0ab7e88 @koenkooi oebb.sh: pass bitbake error code back to shell
koenkooi authored
268 rc=$?
0d13b6b @koenkooi oebb.sh: add workaround for -k propagating errors
koenkooi authored
269 if [ -z $IGNOREERRORS ] ; then
270 if [[ $rc != 0 ]] ; then
271 exit $rc
272 fi
273 fi
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
274 fi
275 }
276
277
278 ###############################################################################
00a0c9e @jadonk Utilize commit ID in updates
jadonk authored
279 # OE_CONFIG() - Configure OE for a target
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
280 ###############################################################################
281 function oe_config()
282 {
283 set_environment
284 config_oe
1631d04 @koenkooi oebb.sh: if MACHINE is set in env on first invocation autorun the con…
koenkooi authored
285 update_all
c7b71f4 @koenkooi oebb: be more verbose about ~/oe/.environment and report when config …
koenkooi authored
286
287 echo ""
d9bdbe2 @koenkooi oebb: replace all tabs with 4 spaces for consistency
koenkooi authored
288 echo "Setup for ${CL_MACHINE} completed"
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
289 }
290
291 ###############################################################################
292 # UPDATE_OE() - Update OpenEmbedded distribution.
293 ###############################################################################
294 function update_oe()
295 {
e4d6fb8 oebb: protect call to git_proxy setup as well
Gregg Lebovitz authored
296 if [ "x$PROXYHOST" != "x" ] ; then
297 config_git_proxy
298 fi
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
299
20193e2 @koenkooi oebb: hide stash output, simplify oebb update handling
koenkooi authored
300 #manage meta-openembedded and meta-angstrom with layerman
7e5c2ae @kraj oebb.sh: Export OE_LAYERS_TXT into env file
kraj authored
301 env gawk -v command=update -f ${OE_BASE}/scripts/layers.awk ${OE_LAYERS_TXT}
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
302 }
303
304 ###############################################################################
305 # CONFIG_SVN_PROXY() - Configure subversion proxy information
306 ###############################################################################
307 function config_svn_proxy()
308 {
309 if [ ! -f ${SVN_CONFIG_DIR}/servers ]
310 then
311 mkdir -p ${SVN_CONFIG_DIR}
312 cat >> ${SVN_CONFIG_DIR}/servers <<_EOF
313 [global]
314 http-proxy-host = ${PROXYHOST}
315 http-proxy-port = ${PROXYPORT}
316 _EOF
317 fi
318 }
319
320
321 ###############################################################################
322 # CONFIG_GIT_PROXY() - Configure GIT proxy information
323 ###############################################################################
324 function config_git_proxy()
325 {
326 if [ ! -f ${GIT_CONFIG_DIR}/git-proxy.sh ]
327 then
328 mkdir -p ${GIT_CONFIG_DIR}
329 cat > ${GIT_CONFIG_DIR}/git-proxy.sh <<_EOF
330 if [ -x /bin/env ] ; then
331 exec /bin/env corkscrew ${PROXYHOST} ${PROXYPORT} \$*
332 else
333 exec /usr/bin/env corkscrew ${PROXYHOST} ${PROXYPORT} \$*
334 fi
335 _EOF
336 chmod +x ${GIT_CONFIG_DIR}/git-proxy.sh
89b0519 @koenkooi oebb: fix git_config logic to not always append to ~/.oe/environement
koenkooi authored
337 export GIT_PROXY_COMMAND=${GIT_CONFIG_DIR}/git-proxy.sh
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
338 fi
339 }
340
87920f5 @koenkooi oebb: hook up tag and changelog functionality from layerman
koenkooi authored
341 ###############################################################################
342 # tag_layers - Tag all layers with a given tag
343 ###############################################################################
344 function tag_layers()
345 {
346 set_environment
1604759 @shr-project oebb.sh: use OE_LAYERS_TXT variable instead of repeating layers.txt path
shr-project authored
347 env gawk -v command=tag -v commandarg=$TAG -f ${OE_BASE}/scripts/layers.awk ${OE_LAYERS_TXT}
fe00ded @koenkooi oebb: store tagnames in 'tags' file for future reference
koenkooi authored
348 echo $TAG >> ${OE_BASE}/tags
87920f5 @koenkooi oebb: hook up tag and changelog functionality from layerman
koenkooi authored
349 }
350
351 ###############################################################################
c10890a @shr-project oebb.sh: add reset command
shr-project authored
352 # reset_layers - Remove all local changes including stash and ignored files
353 ###############################################################################
354 function reset_layers()
355 {
356 set_environment
7e5c2ae @kraj oebb.sh: Export OE_LAYERS_TXT into env file
kraj authored
357 env gawk -v command=reset -f ${OE_BASE}/scripts/layers.awk ${OE_LAYERS_TXT}
c10890a @shr-project oebb.sh: add reset command
shr-project authored
358 }
359
360 ###############################################################################
2ac18a8 @dasty oebb: Proper comment for changelog
dasty authored
361 # changelog - Display changelog for all layers with a given tag
87920f5 @koenkooi oebb: hook up tag and changelog functionality from layerman
koenkooi authored
362 ###############################################################################
363 function changelog()
364 {
edf3110 @koenkooi layerman: add 'info' command to generate a list of the current branch…
koenkooi authored
365 set_environment
7e5c2ae @kraj oebb.sh: Export OE_LAYERS_TXT into env file
kraj authored
366 env gawk -v command=changelog -v commandarg=$TAG -f ${OE_BASE}/scripts/layers.awk ${OE_LAYERS_TXT}
edf3110 @koenkooi layerman: add 'info' command to generate a list of the current branch…
koenkooi authored
367 }
368
369 ###############################################################################
370 # layer_info - Get layer info
371 ###############################################################################
372 function layer_info()
373 {
374 set_environment
375 rm -f ${OE_SOURCE_DIR}/info.txt
1604759 @shr-project oebb.sh: use OE_LAYERS_TXT variable instead of repeating layers.txt path
shr-project authored
376 env gawk -v command=info -f ${OE_BASE}/scripts/layers.awk ${OE_LAYERS_TXT}
edf3110 @koenkooi layerman: add 'info' command to generate a list of the current branch…
koenkooi authored
377 echo
378 echo "Showing contents of ${OE_SOURCE_DIR}/info.txt:"
379 echo
380 cat ${OE_SOURCE_DIR}/info.txt
381 echo
87920f5 @koenkooi oebb: hook up tag and changelog functionality from layerman
koenkooi authored
382 }
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
383
384 ###############################################################################
c3f1e08 @dasty Adding support for checkout of particular tag/branch
dasty authored
385 # checkout - Checkout all layers with a given tag
386 ###############################################################################
387 function checkout()
388 {
389 set_environment
7e5c2ae @kraj oebb.sh: Export OE_LAYERS_TXT into env file
kraj authored
390 env gawk -v command=checkout -v commandarg=$TAG -f ${OE_BASE}/scripts/layers.awk ${OE_LAYERS_TXT}
c3f1e08 @dasty Adding support for checkout of particular tag/branch
dasty authored
391 }
392
393
394 ###############################################################################
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
395 # Build the specified OE packages or images.
396 ###############################################################################
be08896 @koenkooi oebb: add clean command
koenkooi authored
397
7acffc2 @chiragnagpal modified: oebb.sh
chiragnagpal authored
398 # FIXME: converted to case/esac
be08896 @koenkooi oebb: add clean command
koenkooi authored
399
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
400 if [ $# -gt 0 ]
401 then
7acffc2 @chiragnagpal modified: oebb.sh
chiragnagpal authored
402 case $1 in
403
404 "update" )
405 update_all
406 exit 0
407 ;;
408
409 "info" )
410 layer_info
411 exit 0
412 ;;
413
414 "reset" )
415 reset_layers
416 exit 0
417 ;;
418
419 "tag" )
87920f5 @koenkooi oebb: hook up tag and changelog functionality from layerman
koenkooi authored
420
7acffc2 @chiragnagpal modified: oebb.sh
chiragnagpal authored
421 if [ -n "$2" ] ; then
422 TAG="$2"
423 else
424 TAG="$(date -u +'%Y%m%d-%H%M')"
425 fi
426
427 tag_layers $TAG
428 exit 0
429 ;;
87920f5 @koenkooi oebb: hook up tag and changelog functionality from layerman
koenkooi authored
430
7acffc2 @chiragnagpal modified: oebb.sh
chiragnagpal authored
431 "changelog" )
432
433 if [ -z $2 ] ; then
434 echo "Changelog needs an argument"
435 exit 1
436 else
437 TAG="$2"
438 fi
439 changelog
440 exit 0
441 ;;
442
443 "checkout" )
444
445 if [ -z $2 ] ; then
446 echo "Checkout needs an argument"
447 exit 1
448 else
449 TAG="$2"
450 fi
451 checkout
452 exit 0
453 ;;
454
0d13b6b @koenkooi oebb.sh: add workaround for -k propagating errors
koenkooi authored
455 "bitbake-k" )
456
457 shift
458 export IGNOREERRORS="1"
459 oe_build $*
460 exit 0
461 ;;
462
7acffc2 @chiragnagpal modified: oebb.sh
chiragnagpal authored
463 "bitbake" )
464
465 shift
466 oe_build $*
467 exit 0
468 ;;
469
470 "config" )
471
472 shift
473 CL_MACHINE=$1
474 shift
475 oe_config $*
476 exit 0
477 ;;
478
479 "clean" )
480
481 clean_oe
482 exit 0
483 ;;
484
485 esac
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
486 fi
487
488 # Help Screen
489 echo ""
490 echo "Usage: $0 config <machine>"
491 echo " $0 update"
c10890a @shr-project oebb.sh: add reset command
shr-project authored
492 echo " $0 reset"
6100f73 @dasty oebb: Updating Help Screen
dasty authored
493 echo " $0 tag [tagname]"
494 echo " $0 changelog <tagname>"
c3f1e08 @dasty Adding support for checkout of particular tag/branch
dasty authored
495 echo " $0 checkout <tagname>"
6100f73 @dasty oebb: Updating Help Screen
dasty authored
496 echo " $0 clean"
3d83b2d @koenkooi oebb: update usage output
koenkooi authored
497 echo ""
498 echo " Not recommended, but also possible:"
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
499 echo " $0 bitbake <bitbake target>"
8f81ffd @koenkooi oebb: make environment file configurable
koenkooi authored
500 echo " It is recommended to do '. ${OE_ENV_FILE}' and run 'bitbake something' inside ${BUILDDIR} without using oebb.sh as wrapper"
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
501 echo ""
502 echo "You must invoke \"$0 config <machine>\" and then \"$0 update\" prior"
503 echo "to your first bitbake command"
504 echo ""
505 echo "The <machine> argument can be one of the following"
90203a2 @koenkooi oebb: change example machine listing
koenkooi authored
506 echo " beagleboard: BeagleBoard"
507 echo " qemuarm Emulated ARM machine"
508 echo " qemumips: Emulated MIPS machine"
509 echo " fri2-noemgd: Intel FRI2 machine without graphics"
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
510 echo ""
511 echo "Other machines are valid as well, but listing those would make this message way too long"
Something went wrong with that request. Please try again.