diff options
Diffstat (limited to 'documentation/dev-manual')
| -rw-r--r-- | documentation/dev-manual/dev-manual-common-tasks.xml | 67 |
1 files changed, 38 insertions, 29 deletions
diff --git a/documentation/dev-manual/dev-manual-common-tasks.xml b/documentation/dev-manual/dev-manual-common-tasks.xml index 092f2c1763..1581059891 100644 --- a/documentation/dev-manual/dev-manual-common-tasks.xml +++ b/documentation/dev-manual/dev-manual-common-tasks.xml | |||
| @@ -64,8 +64,8 @@ | |||
| 64 | the string <filename>meta-</filename>. | 64 | the string <filename>meta-</filename>. |
| 65 | <note> | 65 | <note> |
| 66 | It is not a requirement that a layer name begin with the | 66 | It is not a requirement that a layer name begin with the |
| 67 | prefix <filename>meta-</filename>, but it's a commonly accepted | 67 | prefix <filename>meta-</filename>, but it is a commonly |
| 68 | standard in the Yocto Project community. | 68 | accepted standard in the Yocto Project community. |
| 69 | </note> | 69 | </note> |
| 70 | For example, when you set up the Source Directory structure, | 70 | For example, when you set up the Source Directory structure, |
| 71 | you will see several layers: | 71 | you will see several layers: |
| @@ -194,8 +194,8 @@ | |||
| 194 | variable then assigns a priority to the layer. | 194 | variable then assigns a priority to the layer. |
| 195 | Applying priorities is useful in situations | 195 | Applying priorities is useful in situations |
| 196 | where the same package might appear in multiple | 196 | where the same package might appear in multiple |
| 197 | layers and allows you to choose what layer | 197 | layers and allows you to choose the layer |
| 198 | should take precedence.</para></listitem> | 198 | that takes precedence.</para></listitem> |
| 199 | <listitem><para>The | 199 | <listitem><para>The |
| 200 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-LAYERVERSION'>LAYERVERSION</ulink></filename> | 200 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-LAYERVERSION'>LAYERVERSION</ulink></filename> |
| 201 | variable optionally specifies the version of a | 201 | variable optionally specifies the version of a |
| @@ -206,16 +206,17 @@ | |||
| 206 | variable, which expands to the directory of the current | 206 | variable, which expands to the directory of the current |
| 207 | layer.</para> | 207 | layer.</para> |
| 208 | <para>Through the use of the <filename>BBPATH</filename> | 208 | <para>Through the use of the <filename>BBPATH</filename> |
| 209 | variable, BitBake locates <filename>.bbclass</filename> | 209 | variable, BitBake locates class files |
| 210 | files, configuration files, and files that are included | 210 | (<filename>.bbclass</filename>), |
| 211 | configuration files, and files that are included | ||
| 211 | with <filename>include</filename> and | 212 | with <filename>include</filename> and |
| 212 | <filename>require</filename> statements. | 213 | <filename>require</filename> statements. |
| 213 | For these cases, BitBake uses the first file that | 214 | For these cases, BitBake uses the first file that |
| 214 | matches the name found in <filename>BBPATH</filename>. | 215 | matches the name found in <filename>BBPATH</filename>. |
| 215 | This is similar to the way the <filename>PATH</filename> | 216 | This is similar to the way the <filename>PATH</filename> |
| 216 | variable is used for binaries. | 217 | variable is used for binaries. |
| 217 | We recommend, therefore, that you use unique | 218 | It is recommended, therefore, that you use unique |
| 218 | <filename>.bbclass</filename> and configuration | 219 | class and configuration |
| 219 | filenames in your custom layer.</para></listitem> | 220 | filenames in your custom layer.</para></listitem> |
| 220 | <listitem><para><emphasis>Add Content:</emphasis> Depending | 221 | <listitem><para><emphasis>Add Content:</emphasis> Depending |
| 221 | on the type of layer, add the content. | 222 | on the type of layer, add the content. |
| @@ -253,7 +254,8 @@ | |||
| 253 | configuration. | 254 | configuration. |
| 254 | In other words, do not copy an entire recipe into your | 255 | In other words, do not copy an entire recipe into your |
| 255 | layer and then modify it. | 256 | layer and then modify it. |
| 256 | Rather, use <filename>.bbappend</filename> files to override | 257 | Rather, use an append file (<filename>.bbappend</filename>) |
| 258 | to override | ||
| 257 | only those parts of the original recipe you need to modify. | 259 | only those parts of the original recipe you need to modify. |
| 258 | </para> | 260 | </para> |
| 259 | </section> | 261 | </section> |
| @@ -263,7 +265,8 @@ | |||
| 263 | 265 | ||
| 264 | <para> | 266 | <para> |
| 265 | Avoid duplicating include files. | 267 | Avoid duplicating include files. |
| 266 | Use <filename>.bbappend</filename> files for each recipe | 268 | Use append files (<filename>.bbappend</filename>) |
| 269 | for each recipe | ||
| 267 | that uses an include file. | 270 | that uses an include file. |
| 268 | Or, if you are introducing a new recipe that requires | 271 | Or, if you are introducing a new recipe that requires |
| 269 | the included file, use the path relative to the original | 272 | the included file, use the path relative to the original |
| @@ -285,7 +288,7 @@ | |||
| 285 | However, OpenEmbedded's layer <filename>meta-oe</filename> | 288 | However, OpenEmbedded's layer <filename>meta-oe</filename> |
| 286 | does. | 289 | does. |
| 287 | Consequently, <filename>meta-oe</filename> uses | 290 | Consequently, <filename>meta-oe</filename> uses |
| 288 | <filename>.bbappend</filename> files to modify the | 291 | append files to modify the |
| 289 | <filename>QT_SQL_DRIVER_FLAGS</filename> variable to | 292 | <filename>QT_SQL_DRIVER_FLAGS</filename> variable to |
| 290 | enable the appropriate plug-ins. | 293 | enable the appropriate plug-ins. |
| 291 | This variable was added to the <filename>qt4.inc</filename> | 294 | This variable was added to the <filename>qt4.inc</filename> |
| @@ -392,7 +395,7 @@ | |||
| 392 | as shown above, put it in | 395 | as shown above, put it in |
| 393 | <filename>meta-one/recipes-core/base-files/base-files/one/</filename>. | 396 | <filename>meta-one/recipes-core/base-files/base-files/one/</filename>. |
| 394 | Not only does this make sure the file is used | 397 | Not only does this make sure the file is used |
| 395 | only when building for machine "one" but the | 398 | only when building for machine "one", but the |
| 396 | build process locates the file more quickly.</para> | 399 | build process locates the file more quickly.</para> |
| 397 | <para>In summary, you need to place all files | 400 | <para>In summary, you need to place all files |
| 398 | referenced from <filename>SRC_URI</filename> | 401 | referenced from <filename>SRC_URI</filename> |
| @@ -526,12 +529,12 @@ | |||
| 526 | "meta" layer at | 529 | "meta" layer at |
| 527 | <filename>meta/recipes-bsp/formfactor</filename>: | 530 | <filename>meta/recipes-bsp/formfactor</filename>: |
| 528 | <literallayout class='monospaced'> | 531 | <literallayout class='monospaced'> |
| 529 | DESCRIPTION = "Device formfactor information" | 532 | SUMMARY = "Device formfactor information" |
| 530 | SECTION = "base" | 533 | SECTION = "base" |
| 531 | LICENSE = "MIT" | 534 | LICENSE = "MIT" |
| 532 | LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \ | 535 | LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \ |
| 533 | file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" | 536 | file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" |
| 534 | PR = "r41" | 537 | PR = "r44" |
| 535 | 538 | ||
| 536 | SRC_URI = "file://config file://machconfig" | 539 | SRC_URI = "file://config file://machconfig" |
| 537 | S = "${WORKDIR}" | 540 | S = "${WORKDIR}" |
| @@ -540,12 +543,12 @@ | |||
| 540 | INHIBIT_DEFAULT_DEPS = "1" | 543 | INHIBIT_DEFAULT_DEPS = "1" |
| 541 | 544 | ||
| 542 | do_install() { | 545 | do_install() { |
| 543 | # Only install file if it has a contents | 546 | # Only install file if it has a contents |
| 544 | install -d ${D}${sysconfdir}/formfactor/ | 547 | install -d ${D}${sysconfdir}/formfactor/ |
| 545 | install -m 0644 ${S}/config ${D}${sysconfdir}/formfactor/ | 548 | install -m 0644 ${S}/config ${D}${sysconfdir}/formfactor/ |
| 546 | if [ -s "${S}/machconfig" ]; then | 549 | if [ -s "${S}/machconfig" ]; then |
| 547 | install -m 0644 ${S}/machconfig ${D}${sysconfdir}/formfactor/ | 550 | install -m 0644 ${S}/machconfig ${D}${sysconfdir}/formfactor/ |
| 548 | fi | 551 | fi |
| 549 | } | 552 | } |
| 550 | </literallayout> | 553 | </literallayout> |
| 551 | In the main recipe, note the | 554 | In the main recipe, note the |
| @@ -596,16 +599,22 @@ | |||
| 596 | <filename>THISDIR</filename>. | 599 | <filename>THISDIR</filename>. |
| 597 | The trailing colon character is important as it ensures that | 600 | The trailing colon character is important as it ensures that |
| 598 | items in the list remain colon-separated. | 601 | items in the list remain colon-separated. |
| 599 | <note><para>BitBake automatically defines the | 602 | <note> |
| 600 | <filename>THISDIR</filename> variable. | 603 | <para> |
| 601 | You should never set this variable yourself. | 604 | BitBake automatically defines the |
| 602 | Using <filename>_prepend</filename> ensures your path will | 605 | <filename>THISDIR</filename> variable. |
| 603 | be searched prior to other paths in the final list.</para> | 606 | You should never set this variable yourself. |
| 604 | <para>Also, not all append files add extra files. | 607 | Using "_prepend" ensures your path will |
| 605 | Many append files simply exist to add build options | 608 | be searched prior to other paths in the final list. |
| 606 | (e.g. <filename>systemd</filename>). | 609 | </para> |
| 607 | For these cases, it is not necessary to use the | 610 | |
| 608 | "_prepend" part of the statement.</para> | 611 | <para> |
| 612 | Also, not all append files add extra files. | ||
| 613 | Many append files simply exist to add build options | ||
| 614 | (e.g. <filename>systemd</filename>). | ||
| 615 | For these cases, it is not necessary to use the | ||
| 616 | "_prepend" part of the statement. | ||
| 617 | </para> | ||
| 609 | </note> | 618 | </note> |
| 610 | </para> | 619 | </para> |
| 611 | </section> | 620 | </section> |
