diff options
Diffstat (limited to 'bitbake/doc/user-manual/user-manual-intro.xml')
-rw-r--r-- | bitbake/doc/user-manual/user-manual-intro.xml | 250 |
1 files changed, 249 insertions, 1 deletions
diff --git a/bitbake/doc/user-manual/user-manual-intro.xml b/bitbake/doc/user-manual/user-manual-intro.xml index c1a9aed3a5..6f9ad2049a 100644 --- a/bitbake/doc/user-manual/user-manual-intro.xml +++ b/bitbake/doc/user-manual/user-manual-intro.xml | |||
@@ -322,6 +322,29 @@ | |||
322 | Information in append files overrides the information in the | 322 | Information in append files overrides the information in the |
323 | similarly-named recipe file. | 323 | similarly-named recipe file. |
324 | </para> | 324 | </para> |
325 | |||
326 | <para> | ||
327 | When you name an append file, you can use the | ||
328 | wildcard character (%) to allow for matching recipe names. | ||
329 | For example, suppose you have an append file named | ||
330 | as follows: | ||
331 | <literallayout class='monospaced'> | ||
332 | busybox_1.21.%.bbappend | ||
333 | </literallayout> | ||
334 | That append file would match any <filename>busybox_1.21.x.bb</filename> | ||
335 | version of the recipe. | ||
336 | So, the append file would match the following recipe names: | ||
337 | <literallayout class='monospaced'> | ||
338 | busybox_1.21.1.bb | ||
339 | busybox_1.21.2.bb | ||
340 | busybox_1.21.3.bb | ||
341 | </literallayout> | ||
342 | If the <filename>busybox</filename> recipe was updated to | ||
343 | <filename>busybox_1.3.0.bb</filename>, the append name would not | ||
344 | match. | ||
345 | However, if you named the append file | ||
346 | <filename>busybox_1.%.bb</filename>, then you would have a match. | ||
347 | </para> | ||
325 | </section> | 348 | </section> |
326 | </section> | 349 | </section> |
327 | 350 | ||
@@ -373,7 +396,13 @@ | |||
373 | <listitem><para><emphasis>Taking a snapshot of BitBake:</emphasis> | 396 | <listitem><para><emphasis>Taking a snapshot of BitBake:</emphasis> |
374 | Downloading a snapshot of BitBake from the | 397 | Downloading a snapshot of BitBake from the |
375 | source code repository gives you access to a known | 398 | source code repository gives you access to a known |
376 | branch or release of BitBake.</para> | 399 | branch or release of BitBake. |
400 | <note> | ||
401 | Cloning the Git repository, as described earlier, | ||
402 | is the preferred method for getting BitBake. | ||
403 | Cloning the repository makes it easier to update as | ||
404 | patches are added to the stable branches. | ||
405 | </note></para> | ||
377 | <para>The following example downloads a snapshot of | 406 | <para>The following example downloads a snapshot of |
378 | BitBake version 1.17.0: | 407 | BitBake version 1.17.0: |
379 | <literallayout class='monospaced'> | 408 | <literallayout class='monospaced'> |
@@ -387,4 +416,223 @@ | |||
387 | </itemizedlist> | 416 | </itemizedlist> |
388 | </para> | 417 | </para> |
389 | </section> | 418 | </section> |
419 | |||
420 | <section id="user-manual-command"> | ||
421 | <title>The BitBake Command</title> | ||
422 | |||
423 | <para> | ||
424 | BitBake is the underlying piece of the build system. | ||
425 | Two excellent examples are the Yocto Project and the OpenEmbedded | ||
426 | build systems. | ||
427 | Each provide an environment in which to develop embedded Linux | ||
428 | images, and each use BitBake as their underlying build engine. | ||
429 | </para> | ||
430 | |||
431 | <para> | ||
432 | BitBake facilitates executing tasks in a single <filename>.bb</filename> | ||
433 | file, or executing a given task on a set of multiple | ||
434 | <filename>.bb</filename> files, accounting for interdependencies | ||
435 | amongst them. | ||
436 | This section presents the BitBake syntax and provides some execution | ||
437 | examples. | ||
438 | </para> | ||
439 | |||
440 | <section id='usage-and-syntax'> | ||
441 | <title>Usage and syntax</title> | ||
442 | |||
443 | <para> | ||
444 | Following is the usage and syntax for BitBake: | ||
445 | <literallayout class='monospaced'> | ||
446 | $ bitbake -h | ||
447 | Usage: bitbake [options] [recipename/target ...] | ||
448 | |||
449 | Executes the specified task (default is 'build') for a given set of target recipes (.bb files). | ||
450 | It is assumed there is a conf/bblayers.conf available in cwd or in BBPATH which | ||
451 | will provide the layer, BBFILES and other configuration information. | ||
452 | |||
453 | Options: | ||
454 | --version show program's version number and exit | ||
455 | -h, --help show this help message and exit | ||
456 | -b BUILDFILE, --buildfile=BUILDFILE | ||
457 | Execute tasks from a specific .bb recipe directly. | ||
458 | WARNING: Does not handle any dependencies from other | ||
459 | recipes. | ||
460 | -k, --continue Continue as much as possible after an error. While the | ||
461 | target that failed and anything depending on it cannot | ||
462 | be built, as much as possible will be built before | ||
463 | stopping. | ||
464 | -a, --tryaltconfigs Continue with builds by trying to use alternative | ||
465 | providers where possible. | ||
466 | -f, --force Force the specified targets/task to run (invalidating | ||
467 | any existing stamp file). | ||
468 | -c CMD, --cmd=CMD Specify the task to execute. The exact options | ||
469 | available depend on the metadata. Some examples might | ||
470 | be 'compile' or 'populate_sysroot' or 'listtasks' may | ||
471 | give a list of the tasks available. | ||
472 | -C INVALIDATE_STAMP, --clear-stamp=INVALIDATE_STAMP | ||
473 | Invalidate the stamp for the specified task such as | ||
474 | 'compile' and then run the default task for the | ||
475 | specified target(s). | ||
476 | -r PREFILE, --read=PREFILE | ||
477 | Read the specified file before bitbake.conf. | ||
478 | -R POSTFILE, --postread=POSTFILE | ||
479 | Read the specified file after bitbake.conf. | ||
480 | -v, --verbose Output more log message data to the terminal. | ||
481 | -D, --debug Increase the debug level. You can specify this more | ||
482 | than once. | ||
483 | -n, --dry-run Don't execute, just go through the motions. | ||
484 | -S, --dump-signatures | ||
485 | Don't execute, just dump out the signature | ||
486 | construction information. | ||
487 | -p, --parse-only Quit after parsing the BB recipes. | ||
488 | -s, --show-versions Show current and preferred versions of all recipes. | ||
489 | -e, --environment Show the global or per-package environment complete | ||
490 | with information about where variables were | ||
491 | set/changed. | ||
492 | -g, --graphviz Save dependency tree information for the specified | ||
493 | targets in the dot syntax. | ||
494 | -I EXTRA_ASSUME_PROVIDED, --ignore-deps=EXTRA_ASSUME_PROVIDED | ||
495 | Assume these dependencies don't exist and are already | ||
496 | provided (equivalent to ASSUME_PROVIDED). Useful to | ||
497 | make dependency graphs more appealing | ||
498 | -l DEBUG_DOMAINS, --log-domains=DEBUG_DOMAINS | ||
499 | Show debug logging for the specified logging domains | ||
500 | -P, --profile Profile the command and save reports. | ||
501 | -u UI, --ui=UI The user interface to use (e.g. knotty, hob, depexp). | ||
502 | -t SERVERTYPE, --servertype=SERVERTYPE | ||
503 | Choose which server to use, process or xmlrpc. | ||
504 | --revisions-changed Set the exit code depending on whether upstream | ||
505 | floating revisions have changed or not. | ||
506 | --server-only Run bitbake without a UI, only starting a server | ||
507 | (cooker) process. | ||
508 | -B BIND, --bind=BIND The name/address for the bitbake server to bind to. | ||
509 | --no-setscene Do not run any setscene tasks. sstate will be ignored | ||
510 | and everything needed, built. | ||
511 | --remote-server=REMOTE_SERVER | ||
512 | Connect to the specified server. | ||
513 | -m, --kill-server Terminate the remote server. | ||
514 | --observe-only Connect to a server as an observing-only client. | ||
515 | --status-only Check the status of the remote bitbake server. | ||
516 | |||
517 | </literallayout> | ||
518 | </para> | ||
519 | </section> | ||
520 | |||
521 | <section id='bitbake-examples'> | ||
522 | <title>Examples</title> | ||
523 | |||
524 | <para> | ||
525 | This section presents some examples showing how to use BitBake. | ||
526 | </para> | ||
527 | |||
528 | <section id='example-executing-a-task-against-a-single-recipe'> | ||
529 | <title>Executing a Task Against a Single Recipe</title> | ||
530 | |||
531 | <para> | ||
532 | Executing tasks for a single recipe file is relatively simple. | ||
533 | You specify the file in question, and BitBake parses | ||
534 | it and executes the specified task. | ||
535 | If you do not specify a task, BitBake executes the default | ||
536 | task, which is "build”. | ||
537 | BitBake obeys inter-task dependencies when doing | ||
538 | so. | ||
539 | </para> | ||
540 | |||
541 | <para> | ||
542 | The following command runs the clean task on the | ||
543 | <filename>foo_1.0.bb</filename> recipe file: | ||
544 | <literallayout class='monospaced'> | ||
545 | $ bitbake -b foo.bb -c clean | ||
546 | </literallayout> | ||
547 | The following command runs the build task, which is | ||
548 | the default task, on the <filename>foo_1.0.bb</filename> | ||
549 | recipe file: | ||
550 | <literallayout class='monospaced'> | ||
551 | $ bitbake -b foo_1.0.bb | ||
552 | </literallayout> | ||
553 | </para> | ||
554 | </section> | ||
555 | |||
556 | <section id='executing-tasks-against-a-set-of-recipe-files'> | ||
557 | <title>Executing Tasks Against a Set of Recipe Files</title> | ||
558 | |||
559 | <para> | ||
560 | There are a number of additional complexities introduced | ||
561 | when one wants to manage multiple <filename>.bb</filename> | ||
562 | files. | ||
563 | Clearly there needs to be a way to tell BitBake what | ||
564 | files are available, and of those, which you | ||
565 | want to execute. | ||
566 | There also needs to be a way for each recipe | ||
567 | to express its dependencies, both for build-time and | ||
568 | runtime. | ||
569 | There must be a way for you to express recipe preferences | ||
570 | when multiple recipes provide the same functionality, or when | ||
571 | there are multiple versions of a recipe. | ||
572 | </para> | ||
573 | |||
574 | <para> | ||
575 | The <filename>bitbake</filename> command, when not using | ||
576 | "--buildfile" or "-b" only accepts a "PROVIDER". | ||
577 | You cannot provide anything else. | ||
578 | By default, a recipe file generally "PROVIDES" its | ||
579 | "packagename", "packagename-version", and | ||
580 | "packagename-version-revision" as shown in the following | ||
581 | example: | ||
582 | <literallayout class='monospaced'> | ||
583 | $ bitbake foo | ||
584 | |||
585 | $ bitbake foo-1.0 | ||
586 | |||
587 | $ bitbake foo-1.0-r0 | ||
588 | </literallayout> | ||
589 | This next example "PROVIDES" the package name and also uses | ||
590 | the "-c" option to tell BitBake to just execute the | ||
591 | <filename>do_clean</filename> task: | ||
592 | <literallayout class='monospaced'> | ||
593 | $ bitbake -c clean foo | ||
594 | </literallayout> | ||
595 | </para> | ||
596 | </section> | ||
597 | |||
598 | <section id='generating-dependency-graphs'> | ||
599 | <title>Generating Dependency Graphs</title> | ||
600 | |||
601 | <para> | ||
602 | BitBake is able to generate dependency graphs using | ||
603 | the dot syntax. | ||
604 | You can convert these graphs into images using the dot | ||
605 | application from | ||
606 | <ulink url='http://www.graphviz.org'>Graphviz</ulink>. | ||
607 | </para> | ||
608 | |||
609 | <para> | ||
610 | When you generate a dependency graph, BitBake writes two files | ||
611 | to the current working directory: | ||
612 | <filename>depends.dot</filename>, which contains dependency information | ||
613 | at the package level, and <filename>task-depends.dot</filename>, | ||
614 | which contains a breakdown of the dependencies at the task level. | ||
615 | </para> | ||
616 | |||
617 | <para> | ||
618 | To stop depending on common depends, use use the "-I" depend | ||
619 | option and BitBake omits them from the graph. | ||
620 | Leaving this information out can produce more readable graphs. | ||
621 | This way, you can remove from the graph | ||
622 | <filename>DEPENDS</filename> from inherited classes | ||
623 | such as <filename>base.bbclass</filename>. | ||
624 | </para> | ||
625 | |||
626 | <para> | ||
627 | Here are two examples that create dependency graphs. | ||
628 | The second example omits common depends from the graph: | ||
629 | <literallayout class='monospaced'> | ||
630 | $ bitbake -g foo | ||
631 | |||
632 | $ bitbake -g -I virtual/whatever -I bloom foo | ||
633 | </literallayout> | ||
634 | </para> | ||
635 | </section> | ||
636 | </section> | ||
637 | </section> | ||
390 | </chapter> | 638 | </chapter> |