diff options
Diffstat (limited to 'bitbake/doc')
-rw-r--r-- | bitbake/doc/bitbake-user-manual/bitbake-user-manual-hello.xml | 227 |
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=<path-to-bitbake-executable>:$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'> | ||
218 | 1. 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 | |||
225 | The BBPATH variable is not set and bitbake did not find a conf/bblayers.conf file in the expected location. | ||
226 | Maybe you accidentally invoked bitbake from the wrong directory? | ||
227 | |||
228 | 2. If you export BBPATH to point to your build directory and do nothing | ||
229 | else, BB will look for the <buildir>/conf/bitbake.conf file. It will | ||
230 | throw and error with a bunch of traceback stuff and say: | ||
231 | |||
232 | scott-lenovo@scott-lenovo:~ [master #] | ||
233 | $ mkdir junk | ||
234 | scott-lenovo@scott-lenovo:~ [master #] | ||
235 | $ BBPATH="/home/scott-lenovo/junk" | ||
236 | scott-lenovo@scott-lenovo:~ [master #] | ||
237 | $ export BBPATH | ||
238 | scott-lenovo@scott-lenovo:~ [master #] | ||
239 | $ bitbake -DDD | ||
240 | ERROR: 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)) | ||
251 | IOError: file conf/bitbake.conf not found in /home/scott-lenovo/junk | ||
252 | |||
253 | ERROR: Unable to parse conf/bitbake.conf: file conf/bitbake.conf not found in /home/scott-lenovo/junk | ||
254 | scott-lenovo@scott-lenovo:~ [master #] | ||
255 | |||
256 | 3. 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 | |||
260 | scott-lenovo@scott-lenovo:~/junk [master #] | ||
261 | $ bitbake -DDD | ||
262 | ERROR: 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) | ||
271 | ParseError: ParseError in configuration INHERITs: Could not inherit file classes/base.bbclass | ||
272 | |||
273 | ERROR: Unable to parse base: ParseError in configuration INHERITs: Could not inherit file classes/base.bbclass | ||
274 | scott-lenovo@scott-lenovo:~/junk [master #] | ||
275 | |||
276 | 4. 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 | |||
281 | scott-lenovo@scott-lenovo:~/junk [master #] | ||
282 | $ bitbake -DDD | ||
283 | Nothing to do. Use 'bitbake world' to build everything, or run 'bitbake --help' for usage information. | ||
284 | DEBUG: 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 | ||
285 | DEBUG: LOAD /home/scott-lenovo/junk/conf/bitbake.conf | ||
286 | DEBUG: BB configuration INHERITs:0: inheriting /home/scott-lenovo/junk/classes/base.bbclass | ||
287 | DEBUG: BB /home/scott-lenovo/junk/classes/base.bbclass: handle(data, include) | ||
288 | DEBUG: LOAD /home/scott-lenovo/junk/classes/base.bbclass | ||
289 | DEBUG: Clearing SRCREV cache due to cache policy of: clear | ||
290 | DEBUG: Using cache in '/home/scott-lenovo/junk/tmp/cache/local_file_checksum_cache.dat' | ||
291 | DEBUG: Using cache in '/home/scott-lenovo/junk/tmp/cache/bb_codeparser.dat' | ||
292 | DEBUG: Features set [3] (was [3]) | ||
293 | scott-lenovo@scott-lenovo:~/junk [master #] | ||
294 | |||
295 | 5. Here is what happens when you do provide a target but the target doesn't | ||
296 | exist yet. | ||
297 | |||
298 | scott-lenovo@scott-lenovo:~/junk [master #] | ||
299 | $ bitbake a | ||
300 | ERROR: no recipe files to build, check your BBPATH and BBFILES? | ||
301 | |||
302 | Summary: There was 1 ERROR message shown, returning a non-zero exit code. | ||
303 | scott-lenovo@scott-lenovo:~/junk [master #] | ||
304 | |||
305 | 6. 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 | ||
317 | DEBUG: 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 | ||
318 | DEBUG: Found bblayers.conf (/home/scott-lenovo/junk/conf/bblayers.conf) | ||
319 | DEBUG: LOAD /home/scott-lenovo/junk/conf/bblayers.conf | ||
320 | DEBUG: Adding layer /home/scott-lenovo/LayerA | ||
321 | DEBUG: LOAD /home/scott-lenovo/LayerA/conf/layer.conf | ||
322 | DEBUG: LOAD /home/scott-lenovo/junk/conf/bitbake.conf | ||
323 | DEBUG: BB configuration INHERITs:0: inheriting /home/scott-lenovo/junk/classes/base.bbclass | ||
324 | DEBUG: BB /home/scott-lenovo/junk/classes/base.bbclass: handle(data, include) | ||
325 | DEBUG: LOAD /home/scott-lenovo/junk/classes/base.bbclass | ||
326 | DEBUG: Clearing SRCREV cache due to cache policy of: clear | ||
327 | DEBUG: Using cache in '/home/scott-lenovo/junk/tmp/cache/local_file_checksum_cache.dat' | ||
328 | DEBUG: Using cache in '/home/scott-lenovo/junk/tmp/cache/bb_codeparser.dat' | ||
329 | DEBUG: Features set [3] (was [3]) | ||
330 | DEBUG: Calculated priority of layer A as 1 | ||
331 | DEBUG: collecting .bb files | ||
332 | DEBUG: Using cache in '/home/scott-lenovo/junk/tmp/cache' | ||
333 | DEBUG: Cache: /home/scott-lenovo/LayerA/a.bb is not cached | ||
334 | DEBUG: BB /home/scott-lenovo/LayerA/a.bb: handle(data) | ETA: --:--:-- | ||
335 | DEBUG: LOAD /home/scott-lenovo/LayerA/a.bb | ||
336 | Parsing recipes: 100% |##########################################################################################| Time: 00:00:00 | ||
337 | Parsing of 1 .bb files complete (0 cached, 1 parsed). 1 targets, 0 skipped, 0 masked, 0 errors. | ||
338 | DEBUG: parsing complete | ||
339 | DEBUG: providers for a are: ['a'] | ||
340 | DEBUG: sorted providers for a are: ['/home/scott-lenovo/LayerA/a.bb'] | ||
341 | DEBUG: adding /home/scott-lenovo/LayerA/a.bb to satisfy a | ||
342 | DEBUG: Added dependencies [] for /home/scott-lenovo/LayerA/a.bb | ||
343 | NOTE: Resolving any missing task queue dependencies | ||
344 | DEBUG: Resolved 0 extra dependencies | ||
345 | NOTE: Preparing runqueue | ||
346 | NOTE: Marking Active Tasks | ||
347 | NOTE: Pruned 0 inactive tasks, 1 left | ||
348 | NOTE: Assign Weightings | ||
349 | NOTE: Compute totals (have 1 endpoint(s)) | ||
350 | DEBUG: Starting bitbake-worker | ||
351 | NOTE: Executing RunQueue Tasks | ||
352 | DEBUG: Considering 0 (/home/scott-lenovo/LayerA/a.bb, do_build): set([]) | ||
353 | DEBUG: Skip list (pre setsceneverify) [] | ||
354 | DEBUG: Full skip list set([]) | ||
355 | DEBUG: Using runqueue scheduler 'speed' | ||
356 | DEBUG: Stampfile /home/scott-lenovo/junk/tmp/stamps.do_build not available | ||
357 | DEBUG: Found bblayers.conf (/home/scott-lenovo/junk/conf/bblayers.conf) | ||
358 | DEBUG: LOAD /home/scott-lenovo/junk/conf/bblayers.conf | ||
359 | DEBUG: Adding layer /home/scott-lenovo/LayerA | ||
360 | DEBUG: LOAD /home/scott-lenovo/LayerA/conf/layer.conf | ||
361 | DEBUG: LOAD /home/scott-lenovo/junk/conf/bitbake.conf | ||
362 | DEBUG: BB configuration INHERITs:0: inheriting /home/scott-lenovo/junk/classes/base.bbclass | ||
363 | DEBUG: BB /home/scott-lenovo/junk/classes/base.bbclass: handle(data, include) | ||
364 | DEBUG: LOAD /home/scott-lenovo/junk/classes/base.bbclass | ||
365 | DEBUG: Using cache in '/home/scott-lenovo/junk/tmp/cache/bb_codeparser.dat' | ||
366 | ************************ | ||
367 | * * | ||
368 | * Hello, World! * | ||
369 | * * | ||
370 | ************************ | ||
371 | DEBUG: Teardown for bitbake-worker | ||
372 | NOTE: Tasks Summary: Attempted 1 tasks of which 0 didn't need to be rerun and all succeeded. | ||
373 | scott-lenovo@scott-lenovo:~/junk/conf [master #] | ||
374 | |||
375 | 7. If you run it without the "-DDD" option, the output is cleaner. | ||
376 | |||
377 | scott-lenovo@scott-lenovo:~/junk [master #] | ||
378 | $ bitbake a | ||
379 | Parsing recipes: 100% |##########################################################################################| Time: 00:00:00 | ||
380 | Parsing of 1 .bb files complete (0 cached, 1 parsed). 1 targets, 0 skipped, 0 masked, 0 errors. | ||
381 | NOTE: Resolving any missing task queue dependencies | ||
382 | NOTE: Preparing runqueue | ||
383 | NOTE: Executing RunQueue Tasks | ||
384 | ************************ | ||
385 | * * | ||
386 | * Hello, World! * | ||
387 | * * | ||
388 | ************************ | ||
389 | NOTE: Tasks Summary: Attempted 1 tasks of which 0 didn't need to be rerun and all succeeded. | ||
390 | scott-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 | ||