summaryrefslogtreecommitdiffstats
path: root/bitbake/doc/bitbake-user-manual/bitbake-user-manual-hello.xml
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/doc/bitbake-user-manual/bitbake-user-manual-hello.xml')
-rw-r--r--bitbake/doc/bitbake-user-manual/bitbake-user-manual-hello.xml227
1 files changed, 203 insertions, 24 deletions
diff --git a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-hello.xml b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-hello.xml
index d9ebaee0ca..95a6804a19 100644
--- a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-hello.xml
+++ b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-hello.xml
@@ -63,44 +63,41 @@
63 <title>Setting Up the BitBake Environment</title> 63 <title>Setting Up the BitBake Environment</title>
64 64
65 <para> 65 <para>
66 The recommended method to run BitBake is from a directory of your 66 First, you need to be sure that you can run BitBake.
67 choice. 67 Set your working directory to where your local BitBake
68 The directory can be within your home directory or in 68 files are and run the following command:
69 <filename>/usr/local</filename>,
70 depending on your preference.
71 </para>
72
73 <para>
74 First, run BitBake to make sure it's working.
75 From the BitBake source code directory, issue the following command:
76 <literallayout class='monospaced'> 69 <literallayout class='monospaced'>
77 $ ./bin/bitbake --version 70 $ ./bin/bitbake --version
78 BitBake Build Tool Core version 1.23.0, bitbake version 1.23.0 71 BitBake Build Tool Core version 1.23.0, bitbake version 1.23.0
79 </literallayout> 72 </literallayout>
80 You are now ready to use BitBake. 73 The console output tells you what version you are running.
81 </para> 74 </para>
82 75
83 <para> 76 <para>
84 A final step to make development easier is to add the executable 77 The recommended method to run BitBake is from a directory of your
85 binary to your environment <filename>PATH</filename>. 78 choice.
79 To be able to run BitBake from any directory, you need to add the
80 executable binary to your binary to your shell's environment
81 <filename>PATH</filename> variable.
86 First, look at your current <filename>PATH</filename> variable 82 First, look at your current <filename>PATH</filename> variable
87 by entering the following: 83 by entering the following:
88 <literallayout class='monospaced'> 84 <literallayout class='monospaced'>
89 $ echo $PATH 85 $ echo $PATH
90 </literallayout> 86 </literallayout>
91 Next, add the directory location for the BitBake binary to the 87 Next, add the directory location for the BitBake binary to the
92 <filename>PATH</filename> using this form: 88 <filename>PATH</filename>.
89 Here is an example that adds the
90 <filename>/home/scott-lenovo/bitbake/bin</filename> directory
91 to the front of the <filename>PATH</filename> variable:
93 <literallayout class='monospaced'> 92 <literallayout class='monospaced'>
94 $ export PATH=&lt;path-to-bitbake-executable&gt;:$PATH 93 $ export PATH=/home/scott-lenovo/bitbake/bin:$PATH
95 </literallayout> 94 </literallayout>
96 This will add the directory to the beginning of your
97 <filename>PATH</filename> environment variable.
98 You should now be able to enter the <filename>bitbake</filename> 95 You should now be able to enter the <filename>bitbake</filename>
99 command at the command line to run BitBake. 96 command from the command line while working from any directory.
100 </para> 97 </para>
101 98
102 <para> 99 <para>
103 For a more permanent solution assuming you are running the BASH 100 For a more permanent solution, assuming you are running the BASH
104 shell, edit <filename>~/.bashrc</filename> and add the following to the end 101 shell, edit <filename>~/.bashrc</filename> and add the following to the end
105 of that file: 102 of that file:
106 <literallayout class='monospaced'> 103 <literallayout class='monospaced'>
@@ -185,9 +182,8 @@
185 First, set up a directory for the "Hello World" project. 182 First, set up a directory for the "Hello World" project.
186 Here is how you can do so in your home directory: 183 Here is how you can do so in your home directory:
187 <literallayout class='monospaced'> 184 <literallayout class='monospaced'>
188 $ mkdir ~/dev 185 $ mkdir ~/hello
189 $ mkdir ~/dev/hello 186 $ cd ~/hello
190 $ cd ~/dev/hello
191 </literallayout> 187 </literallayout>
192 Within this new, empty directory, run BitBake with 188 Within this new, empty directory, run BitBake with
193 debugging output and see what happens: 189 debugging output and see what happens:
@@ -212,8 +208,191 @@
212 The majority of this output is specific to environment variables 208 The majority of this output is specific to environment variables
213 that are not directly relevant to BitBake. 209 that are not directly relevant to BitBake.
214 However, the very first message regarding the 210 However, the very first message regarding the
215 <filename>BBPATH</filename> variable 211 <filename>BBPATH</filename> variable and the
216 is relevant and you need to rectify it by setting 212 <filename>conf/bblayers.conf</filename> file
213 is relevant.
214 </para>
215
216 <para>
217 <literallayout class='monospaced'>
2181. Once you have PATH set up to actually run BB, and then you run it
219 using:
220
221 bitbake -DDD
222
223 You get these complaints:
224
225The BBPATH variable is not set and bitbake did not find a conf/bblayers.conf file in the expected location.
226Maybe you accidentally invoked bitbake from the wrong directory?
227
2282. If you export BBPATH to point to your build directory and do nothing
229 else, BB will look for the &lt;buildir&gt;/conf/bitbake.conf file. It will
230 throw and error with a bunch of traceback stuff and say:
231
232scott-lenovo@scott-lenovo:~ [master #]
233$ mkdir junk
234scott-lenovo@scott-lenovo:~ [master #]
235$ BBPATH="/home/scott-lenovo/junk"
236scott-lenovo@scott-lenovo:~ [master #]
237$ export BBPATH
238scott-lenovo@scott-lenovo:~ [master #]
239$ bitbake -DDD
240ERROR: Traceback (most recent call last):
241 File "/home/scott-lenovo/bitbake/lib/bb/cookerdata.py", line 163, in wrapped
242 return func(fn, *args)
243 File "/home/scott-lenovo/bitbake/lib/bb/cookerdata.py", line 173, in parse_config_file
244 return bb.parse.handle(fn, data, include)
245 File "/home/scott-lenovo/bitbake/lib/bb/parse/__init__.py", line 99, in handle
246 return h['handle'](fn, data, include)
247 File "/home/scott-lenovo/bitbake/lib/bb/parse/parse_py/ConfHandler.py", line 120, in handle
248 abs_fn = resolve_file(fn, data)
249 File "/home/scott-lenovo/bitbake/lib/bb/parse/__init__.py", line 117, in resolve_file
250 raise IOError("file %s not found in %s" % (fn, bbpath))
251IOError: file conf/bitbake.conf not found in /home/scott-lenovo/junk
252
253ERROR: Unable to parse conf/bitbake.conf: file conf/bitbake.conf not found in /home/scott-lenovo/junk
254scott-lenovo@scott-lenovo:~ [master #]
255
2563. Now I am going to create the conf/bitbake.conf file I need for the hello
257 world example. Then run it again. Time it complains about not finding
258 classes/base.bbclass.
259
260scott-lenovo@scott-lenovo:~/junk [master #]
261$ bitbake -DDD
262ERROR: Traceback (most recent call last):
263 File "/home/scott-lenovo/bitbake/lib/bb/cookerdata.py", line 163, in wrapped
264 return func(fn, *args)
265 File "/home/scott-lenovo/bitbake/lib/bb/cookerdata.py", line 177, in _inherit
266 bb.parse.BBHandler.inherit(bbclass, "configuration INHERITs", 0, data)
267 File "/home/scott-lenovo/bitbake/lib/bb/parse/parse_py/BBHandler.py", line 92, in inherit
268 include(fn, file, lineno, d, "inherit")
269 File "/home/scott-lenovo/bitbake/lib/bb/parse/parse_py/ConfHandler.py", line 100, in include
270 raise ParseError("Could not %(error_out)s file %(fn)s" % vars(), oldfn, lineno)
271ParseError: ParseError in configuration INHERITs: Could not inherit file classes/base.bbclass
272
273ERROR: Unable to parse base: ParseError in configuration INHERITs: Could not inherit file classes/base.bbclass
274scott-lenovo@scott-lenovo:~/junk [master #]
275
2764. So now we add that classes/base.bbclass file and put in one line that says
277 "addtask build", which is the minimum task you need. We run it again and
278 things work but there is nothing to do. That stands to reason since I gave it
279 no target.
280
281scott-lenovo@scott-lenovo:~/junk [master #]
282$ bitbake -DDD
283Nothing to do. Use 'bitbake world' to build everything, or run 'bitbake --help' for usage information.
284DEBUG: Removed the following variables from the environment: GNOME_DESKTOP_SESSION_ID, XDG_CURRENT_DESKTOP, GNOME_KEYRING_CONTROL, DISPLAY, SSH_AGENT_PID, LANG, no_proxy, XDG_SESSION_PATH, XAUTHORITY, SESSION_MANAGER, SHLVL, MANDATORY_PATH, COMPIZ_CONFIG_PROFILE, WINDOWID, EDITOR, GPG_AGENT_INFO, SSH_AUTH_SOCK, GDMSESSION, GNOME_KEYRING_PID, XDG_SEAT_PATH, XDG_CONFIG_DIRS, LESSOPEN, DBUS_SESSION_BUS_ADDRESS, _, XDG_SESSION_COOKIE, DESKTOP_SESSION, LESSCLOSE, DEFAULTS_PATH, UBUNTU_MENUPROXY, OLDPWD, XDG_DATA_DIRS, COLORTERM, LS_COLORS
285DEBUG: LOAD /home/scott-lenovo/junk/conf/bitbake.conf
286DEBUG: BB configuration INHERITs:0: inheriting /home/scott-lenovo/junk/classes/base.bbclass
287DEBUG: BB /home/scott-lenovo/junk/classes/base.bbclass: handle(data, include)
288DEBUG: LOAD /home/scott-lenovo/junk/classes/base.bbclass
289DEBUG: Clearing SRCREV cache due to cache policy of: clear
290DEBUG: Using cache in '/home/scott-lenovo/junk/tmp/cache/local_file_checksum_cache.dat'
291DEBUG: Using cache in '/home/scott-lenovo/junk/tmp/cache/bb_codeparser.dat'
292DEBUG: Features set [3] (was [3])
293scott-lenovo@scott-lenovo:~/junk [master #]
294
2955. Here is what happens when you do provide a target but the target doesn't
296 exist yet.
297
298scott-lenovo@scott-lenovo:~/junk [master #]
299$ bitbake a
300ERROR: no recipe files to build, check your BBPATH and BBFILES?
301
302Summary: There was 1 ERROR message shown, returning a non-zero exit code.
303scott-lenovo@scott-lenovo:~/junk [master #]
304
3056. Create a layer that has your metadata in it. You need your recipe file
306 and your layer.conf file. That is all good but you still need to
307 tell BB where your layers are. You do that through a bblayers.conf file.
308 We will use this one:
309
310 BBLAYERS ?=" \
311 /home/scott-lenovo/LayerA \
312 "
313
314 Now when you run it, you get this:
315
316$ bitbake -DDD a
317DEBUG: Removed the following variables from the environment: GNOME_DESKTOP_SESSION_ID, XDG_CURRENT_DESKTOP, GNOME_KEYRING_CONTROL, DISPLAY, SSH_AGENT_PID, LANG, no_proxy, XDG_SESSION_PATH, XAUTHORITY, SESSION_MANAGER, SHLVL, MANDATORY_PATH, COMPIZ_CONFIG_PROFILE, WINDOWID, EDITOR, GPG_AGENT_INFO, SSH_AUTH_SOCK, GDMSESSION, GNOME_KEYRING_PID, XDG_SEAT_PATH, XDG_CONFIG_DIRS, LESSOPEN, DBUS_SESSION_BUS_ADDRESS, _, XDG_SESSION_COOKIE, DESKTOP_SESSION, LESSCLOSE, DEFAULTS_PATH, UBUNTU_MENUPROXY, OLDPWD, XDG_DATA_DIRS, COLORTERM, LS_COLORS
318DEBUG: Found bblayers.conf (/home/scott-lenovo/junk/conf/bblayers.conf)
319DEBUG: LOAD /home/scott-lenovo/junk/conf/bblayers.conf
320DEBUG: Adding layer /home/scott-lenovo/LayerA
321DEBUG: LOAD /home/scott-lenovo/LayerA/conf/layer.conf
322DEBUG: LOAD /home/scott-lenovo/junk/conf/bitbake.conf
323DEBUG: BB configuration INHERITs:0: inheriting /home/scott-lenovo/junk/classes/base.bbclass
324DEBUG: BB /home/scott-lenovo/junk/classes/base.bbclass: handle(data, include)
325DEBUG: LOAD /home/scott-lenovo/junk/classes/base.bbclass
326DEBUG: Clearing SRCREV cache due to cache policy of: clear
327DEBUG: Using cache in '/home/scott-lenovo/junk/tmp/cache/local_file_checksum_cache.dat'
328DEBUG: Using cache in '/home/scott-lenovo/junk/tmp/cache/bb_codeparser.dat'
329DEBUG: Features set [3] (was [3])
330DEBUG: Calculated priority of layer A as 1
331DEBUG: collecting .bb files
332DEBUG: Using cache in '/home/scott-lenovo/junk/tmp/cache'
333DEBUG: Cache: /home/scott-lenovo/LayerA/a.bb is not cached
334DEBUG: BB /home/scott-lenovo/LayerA/a.bb: handle(data) | ETA: --:--:--
335DEBUG: LOAD /home/scott-lenovo/LayerA/a.bb
336Parsing recipes: 100% |##########################################################################################| Time: 00:00:00
337Parsing of 1 .bb files complete (0 cached, 1 parsed). 1 targets, 0 skipped, 0 masked, 0 errors.
338DEBUG: parsing complete
339DEBUG: providers for a are: ['a']
340DEBUG: sorted providers for a are: ['/home/scott-lenovo/LayerA/a.bb']
341DEBUG: adding /home/scott-lenovo/LayerA/a.bb to satisfy a
342DEBUG: Added dependencies [] for /home/scott-lenovo/LayerA/a.bb
343NOTE: Resolving any missing task queue dependencies
344DEBUG: Resolved 0 extra dependencies
345NOTE: Preparing runqueue
346NOTE: Marking Active Tasks
347NOTE: Pruned 0 inactive tasks, 1 left
348NOTE: Assign Weightings
349NOTE: Compute totals (have 1 endpoint(s))
350DEBUG: Starting bitbake-worker
351NOTE: Executing RunQueue Tasks
352DEBUG: Considering 0 (/home/scott-lenovo/LayerA/a.bb, do_build): set([])
353DEBUG: Skip list (pre setsceneverify) []
354DEBUG: Full skip list set([])
355DEBUG: Using runqueue scheduler 'speed'
356DEBUG: Stampfile /home/scott-lenovo/junk/tmp/stamps.do_build not available
357DEBUG: Found bblayers.conf (/home/scott-lenovo/junk/conf/bblayers.conf)
358DEBUG: LOAD /home/scott-lenovo/junk/conf/bblayers.conf
359DEBUG: Adding layer /home/scott-lenovo/LayerA
360DEBUG: LOAD /home/scott-lenovo/LayerA/conf/layer.conf
361DEBUG: LOAD /home/scott-lenovo/junk/conf/bitbake.conf
362DEBUG: BB configuration INHERITs:0: inheriting /home/scott-lenovo/junk/classes/base.bbclass
363DEBUG: BB /home/scott-lenovo/junk/classes/base.bbclass: handle(data, include)
364DEBUG: LOAD /home/scott-lenovo/junk/classes/base.bbclass
365DEBUG: Using cache in '/home/scott-lenovo/junk/tmp/cache/bb_codeparser.dat'
366************************
367* *
368* Hello, World! *
369* *
370************************
371DEBUG: Teardown for bitbake-worker
372NOTE: Tasks Summary: Attempted 1 tasks of which 0 didn't need to be rerun and all succeeded.
373scott-lenovo@scott-lenovo:~/junk/conf [master #]
374
3757. If you run it without the "-DDD" option, the output is cleaner.
376
377scott-lenovo@scott-lenovo:~/junk [master #]
378$ bitbake a
379Parsing recipes: 100% |##########################################################################################| Time: 00:00:00
380Parsing of 1 .bb files complete (0 cached, 1 parsed). 1 targets, 0 skipped, 0 masked, 0 errors.
381NOTE: Resolving any missing task queue dependencies
382NOTE: Preparing runqueue
383NOTE: Executing RunQueue Tasks
384************************
385* *
386* Hello, World! *
387* *
388************************
389NOTE: Tasks Summary: Attempted 1 tasks of which 0 didn't need to be rerun and all succeeded.
390scott-lenovo@scott-lenovo:~/junk [master #]
391 </literallayout>
392 </para>
393
394 <para>
395 You need to set
217 <link linkend='var-BBPATH'><filename>BBPATH</filename></link>. 396 <link linkend='var-BBPATH'><filename>BBPATH</filename></link>.
218 </para> 397 </para>
219 398