Skip to content
Newer
Older
100755 485 lines (406 sloc) 15.5 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
877a087 @koenkooi oebb: increase BASE_VERSION
koenkooi authored
37 BASE_VERSION=6
fd8a2ed @koenkooi oebb: change name of environment file to avoid clashes with master
koenkooi authored
38 OE_ENV_FILE=~/.oe/environment-angstromv2012.05
f6f42a1 @koenkooi oebb: add infrastructure for using git submodules, disabled for now
koenkooi authored
39
d5a2268 @koenkooi layerman, oebb: another tweak to the git --no-abbrev test
koenkooi authored
40 if ! git help log | grep -q no-abbrev ; then
41 echo "Your installed version of git is too old, it lacks --no-abbrev. Please install 1.7.6 or newer"
801fd1f @koenkooi oebb: check for outdated 'git' binary
koenkooi authored
42 exit 1
43 fi
44
45
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
46 ###############################################################################
67b1792 @koenkooi oebb: recreate site.conf if needed
koenkooi authored
47 # CONFIG_OE() - Configure OpenEmbedded
48 ###############################################################################
49 function config_oe()
50 {
51
52 MACHINE="${CL_MACHINE}"
53
54 #--------------------------------------------------------------------------
55 # Write out the OE bitbake configuration file.
56 #--------------------------------------------------------------------------
57 mkdir -p ${OE_BUILD_DIR}/conf
58
59 # There's no need to rewrite site.conf when changing MACHINE
60 if [ ! -e ${OE_BUILD_DIR}/conf/site.conf ]; then
61 cat > ${OE_BUILD_DIR}/conf/site.conf <<_EOF
62
63 SCONF_VERSION = "1"
64
65 # Where to store sources
66 DL_DIR = "${OE_SOURCE_DIR}/downloads"
67
68 # Where to save shared state
69 SSTATE_DIR = "${OE_BUILD_DIR}/build/sstate-cache"
70
71 # Which files do we want to parse:
72 BBFILES ?= "${OE_SOURCE_DIR}/openembedded-core/meta/recipes-*/*/*.bb"
73
74 TMPDIR = "${OE_BUILD_TMPDIR}"
75
76 # Go through the Firewall
77 #HTTP_PROXY = "http://${PROXYHOST}:${PROXYPORT}/"
78
79 _EOF
80 fi
81 if [ ! -e ${OE_BUILD_DIR}/conf/auto.conf ]; then
82 cat > ${OE_BUILD_DIR}/conf/auto.conf <<_EOF
83 MACHINE ?= "${MACHINE}"
84 _EOF
85 else
86 eval "sed -i -e 's/^MACHINE.*$/MACHINE ?= \"${MACHINE}\"/g' ${OE_BUILD_DIR}/conf/auto.conf"
87 fi
88 }
89
90 ###############################################################################
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
91 # SET_ENVIRONMENT() - Setup environment variables for OE development
92 ###############################################################################
93 function set_environment()
94 {
6a43974 @koenkooi oebb: generate sourceable env file
koenkooi authored
95
03810d5 @koenkooi oebb: work with bitbake master
koenkooi authored
96 # Workaround for differences between yocto bitbake and vanilla bitbake
97 export BBFETCH2=True
98
87920f5 @koenkooi oebb: hook up tag and changelog functionality from layerman
koenkooi authored
99 export TAG
100
6a43974 @koenkooi oebb: generate sourceable env file
koenkooi authored
101 #--------------------------------------------------------------------------
102 # If an env already exists, use it, otherwise generate it
103 #--------------------------------------------------------------------------
52e9530 @koenkooi oebb: recreate environment file on BASE_VERSION mismatch
koenkooi authored
104
8f81ffd @koenkooi oebb: make environment file configurable
koenkooi authored
105 if [ -e ${OE_ENV_FILE} ] ; then
106 . ${OE_ENV_FILE}
63ceb90 @kraj oebb.sh, .gitignore, build/conf: Add capability to issue bitbake comm…
kraj authored
107 fi
52e9530 @koenkooi oebb: recreate environment file on BASE_VERSION mismatch
koenkooi authored
108
109 if [ x"${BASE_VERSION}" != x"${SCRIPTS_BASE_VERSION}" ] ; then
8f81ffd @koenkooi oebb: make environment file configurable
koenkooi authored
110 echo "BASE_VERSION mismatch, recreating ${OE_ENV_FILE}"
e2c610b @koenkooi oebb: also remove site.conf when BASE_VERSION doesn't match
koenkooi authored
111 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
112 fi
52e9530 @koenkooi oebb: recreate environment file on BASE_VERSION mismatch
koenkooi authored
113
8f81ffd @koenkooi oebb: make environment file configurable
koenkooi authored
114 if [ -e ${OE_ENV_FILE} ] ; then
115 . ${OE_ENV_FILE}
6a43974 @koenkooi oebb: generate sourceable env file
koenkooi authored
116 else
117
d9bdbe2 @koenkooi oebb: replace all tabs with 4 spaces for consistency
koenkooi authored
118 mkdir -p ~/.oe/
6a43974 @koenkooi oebb: generate sourceable env file
koenkooi authored
119
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
120 #--------------------------------------------------------------------------
121 # Specify distribution information
122 #--------------------------------------------------------------------------
1bcb9e8 @denix0 oebb: grep the correct DISTRO from local.conf, if there are other com…
denix0 authored
123 DISTRO=$(grep DISTRO conf/local.conf | grep -v '^#' | awk -F\" '{print $2}')
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
124 DISTRO_DIRNAME=`echo $DISTRO | sed s#[.-]#_#g`
125
8f81ffd @koenkooi oebb: make environment file configurable
koenkooi authored
126 echo "export SCRIPTS_BASE_VERSION=${BASE_VERSION}" > ${OE_ENV_FILE}
127 echo "export BBFETCH2=True" >> ${OE_ENV_FILE}
03810d5 @koenkooi oebb: work with bitbake master
koenkooi authored
128
8f81ffd @koenkooi oebb: make environment file configurable
koenkooi authored
129 echo "export DISTRO=\"${DISTRO}\"" >> ${OE_ENV_FILE}
130 echo "export DISTRO_DIRNAME=\"${DISTRO_DIRNAME}\"" >> ${OE_ENV_FILE}
6a43974 @koenkooi oebb: generate sourceable env file
koenkooi authored
131
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
132 #--------------------------------------------------------------------------
133 # Specify the root directory for your OpenEmbedded development
134 #--------------------------------------------------------------------------
63ceb90 @kraj oebb.sh, .gitignore, build/conf: Add capability to issue bitbake comm…
kraj authored
135 OE_BUILD_DIR=${OE_BASE}
136 OE_BUILD_TMPDIR="${OE_BUILD_DIR}/build/tmp-${DISTRO_DIRNAME}"
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
137 OE_SOURCE_DIR=${OE_BASE}/sources
3b0a7f9 @shr-project oebb.sh: use OE_LAYERS_TXT variable instead of repeating layers.txt path
shr-project authored
138 OE_LAYERS_TXT="${OE_SOURCE_DIR}/layers.txt"
448286d @koenkooi oebb: add some missing vars to environment script, reported by Gregg …
koenkooi authored
139
559117d @koenkooi oebb: catch up with yocto bitbake wrapper usage for pseude
koenkooi authored
140 export BUILDDIR=${OE_BUILD_DIR}
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
141 mkdir -p ${OE_BUILD_DIR}
142 mkdir -p ${OE_SOURCE_DIR}
143 export OE_BASE
144
8f81ffd @koenkooi oebb: make environment file configurable
koenkooi authored
145 echo "export OE_BUILD_DIR=\"${OE_BUILD_DIR}\"" >> ${OE_ENV_FILE}
146 echo "export BUILDDIR=\"${OE_BUILD_DIR}\"" >> ${OE_ENV_FILE}
147 echo "export OE_BUILD_TMPDIR=\"${OE_BUILD_TMPDIR}\"" >> ${OE_ENV_FILE}
148 echo "export OE_SOURCE_DIR=\"${OE_SOURCE_DIR}\"" >> ${OE_ENV_FILE}
2722b1d @kraj oebb.sh: Export OE_LAYERS_TXT into env file
kraj authored
149 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
150
8f81ffd @koenkooi oebb: make environment file configurable
koenkooi authored
151 echo "export OE_BASE=\"${OE_BASE}\"" >> ${OE_ENV_FILE}
6a43974 @koenkooi oebb: generate sourceable env file
koenkooi authored
152
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
153 #--------------------------------------------------------------------------
154 # Include up-to-date bitbake in our PATH.
155 #--------------------------------------------------------------------------
c36e086 @koenkooi oebb: convert from yocto to oe-core
koenkooi authored
156 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
157
8f81ffd @koenkooi oebb: make environment file configurable
koenkooi authored
158 echo "export PATH=\"${PATH}\"" >> ${OE_ENV_FILE}
6a43974 @koenkooi oebb: generate sourceable env file
koenkooi authored
159
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
160 #--------------------------------------------------------------------------
161 # Make sure Bitbake doesn't filter out the following variables from our
162 # environment.
163 #--------------------------------------------------------------------------
be691f6 @kraj oebb.sh: Export TCLIBC,TCMODE and delete ANGSTROMLIBC
kraj authored
164 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
165
8f81ffd @koenkooi oebb: make environment file configurable
koenkooi authored
166 echo "export BB_ENV_EXTRAWHITE=\"${BB_ENV_EXTRAWHITE}\"" >> ${OE_ENV_FILE}
6a43974 @koenkooi oebb: generate sourceable env file
koenkooi authored
167
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
168 #--------------------------------------------------------------------------
169 # Specify proxy information
170 #--------------------------------------------------------------------------
6a43974 @koenkooi oebb: generate sourceable env file
koenkooi authored
171 if [ "x$PROXYHOST" != "x" ] ; then
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
172 export http_proxy=http://${PROXYHOST}:${PROXYPORT}/
173 export ftp_proxy=http://${PROXYHOST}:${PROXYPORT}/
174
175 export SVN_CONFIG_DIR=${OE_BUILD_DIR}/subversion_config
176 export GIT_CONFIG_DIR=${OE_BUILD_DIR}/git_config
177
8f81ffd @koenkooi oebb: make environment file configurable
koenkooi authored
178 echo "export http_proxy=\"${http_proxy}\"" >> ${OE_ENV_FILE}
179 echo "export ftp_proxy=\"${ftp_proxy}\"" >> ${OE_ENV_FILE}
180 echo "export SVN_CONFIG_DIR=\"${SVN_CONFIG_DIR}\"" >> ${OE_ENV_FILE}
181 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
182 echo "export GIT_PROXY_COMMAND=\"\${GIT_CONFIG_DIR}/git-proxy.sh\"" >> ${OE_ENV_FILE}
6a43974 @koenkooi oebb: generate sourceable env file
koenkooi authored
183
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
184 config_svn_proxy
185 config_git_proxy
d9bdbe2 @koenkooi oebb: replace all tabs with 4 spaces for consistency
koenkooi authored
186 fi
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
187
188 #--------------------------------------------------------------------------
189 # Set up the bitbake path to find the OpenEmbedded recipes.
190 #--------------------------------------------------------------------------
c36e086 @koenkooi oebb: convert from yocto to oe-core
koenkooi authored
191 export BBPATH=${OE_BUILD_DIR}:${OE_SOURCE_DIR}/openembedded-core/meta${BBPATH_EXTRA}
00a0c9e @jadonk Utilize commit ID in updates
jadonk authored
192
8f81ffd @koenkooi oebb: make environment file configurable
koenkooi authored
193 echo "export BBPATH=\"${BBPATH}\"" >> ${OE_ENV_FILE}
00a0c9e @jadonk Utilize commit ID in updates
jadonk authored
194
d9bdbe2 @koenkooi oebb: replace all tabs with 4 spaces for consistency
koenkooi authored
195 #--------------------------------------------------------------------------
bb16b33 @koenkooi oebb: remove hidden sudo
koenkooi authored
196 # Look for dash
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
197 #--------------------------------------------------------------------------
0ed3d15 @koenkooi oebb.sh: fix autorun logic
koenkooi authored
198 if [ "$(readlink /bin/sh)" = "dash" ] ; then
bb16b33 @koenkooi oebb: remove hidden sudo
koenkooi authored
199 echo "/bin/sh is a symlink to dash, please point it to bash instead"
200 exit 1
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
201 fi
8f98636 @koenkooi oebb: add usage note for ~/.oe/environment
koenkooi authored
202
8f81ffd @koenkooi oebb: make environment file configurable
koenkooi authored
203 echo "There now is a sourceable script in ~/.oe/enviroment. You can do '. ${OE_ENV_FILE}' and run 'bitbake something' without using $0 as wrapper"
204 fi # if -e ${OE_ENV_FILE}
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
205
67b1792 @koenkooi oebb: recreate site.conf if needed
koenkooi authored
206 if ! [ -e ${OE_BUILD_DIR}/conf/site.conf ] ; then
207 config_oe
208 fi
209
210 }
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
211
212 ###############################################################################
213 # UPDATE_ALL() - Make sure everything is up to date
214 ###############################################################################
215 function update_all()
216 {
217 set_environment
218 update_oe
219 }
220
be08896 @koenkooi oebb: add clean command
koenkooi authored
221 ###############################################################################
222 # CLEAN_OE() - Delete TMPDIR
223 ###############################################################################
224 function clean_oe()
225 {
226 set_environment
00a0c9e @jadonk Utilize commit ID in updates
jadonk authored
227 echo "Cleaning ${OE_BUILD_TMPDIR}"
228 rm -rf ${OE_BUILD_TMPDIR}
be08896 @koenkooi oebb: add clean command
koenkooi authored
229 }
230
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
231
232 ###############################################################################
233 # OE_BUILD() - Build an OE package or image
234 ###############################################################################
235 function oe_build()
236 {
088be90 @koenkooi oebb: put machine in auto.conf
koenkooi authored
237 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
238 if [ -z $MACHINE ] ; then
239 echo "No config found, please run $0 config <machine> first"
240 else
241 CL_MACHINE=$MACHINE
0ed3d15 @koenkooi oebb.sh: fix autorun logic
koenkooi authored
242 set_environment
1631d04 @koenkooi oebb.sh: if MACHINE is set in env on first invocation autorun the con…
koenkooi authored
243 config_oe && update_all
244 fi
245 fi
246
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
247 set_environment
8f81ffd @koenkooi oebb: make environment file configurable
koenkooi authored
248 if [ -e ${OE_ENV_FILE} ] ; then
249 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
250 fi
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
251 cd ${OE_BUILD_DIR}
252 if [ -z $MACHINE ] ; then
253 echo "Executing: bitbake" $*
254 bitbake $*
255 else
256 echo "Executing: MACHINE=${MACHINE} bitbake" $*
257 MACHINE=${MACHINE} bitbake $*
258 fi
259 }
260
261
262 ###############################################################################
00a0c9e @jadonk Utilize commit ID in updates
jadonk authored
263 # OE_CONFIG() - Configure OE for a target
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
264 ###############################################################################
265 function oe_config()
266 {
267 set_environment
268 config_oe
1631d04 @koenkooi oebb.sh: if MACHINE is set in env on first invocation autorun the con…
koenkooi authored
269 update_all
c7b71f4 @koenkooi oebb: be more verbose about ~/oe/.environment and report when config …
koenkooi authored
270
271 echo ""
d9bdbe2 @koenkooi oebb: replace all tabs with 4 spaces for consistency
koenkooi authored
272 echo "Setup for ${CL_MACHINE} completed"
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
273 }
274
275 ###############################################################################
276 # UPDATE_OE() - Update OpenEmbedded distribution.
277 ###############################################################################
278 function update_oe()
279 {
e4d6fb8 oebb: protect call to git_proxy setup as well
Gregg Lebovitz authored
280 if [ "x$PROXYHOST" != "x" ] ; then
281 config_git_proxy
282 fi
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
283
20193e2 @koenkooi oebb: hide stash output, simplify oebb update handling
koenkooi authored
284 #manage meta-openembedded and meta-angstrom with layerman
2722b1d @kraj oebb.sh: Export OE_LAYERS_TXT into env file
kraj authored
285 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
286 }
287
288 ###############################################################################
289 # CONFIG_SVN_PROXY() - Configure subversion proxy information
290 ###############################################################################
291 function config_svn_proxy()
292 {
293 if [ ! -f ${SVN_CONFIG_DIR}/servers ]
294 then
295 mkdir -p ${SVN_CONFIG_DIR}
296 cat >> ${SVN_CONFIG_DIR}/servers <<_EOF
297 [global]
298 http-proxy-host = ${PROXYHOST}
299 http-proxy-port = ${PROXYPORT}
300 _EOF
301 fi
302 }
303
304
305 ###############################################################################
306 # CONFIG_GIT_PROXY() - Configure GIT proxy information
307 ###############################################################################
308 function config_git_proxy()
309 {
310 if [ ! -f ${GIT_CONFIG_DIR}/git-proxy.sh ]
311 then
312 mkdir -p ${GIT_CONFIG_DIR}
313 cat > ${GIT_CONFIG_DIR}/git-proxy.sh <<_EOF
314 if [ -x /bin/env ] ; then
315 exec /bin/env corkscrew ${PROXYHOST} ${PROXYPORT} \$*
316 else
317 exec /usr/bin/env corkscrew ${PROXYHOST} ${PROXYPORT} \$*
318 fi
319 _EOF
320 chmod +x ${GIT_CONFIG_DIR}/git-proxy.sh
89b0519 @koenkooi oebb: fix git_config logic to not always append to ~/.oe/environement
koenkooi authored
321 export GIT_PROXY_COMMAND=${GIT_CONFIG_DIR}/git-proxy.sh
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
322 fi
323 }
324
87920f5 @koenkooi oebb: hook up tag and changelog functionality from layerman
koenkooi authored
325 ###############################################################################
326 # tag_layers - Tag all layers with a given tag
327 ###############################################################################
328 function tag_layers()
329 {
330 set_environment
3b0a7f9 @shr-project oebb.sh: use OE_LAYERS_TXT variable instead of repeating layers.txt path
shr-project authored
331 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
332 echo $TAG >> ${OE_BASE}/tags
87920f5 @koenkooi oebb: hook up tag and changelog functionality from layerman
koenkooi authored
333 }
334
335 ###############################################################################
ce4a376 @shr-project oebb.sh: add reset command
shr-project authored
336 # reset_layers - Remove all local changes including stash and ignored files
337 ###############################################################################
338 function reset_layers()
339 {
340 set_environment
2722b1d @kraj oebb.sh: Export OE_LAYERS_TXT into env file
kraj authored
341 env gawk -v command=reset -f ${OE_BASE}/scripts/layers.awk ${OE_LAYERS_TXT}
ce4a376 @shr-project oebb.sh: add reset command
shr-project authored
342 }
343
344 ###############################################################################
2ac18a8 @dasty oebb: Proper comment for changelog
dasty authored
345 # changelog - Display changelog for all layers with a given tag
87920f5 @koenkooi oebb: hook up tag and changelog functionality from layerman
koenkooi authored
346 ###############################################################################
347 function changelog()
348 {
edf3110 @koenkooi layerman: add 'info' command to generate a list of the current branch…
koenkooi authored
349 set_environment
2722b1d @kraj oebb.sh: Export OE_LAYERS_TXT into env file
kraj authored
350 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
351 }
352
353 ###############################################################################
354 # layer_info - Get layer info
355 ###############################################################################
356 function layer_info()
357 {
358 set_environment
359 rm -f ${OE_SOURCE_DIR}/info.txt
3b0a7f9 @shr-project oebb.sh: use OE_LAYERS_TXT variable instead of repeating layers.txt path
shr-project authored
360 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
361 echo
362 echo "Showing contents of ${OE_SOURCE_DIR}/info.txt:"
363 echo
364 cat ${OE_SOURCE_DIR}/info.txt
365 echo
87920f5 @koenkooi oebb: hook up tag and changelog functionality from layerman
koenkooi authored
366 }
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
367
368 ###############################################################################
26ef55c @dasty Adding support for checkout of particular tag/branch
dasty authored
369 # checkout - Checkout all layers with a given tag
370 ###############################################################################
371 function checkout()
372 {
373 set_environment
2722b1d @kraj oebb.sh: Export OE_LAYERS_TXT into env file
kraj authored
374 env gawk -v command=checkout -v commandarg=$TAG -f ${OE_BASE}/scripts/layers.awk ${OE_LAYERS_TXT}
26ef55c @dasty Adding support for checkout of particular tag/branch
dasty authored
375 }
376
377
378 ###############################################################################
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
379 # Build the specified OE packages or images.
380 ###############################################################################
be08896 @koenkooi oebb: add clean command
koenkooi authored
381
382 # FIXME: convert to case/esac
383
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
384 if [ $# -gt 0 ]
385 then
386 if [ $1 = "update" ]
387 then
388 update_all
389 exit 0
390 fi
391
edf3110 @koenkooi layerman: add 'info' command to generate a list of the current branch…
koenkooi authored
392 if [ $1 = "info" ]
393 then
394 layer_info
395 exit 0
396 fi
397
ce4a376 @shr-project oebb.sh: add reset command
shr-project authored
398 if [ $1 = "reset" ]
399 then
400 reset_layers
401 exit 0
402 fi
403
87920f5 @koenkooi oebb: hook up tag and changelog functionality from layerman
koenkooi authored
404 if [ $1 = "tag" ]
405 then
406 if [ -n "$2" ] ; then
407 TAG="$2"
408 else
409 TAG="$(date -u +'%Y%m%d-%H%M')"
410 fi
411 tag_layers $TAG
412 exit 0
413 fi
414
415 if [ $1 = "changelog" ]
416 then
417 if [ -z $2 ] ; then
418 echo "Changelog needs an argument"
419 exit 1
420 else
421 TAG="$2"
422 fi
423 changelog
424 exit 0
425 fi
426
26ef55c @dasty Adding support for checkout of particular tag/branch
dasty authored
427 if [ $1 = "checkout" ]
428 then
429 if [ -z $2 ] ; then
430 echo "Checkout needs an argument"
431 exit 1
432 else
433 TAG="$2"
434 fi
435 checkout
436 exit 0
437 fi
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
438 if [ $1 = "bitbake" ]
439 then
440 shift
441 oe_build $*
442 exit 0
443 fi
444
445 if [ $1 = "config" ]
446 then
447 shift
448 CL_MACHINE=$1
449 shift
450 oe_config $*
451 exit 0
452 fi
be08896 @koenkooi oebb: add clean command
koenkooi authored
453
454 if [ $1 = "clean" ]
455 then
456 clean_oe
457 exit 0
458 fi
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
459 fi
460
461 # Help Screen
462 echo ""
463 echo "Usage: $0 config <machine>"
464 echo " $0 update"
ce4a376 @shr-project oebb.sh: add reset command
shr-project authored
465 echo " $0 reset"
6100f73 @dasty oebb: Updating Help Screen
dasty authored
466 echo " $0 tag [tagname]"
467 echo " $0 changelog <tagname>"
26ef55c @dasty Adding support for checkout of particular tag/branch
dasty authored
468 echo " $0 checkout <tagname>"
6100f73 @dasty oebb: Updating Help Screen
dasty authored
469 echo " $0 clean"
3d83b2d @koenkooi oebb: update usage output
koenkooi authored
470 echo ""
471 echo " Not recommended, but also possible:"
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
472 echo " $0 bitbake <bitbake target>"
8f81ffd @koenkooi oebb: make environment file configurable
koenkooi authored
473 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
474 echo ""
475 echo "You must invoke \"$0 config <machine>\" and then \"$0 update\" prior"
476 echo "to your first bitbake command"
477 echo ""
478 echo "The <machine> argument can be one of the following"
90203a2 @koenkooi oebb: change example machine listing
koenkooi authored
479 echo " beagleboard: BeagleBoard"
480 echo " qemuarm Emulated ARM machine"
481 echo " qemumips: Emulated MIPS machine"
482 echo " fri2-noemgd: Intel FRI2 machine without graphics"
f984361 @koenkooi Add first setup script, imported from TI wiki
koenkooi authored
483 echo ""
484 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.