From 23da05febb0a0a48d21f61cc817872320628d840 Mon Sep 17 00:00:00 2001 From: Scott Rifenbark Date: Tue, 18 Mar 2014 12:55:20 -0600 Subject: dev-manual: Read-through edits to "Understanding and Creating Layers". Some minor edits applied. (From yocto-docs rev: 1897997ad3ef3ada76de77c7fb886fb624dcdfdb) Signed-off-by: Scott Rifenbark Signed-off-by: Richard Purdie --- .../dev-manual/dev-manual-common-tasks.xml | 67 ++++++++++++---------- 1 file 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 @@ the string meta-. It is not a requirement that a layer name begin with the - prefix meta-, but it's a commonly accepted - standard in the Yocto Project community. + prefix meta-, but it is a commonly + accepted standard in the Yocto Project community. For example, when you set up the Source Directory structure, you will see several layers: @@ -194,8 +194,8 @@ variable then assigns a priority to the layer. Applying priorities is useful in situations where the same package might appear in multiple - layers and allows you to choose what layer - should take precedence. + layers and allows you to choose the layer + that takes precedence. The LAYERVERSION variable optionally specifies the version of a @@ -206,16 +206,17 @@ variable, which expands to the directory of the current layer. Through the use of the BBPATH - variable, BitBake locates .bbclass - files, configuration files, and files that are included + variable, BitBake locates class files + (.bbclass), + configuration files, and files that are included with include and require statements. For these cases, BitBake uses the first file that matches the name found in BBPATH. This is similar to the way the PATH variable is used for binaries. - We recommend, therefore, that you use unique - .bbclass and configuration + It is recommended, therefore, that you use unique + class and configuration filenames in your custom layer. Add Content: Depending on the type of layer, add the content. @@ -253,7 +254,8 @@ configuration. In other words, do not copy an entire recipe into your layer and then modify it. - Rather, use .bbappend files to override + Rather, use an append file (.bbappend) + to override only those parts of the original recipe you need to modify. @@ -263,7 +265,8 @@ Avoid duplicating include files. - Use .bbappend files for each recipe + Use append files (.bbappend) + for each recipe that uses an include file. Or, if you are introducing a new recipe that requires the included file, use the path relative to the original @@ -285,7 +288,7 @@ However, OpenEmbedded's layer meta-oe does. Consequently, meta-oe uses - .bbappend files to modify the + append files to modify the QT_SQL_DRIVER_FLAGS variable to enable the appropriate plug-ins. This variable was added to the qt4.inc @@ -392,7 +395,7 @@ as shown above, put it in meta-one/recipes-core/base-files/base-files/one/. Not only does this make sure the file is used - only when building for machine "one" but the + only when building for machine "one", but the build process locates the file more quickly. In summary, you need to place all files referenced from SRC_URI @@ -526,12 +529,12 @@ "meta" layer at meta/recipes-bsp/formfactor: - DESCRIPTION = "Device formfactor information" + SUMMARY = "Device formfactor information" SECTION = "base" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \ - file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" - PR = "r41" + file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" + PR = "r44" SRC_URI = "file://config file://machconfig" S = "${WORKDIR}" @@ -540,12 +543,12 @@ INHIBIT_DEFAULT_DEPS = "1" do_install() { - # Only install file if it has a contents + # Only install file if it has a contents install -d ${D}${sysconfdir}/formfactor/ install -m 0644 ${S}/config ${D}${sysconfdir}/formfactor/ - if [ -s "${S}/machconfig" ]; then - install -m 0644 ${S}/machconfig ${D}${sysconfdir}/formfactor/ - fi + if [ -s "${S}/machconfig" ]; then + install -m 0644 ${S}/machconfig ${D}${sysconfdir}/formfactor/ + fi } In the main recipe, note the @@ -596,16 +599,22 @@ THISDIR. The trailing colon character is important as it ensures that items in the list remain colon-separated. - BitBake automatically defines the - THISDIR variable. - You should never set this variable yourself. - Using _prepend ensures your path will - be searched prior to other paths in the final list. - Also, not all append files add extra files. - Many append files simply exist to add build options - (e.g. systemd). - For these cases, it is not necessary to use the - "_prepend" part of the statement. + + + BitBake automatically defines the + THISDIR variable. + You should never set this variable yourself. + Using "_prepend" ensures your path will + be searched prior to other paths in the final list. + + + + Also, not all append files add extra files. + Many append files simply exist to add build options + (e.g. systemd). + For these cases, it is not necessary to use the + "_prepend" part of the statement. + -- cgit v1.2.3-54-g00ecf