From 7f58c81ce194d4453bfa36f19da6d92ab5242a4a Mon Sep 17 00:00:00 2001 From: Graham Gower Date: Tue, 28 Jul 2009 03:02:19 +0200 Subject: usermanual: Mostly grammar and spelling fixes Signed-Off-By: Holger Freyther --- docs/usermanual/chapters/recipes.xml | 300 +++++++++++++++++------------------ 1 file changed, 145 insertions(+), 155 deletions(-) (limited to 'docs') diff --git a/docs/usermanual/chapters/recipes.xml b/docs/usermanual/chapters/recipes.xml index 11078735eb..480e8be2b9 100644 --- a/docs/usermanual/chapters/recipes.xml +++ b/docs/usermanual/chapters/recipes.xml @@ -5,24 +5,24 @@
Introduction - A bitbake recipe is a set of instructions that describe what needs + A bitbake recipe is a set of instructions that describes what needs to be done to retrieve the source code for some application, apply any necessary patches, provide any additional files (such as init scripts), - compile it, install it and generated binary packages. The end result is a + compile it, install it and generate binary packages. The end result is a binary package that you can install on your target device, and maybe some intermediate files, such as libraries and headers, which can be used when - building other application. + building other applications. In many ways the process is similar to creating .deb or .rpm packages for your standard desktop distributions with one major difference - in OpenEmbedded everything is being cross-compiled. This often makes the task far more difficult (depending on how well suited the application is - to cross compiling), then it is for other packaging systems and sometime + to cross compiling), than it is for other packaging systems and sometimes impossible. This chapter assumes that you are familiar with working with - bitbake, including the work flow, required directory structures, bitbake - configuration and the use of monotone. If you are not familiar with these + bitbake, including the work flow, required directory structures and bitbake + configuration. If you are not familiar with these then first take a look at the chapter on bitbake usage.
@@ -41,7 +41,7 @@ a task function, or to compliment (append or prepend to an existing function) a default function. Standard functions use sh shell syntax, although access to OpenEmbedded variables and internal - methods is also available. + methods are also available. The following is an example function from the sed recipe: @@ -67,7 +67,7 @@ contents of other variables. In addition to assignment, appending and prepending operations are also supported. - The follow example shows the some of the ways variables can be + The following example shows some of the ways variables can be used in recipes:S = "${WORKDIR}/postfix-${PV}" PR = "r4" CFLAGS += "-DNO_ASM" @@ -111,7 +111,7 @@ require otherfile.inc Line continuation: \ - To split a line over multiple lines you should place a \ at + To split a statement over multiple lines you should place a \ at the end of the line that is to be continued on the next line. VAR = "A really long \ @@ -122,15 +122,6 @@ require otherfile.inc - - Comments: # - - - Any lines beginning with a # are comments and will be - ignored.# This is a comment - - - Using variables: ${...} @@ -159,7 +150,7 @@ VAR2 = "The version is ${PV}" variable, but only when the variable is currently unset. This is commonly used to provide a default value for use when no specific definition is provided by the machine or distro configuration of the - users local.conf configuration. + user's local.conf configuration. The following example:VAR1 ?= "New value"will set VAR1 to "New @@ -203,11 +194,11 @@ VAR1 ?= "New value" +=, and =+ operators have been applied. - The following example show the space being explicitly added to + The following example shows the space being explicitly added to the start to ensure the appended value is not merged with the existing value:SRC_URI_append = " file://fix-makefile.patch;patch=1"The _append method can also be used with overrides, - which result in the actions only being performed for the specified + which results in the actions only being performed for the specified target or machine: [TODO: Link to section on overrides]SRC_URI_append_sh4 = " file://fix-makefile.patch;patch=1"Note that the appended information is a variable itself, and therefore it's possible to used += or @@ -226,7 +217,7 @@ SRC_URI_append += "file://fix-install.patch;patch=1" space, and it is applied after all the +=, and =+ operators have been applied. - The following example show the space being explicitly added to + The following example shows the space being explicitly added to the end to ensure the prepended value is not merged with the existing value:CFLAGS_prepend = "-I${S}/myincludes "The _prepend method can also be used with @@ -239,7 +230,7 @@ SRC_URI_append += "file://fix-install.patch;patch=1" _prepend information:CFLAGS_prepend = "-I${S}/myincludes " CFLAGS_prepend += "-I${S}/myincludes2 "Note also the lack of a space when using += to append to a prepend value - remember that the += - operator is adding space itself. + operator adds space itself. @@ -261,7 +252,7 @@ CFLAGS_prepend += "-I${S}/myincludes2 "Note also the lack of a space a python script in the contrib directory called oe-stylize.py which can be used to reformat your recipes to the correct style. The output will contain a list of - warning (to let you know what you did wrong) which should be edited + warnings (to let you know what you did wrong) which should be edited out before using the new file.contrib/oe-stylize.py myrecipe.bb > fixed-recipe.bb vi fixed-recipe.bb mv fixed.recipe.bb myrecipe.bb @@ -287,9 +278,9 @@ mv fixed.recipe.bb myrecipe.bb Shell syntax - When describing a list of actions to take shell syntax is used - (as if you were writing a shell script). You should ensure that you - script would work with a generic sh and not require any bash (or + When describing a list of actions to take, shell syntax is used + (as if you were writing a shell script). You should ensure that your + script works with a generic sh and not require any bash (or other shell) specific functionality. The same applies to various system utilities (sed, grep, awk etc) that you may wish to use. If in doubt you should check with multiple implementations - including @@ -307,7 +298,7 @@ mv fixed.recipe.bb myrecipe.bb Recipes in OpenEmbedded use a standard naming convention that includes the package name and version number in the filename. In addition - to the name and version there is also a release number, which is indicates + to the name and version there is also a release number, which indicates changes to the way the package is built and/or packaged. The release number is contained within the recipe itself. @@ -380,9 +371,8 @@ mv fixed.recipe.bb myrecipe.bb PR - The package release. This is explicitly set in the recipe, or - if not set it defaults to "r0" if not - set. + The package release. This is explicitly set in the recipe. + It defaults to "r0" if not set. @@ -405,7 +395,7 @@ mv fixed.recipe.bb myrecipe.bb The package name, version and release separated by hyphens.PF = "${PN}-${PV}-${PR}" - For the strace_4.5.14.bb recipe, with PR + For the strace_4.5.14.bb recipe, with PR set to "r1" in the recipe, the PF variable would be set to "strace-4.5.14-r1". @@ -454,7 +444,7 @@ mv fixed.recipe.bb myrecipe.bb - Bitbake itself will define some variables. The FILE variables + Bitbake itself will define some variables. The FILE variable that defines the name of the bitbake recipe being processed is set by bitbake itself for example. Refer to the bitbake manual for more information on the variables that bitbake sets. @@ -462,8 +452,8 @@ mv fixed.recipe.bb myrecipe.bb The classes, that are used via the inherit keyword, define - and/or use the majority of the remaining variables. A class is a like - a library that contain parts of a bitbake recipe that are used by + and/or use the majority of the remaining variables. A class is like + a library that contains parts of a bitbake recipe that is used by multiple recipes. To make them usable in more situations they often include a large number of variables to control how the class operates. @@ -479,7 +469,7 @@ mv fixed.recipe.bb myrecipe.bb target - Refers to things built for the target are expected to be run + Refers to things built for the target and are expected to be run on the target device itself. @@ -510,7 +500,7 @@ mv fixed.recipe.bb myrecipe.bb
Header - Practically all recipes start was the header section which describes + Practically all recipes start with a header section which describes various aspects of the package that is being built. This information is typically used directly by the package format (such as ipkg or deb) as it's meta data used to describe the package. @@ -523,7 +513,7 @@ mv fixed.recipe.bb myrecipe.bb Describes what the software does. Hopefully this gives enough - information to a use to know if it's the right application for + information to a user to know if it's the right application for them. The default description is: "Version ${PV}-${PR} of @@ -586,10 +576,10 @@ mv fixed.recipe.bb myrecipe.bb
Sources: Downloading, patching and additional files - A recipes purpose is to describe how to take a software package and + A recipe's purpose is to describe how to take a software package and build it for your target device. The location of the source file (or files) is specified via the in the - recipe. This can describe several types of URI's, the most common + recipe. This can describe several types of URIs, the most common are: @@ -625,13 +615,13 @@ mv fixed.recipe.bb myrecipe.bb patches - Patches are plain files which are treated as patched and + Plain files which are treated as patches and automatically applied. - If a http, https or file URI refers to a compressed file, an archive + If an http, https or file URI refers to a compressed file, an archive file or a compressed archive file, such as .tar.gz or .zip, then the files will be uncompressed and extracted from the archive automatically. @@ -658,7 +648,7 @@ mv fixed.recipe.bb myrecipe.bb This is the URI of the havp source code. Note the use of the ${PV} variable to specify the version. This is done to enable the recipe to be renamed for a new - version without the need the edit the recipe itself. Because this is + version without the need to edit the recipe itself. Because this is a .tar.gz compressed archive the file will be decompressed and extracted in the working dir ${WORKDIR}. @@ -696,15 +686,15 @@ mv fixed.recipe.bb myrecipe.bb Full details on the SRC_URI - variable and all the support URI's is available in the section of the reference chapter.
Directories: What goes where - A large part of the work or a recipe is involved with specifying - where files and found and where they have to go. It's important for + A large part of the work of a recipe is involved with specifying + where files are found and where they have to go. It's important for example that programs do not try and use files from /usr/include or /usr/lib since they are for the host system, not @@ -785,13 +775,13 @@ mv fixed.recipe.bb myrecipe.bb
WORKDIR: The working directory - The working directory is where the source code is extracted, to - which plain files (not patches) are copied and where the logs and + The working directory is where the source code is extracted, + plain files (not patches) are copied and where the logs and installation files are created. A typical reason for needing to reference the work directory is for the handling of non patch files. - If we take a look at the recipe for quagga we can see an example + If we take a look at the recipe for quagga we can see example non patch files for configuration and init scripts:SRC_URI = "http://www.quagga.net/download/quagga-${PV}.tar.gz \ file://fix-for-lib-inpath.patch;patch=1 \ file://quagga.init \ @@ -820,7 +810,7 @@ mv fixed.recipe.bb myrecipe.bb role="bold"><packagename>-<version> in the WORKDIR directory. This is the directory in which it will change into before patching, compiling and - installating the package. + installing the package. For example, we have a package called widgets_1.2.bb which we are extracting from the @@ -846,7 +836,7 @@ S = "${WORKDIR}/widgets" The destination directory is where the completed application and all of it's files are installed into in preparation for packaging. - Typically an installation would places files in directories such as + Typically an installation would place files in directories such as /etc and /usr/bin by default. Since those directories are used by the host system we do not want the packages to install into @@ -896,16 +886,16 @@ S = "${WORKDIR}/widgets" stage task in the recipe. Any recipes that contain items that are required to build other packages should have a stage task to make sure the items are all correctly - placed into the staging area. The following example from clamav show the + placed into the staging area. The following example from clamav shows the clamav library and header being placed into the staging area:do_stage () { oe_libinstall -a -so libclamav ${STAGING_LIBDIR} install -m 0644 libclamav/clamav.h ${STAGING_INCDIR} } - The following from the p3scan recipe show the path to the clamav + The following from the p3scan recipe shows the path to the clamav library and header being passed to the configure script. Without this the configure script would either fail to find the library, or worse - still search the host systems directories for the library. Passing in + still search the host system's directories for the library. Passing in the location results in it searching the correct location and finding the clamav library and headers:EXTRA_OECONF = "--with-clamav=${STAGING_LIBDIR}/.. \ --with-openssl=${STAGING_LIBDIR}/.. \ @@ -936,7 +926,7 @@ S = "${WORKDIR}/widgets" Typically you will not need to modify these, but it is useful to be aware of the default values. In particular when searching for patches - and/or files (file:// URI's), the default search path is: + and/or files (file:// URIs), the default search path is: @@ -956,7 +946,7 @@ S = "${WORKDIR}/widgets" This is the package name and version, such as "strace-4.5.14". This is by far the most - common place to place version specified patches. + common place to place version specific patches. @@ -975,7 +965,7 @@ S = "${WORKDIR}/widgets" This is just the directory called "files". This is commonly used for patches - and files that apply to all version of the package. + and files that apply to all versions of the package. @@ -993,8 +983,8 @@ S = "${WORKDIR}/widgets" role="bold">${FILE_DIRNAME} which is the directory in which the recipe that is being processed is located. - The full set of variables that control the file locations and - patch are: + The full set of variables that control the file locations + are: @@ -1020,7 +1010,7 @@ S = "${WORKDIR}/widgets" The default set of directories which are available to use - for the file:// URI's. Each directory is searched, in the + for the file:// URIs. Each directory is searched, in the specified order, in an attempt to find the file specified by each file:// URI: FILESPATH = "${FILE_DIRNAME}/${PF}:${FILE_DIRNAME}/${P}:\ ${FILE_DIRNAME}/${PN}:${FILE_DIRNAME}/files:${FILE_DIRNAME}" @@ -1031,7 +1021,7 @@ ${FILE_DIRNAME}/${PN}:${FILE_DIRNAME}/files:${FILE_DIRNAME}" FILESDIR - The default directory to search for file:// URI's. Only used + The default directory to search for file:// URIs. Only used if the file is not found in FILESPATH. This can be used to easily add one additional directory to the search path without having to modify the default FILESPATH setting. By default this is just the @@ -1047,16 +1037,16 @@ ${FILE_DIRNAME}/${PN}:${FILE_DIRNAME}/files:${FILE_DIRNAME}" done is when one recipe includes another one in which the default values will be based on the name of the package doing the including, not the included package. Typically the included package will expect the files - to be located in a directories based on it's own name. + to be located in a directory based on it's own name. As an example the m4-native recipe includes the m4 recipe. This is - fine, except that the m4 recipes expects its files and patches to be - located in a directory called m4 - directory while the native file name results in them being searched for + fine, except that the m4 recipe expects its files and patches to be + located in a directory called m4, + while the native file name results in them being searched for in m4-native. So the m4-native recipe sets the FILESDIR variable to the value - that of m4 to add the actual m4 directory (where m4 itself has its files - stored) to the list of directories search for: include m4_${PV}.bb + of the actual m4 directory (where m4 itself has its files + stored): include m4_${PV}.bb inherit native FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/m4"
@@ -1075,13 +1065,13 @@ ${FILE_DIRNAME}/${PN}:${FILE_DIRNAME}/files:${FILE_DIRNAME}"
Now it's time for our first recipe. This is going to be one of the simplest possible recipes: all code is included and there's only one - file to compile and one readme file. While this isn't all that common + file to compile and one readme file. While this isn't all that common, it's a useful example because it doesn't depend on any of the helper classes which can sometime hide a lot of what is going on. First we'll create the myhelloworld.c file and a readme file. We'll place this in the files subdirectory, which is one of the places - that is searched for file:// URI's:mkdir recipes/myhelloworld + that is searched for file:// URIs:mkdir recipes/myhelloworld mkdir recipes/myhelloworld/files cat > recipes/myhelloworld/files/myhelloworld.c #include <stdio.h> @@ -1108,13 +1098,13 @@ Readme file for myhelloworld. PR = "r0" Next we need to tell it which files we want to be included in the - recipe, which we do via file:// URI's and the SRC_URI variable:SRC_URI = "file://myhelloworld.c \ + recipe, which we do via file:// URIs and the SRC_URI variable:SRC_URI = "file://myhelloworld.c \ file://README.txt" - Note the use of the \ to continue a file and the file of file:// - local URI's, rather than other types such as http://. + Note the use of the \ to continue a file and the use of file:// + local URIs, rather than other types such as http://. - Now we need provide a compile task which tells bitbake how to + Now we need to provide a compile task which tells bitbake how to compile this program. We do this by defining a do_compile function in the recipe and providing the appropriate commands: @@ -1129,7 +1119,7 @@ PR = "r0" use of the pre-defined compiler variables, ${CC}, ${CFLAGS} and ${LDFLAGS}. These are setup automatically to + role="bold">${LDFLAGS}. These are set up automatically to contain the settings required to cross-compile the program for the target. @@ -1155,7 +1145,7 @@ PR = "r0" - use the install command to + use of the install command to create directories and install the files, not cp. @@ -1181,7 +1171,7 @@ PR = "r0" use of ${WORKDIR} to get access to the README.txt file, - which was provided via file:// URI. + which was provided via a file:// URI. @@ -1338,7 +1328,7 @@ tmp/work/myhelloworld-0.1-r0/install/myhelloworld/usr/bin/myhelloworld: ELF 32-b ~/oe%>This shows us that the helloworld program is for an SH processor (obviously this will change depending on what your target system is), while checking the /bin/ls - program on host shows us that the host system is an AMD X86-64 system. + program on the host shows us that the host system is an AMD X86-64 system. That's exactly what we wanted.
@@ -1351,7 +1341,7 @@ tmp/work/myhelloworld-0.1-r0/install/myhelloworld/usr/bin/myhelloworld: ELF 32-b need to provides a lot of variables to the configure script. But all the hard work as already been done for you. There's an which takes care of most of the complexity - of building an autotools based packages. + of building an autotools based package. Let's take a look at the tuxnes recipe which is an example of a very simple autotools based recipe:%~oe> cat recipes/tuxnes/tuxnes_0.75.bb @@ -1367,11 +1357,11 @@ SRC_URI = "http://heanet.dl.sourceforge.net/sourceforge/tuxnes/tuxnes-0.75.tar.g inherit autotools This is a really simple recipe. There's the standard header that - describes the package. Then the SRC_URI, which in this case is a http + describes the package. Then the SRC_URI, which in this case is an http URL that causes the source code to be downloaded from the specified URI. And finally there's an "inherit autotools" command which loads the autotools class. The - autotools class will take care of generating the require configure, + autotools class will take care of generating the required configure, compile and install tasks. So in this case there's nothing else to do - that's all there is to it. @@ -1392,7 +1382,7 @@ inherit autotools Make modifications to prevent searching for headers and - libraries in the normal locations (since they below to the host + libraries in the normal locations (since they belong to the host system, not the target); @@ -1434,7 +1424,7 @@ inherit autotools Specifies build-time dependencies, via a list of bitbake - recipes to build prior to build the recipe. These are programs + recipes to build prior to building the recipe. These are programs (flex-native) or libraries (libpcre) that are required in order to build the package. @@ -1457,7 +1447,7 @@ inherit autotools If we take openssh for an example, it requires zlib and openssl in - order to both built and run. In the recipe we have:DEPENDS = "zlib openssl"This + order to both build and run. In the recipe we have:DEPENDS = "zlib openssl"This tells bitbake that it will need to build and stage zlib and openssl prior to trying to build openssh, since openssh requires both of them. Note that there is no RDEPENDS even though openssh @@ -1581,7 +1571,7 @@ inherit autotools oenote - Used to display an informational messages to the user. + Used to display informational messages to the user. The following example from net-snmp uses oenote to tell the user which endianess it determined was appropriate for the target @@ -1652,7 +1642,7 @@ inherit autotools The base conditional python function is used to set a variable to one of two values based on the definition of a third variable. - The general usage is:${@base_conditional('<variable-name>', '<value>', '<true-result>', <false-result>', d)}"where: + The general usage is:${@base_conditional('<variable-name>', '<value>', '<true-result>', '<false-result>', d)}"where: @@ -1698,7 +1688,7 @@ inherit autotools The following example from the openssl recipe shows the - addition of either -DL_ENDING or + addition of either -DL_ENDIAN or -DB_ENDIAN depending on the value of SITEINFO_ENDIANESS which is set to le for little endian targets and to be for big endian @@ -1715,7 +1705,7 @@ inherit autotools
Packaging: Defining packages and their contents - A bitbake recipe is a set of instructions from creating one, or + A bitbake recipe is a set of instructions for creating one, or more, packages for installation on the target device. Typically these are .ipkg or .deb packages (although bitbake itself isn't associated with any particular packaging format). @@ -1753,8 +1743,8 @@ NOTE: package helloworld-0.1-r0: task do_package_write: completedWe package helloworld-dev-0.1-r0_sh4.ipk and a locale package helloworld-locale-0.1-r0_sh4.ipk. It didn't - create the package due to the fact that it couldn't find any files - that would actually go in the package. + create the packages due to the fact that it couldn't find any files + that would actually go in the packages. @@ -1773,7 +1763,7 @@ NOTE: package helloworld-0.1-r0: task do_package_write: completedWe directories that are considered to belong to those packages. The documentation packages for example include anything found /usr/share/doc. The set of files and - directories is controlled via the FILES_<package-name> variables. @@ -1800,7 +1790,7 @@ NOTE: package helloworld-0.1-r0: task do_package_write: completedWe binaries, and it would be common to only use one or the other, then you should consider separating them into separate packages. - By default several groups of files are automatically separate out, + By default several groups of files are automatically separated out, including: @@ -1811,7 +1801,7 @@ NOTE: package helloworld-0.1-r0: task do_package_write: completedWe Any files required for development. This includes header files, static libraries, the shared library symlinks required only for linking etc. These would only ever need to be installed by - someone attempt to compile applications on the target device. + someone attempting to compile applications on the target device. While this does happen it is very uncommon and so these files are automatically moved into a separate package @@ -2026,7 +2016,7 @@ PACKAGES += "FILES-${PN}-test" role="bold">${PN}-test, and if we look at the definition of FILES-${PN} it contains the ${bindir}/* wildcard. Since ${PN} is first it'll match that wildcard are be + role="bold">${PN} is first it'll match that wildcard and be moved into the ${PN} package prior to processing of the ${PN}-test package. @@ -2044,7 +2034,7 @@ PACKAGES += "FILES-${PN}-test" now this will only match things in the bindir that start with p, and therefore not match our test program. Note that FILES-${PN} contains a lot more entries and - we'd need to add any of the other that refer to files that are to be + we'd need to add any of the others that refer to files that are to be included in the package. In this case we have no other files, so it's safe to do this simple declaration. @@ -2076,7 +2066,7 @@ PACKAGES += "FILES-${PN}-test" exactly what files went into each package, which files were not packaged and which packages contain no files. - One of easiest method is to run find on the install directory. In + One of the easiest methods is to run find on the install directory. In the install directory there is one subdirectory created per package, and the files are moved into the install directory as they are matched to a specific package. The following shows the packages and files for the @@ -2097,7 +2087,7 @@ tmp/work/helloworld-0.1-r0/install/helloworld/usr/bin tmp/work/helloworld-0.1-r0/install/helloworld/usr/bin/helloworld ~/oe%>The above shows that the -local, -dbg and -dev packages are all empty, and the -doc and base package contain a single file each. - Uses "-type f" option to find to show + Using the "-type f" option to find to show just files will make this clearer as well. In addition to the install directory the image directory (which @@ -2115,7 +2105,7 @@ tmp/work/helloworld-0.1-r0/image/usr/share/doc/helloworld f" makes this much clearer:~/oe%> find tmp/work/helloworld-0.1-r0/image -type f ~/oe%> - Messages reading missing files are also display by bitbake during + Messages regarding missing files are also displayed by bitbake during the package task:NOTE: package helloworld-0.1-r0: task do_package: started NOTE: the following files were installed but not shipped in any package: NOTE: /usualdir/README.txt @@ -2137,11 +2127,11 @@ NOTE: package helloworld-0.1-r0: task do_package: completedExcept in in the first place during the install task. In some cases it may be easier to let the package install the file - and then explicitly remove the file and the end of the install task. The + and then explicitly remove the file at the end of the install task. The following example from the samba recipe shows the removal of several files that get installed via the default install task generated by the . By using - do_install_append these commands and run after the + do_install_append these commands are run after the autotools generated install task: do_install_append() { @@ -2161,7 +2151,7 @@ NOTE: package helloworld-0.1-r0: task do_package: completedExcept in packages. Debian naming is enabled by including the debian class via either - local.conf or your distributions configuration + local.conf or your distribution's configuration file:INHERIT += "debian" The policy works by looking at the shared library name and version @@ -2234,7 +2224,7 @@ tmp/deploy/ipk/sh4/liblzo-dbg_1.08-r14_sh4.ipk Empty packages By default empty packages are ignored. Occasionally you may wish - to actually created empty packages, typically done when you want a + to actually create empty packages, typically done when you want a virtual package which will install other packages via dependencies without actually installing anything itself. The ALLOW_EMPTY variable is used to control the @@ -2276,15 +2266,15 @@ tmp/deploy/ipk/sh4/liblzo-dbg_1.08-r14_sh4.ipk Overriding the default task implementation - By defining your own implementation of task you'll override + By defining your own implementation of a task you'll override any default or class provided implementations. - For example, you can define you own implementation of the + For example, you can define your own implementation of the compile task to override any default implementation:do_compile() { oe_runmake DESTDIR=${D} } - If you with to totally prevent the task from running you need + If you wish to totally prevent the task from running you need to define your own empty implementation. This is typically done via the definition of the task using a single colon:do_configure() { : @@ -2296,8 +2286,8 @@ tmp/deploy/ipk/sh4/liblzo-dbg_1.08-r14_sh4.ipk Appending or prepending to the task - Sometime you want the default implementation, but you require - addition functionality. This can done by appending or pre-pending + Sometimes you want the default implementation, but you require + additional functionality. This can done by appending or pre-pending additional functionality onto the task. The following example from units shows an example of @@ -2307,7 +2297,7 @@ tmp/deploy/ipk/sh4/liblzo-dbg_1.08-r14_sh4.ipk install -m 0655 units.dat ${D}${datadir} } - The following example from the cherokee recipe show an example + The following example from the cherokee recipe shows an example of adding functionality prior to the default install task. In this case it compiles a program that is used during installation natively so that it will @@ -2324,7 +2314,7 @@ tmp/deploy/ipk/sh4/liblzo-dbg_1.08-r14_sh4.ipk Defining a new task - Another option is define a totally new task, and then register + Another option is to define a totally new task, and then register that with bitbake so that it runs in between two of the existing tasks. @@ -2340,9 +2330,9 @@ addtask unpack_extra after do_unpack before do_patch The task to add does not have the do_ prepended to it, - however the tasks to insert it after and before do have the _do + however the tasks to insert it after and before do have the do_ prepended. No errors will be generated if this is wrong, the - additional task simple won't be executed. + additional task simply won't be executed. @@ -2381,7 +2371,7 @@ addtask unpack_extra after do_unpack before do_patch - Save developers time being performing actions that they would + Save developers time by performing actions that they would otherwise need to perform themselves; @@ -2392,8 +2382,8 @@ addtask unpack_extra after do_unpack before do_patch - A lot of detail on how things work can be learnt for looking at - how classes are implement. + A lot of detail on how things work can be learnt from looking at + how classes are implemented. @@ -2525,7 +2515,7 @@ EXTRA_OECONF = "--disable-ldap \ Remember that DEPENDS defines the list of build time dependencies. In this case the staged headers and libraries from bzip2 are required to build gnupg, and therefore - we need to make sure the bzip2 recipe has run and staging the + we need to make sure the bzip2 recipe has run and staged the headers and libraries. By adding the DEPENDS on bzip2 this ensures that this happens. @@ -2539,12 +2529,12 @@ EXTRA_OECONF = "--disable-ldap \ This variable is used by the to provide options to the configure script of the package. In the gnupg case it needs to be told where - the bzip2 headers and libraries files are, and this is done via the - --with-bzip2 option. In this case it needs to + the bzip2 headers and libraries are, and this is done via the + --with-bzip2 option. In this case it points to the directory which include the lib and include subdirectories. Since OE doesn't define a variable for one level above the include and lib directories .. is used to - indicate one directory up. Without this gnupg would search the host + indicate one directory up. Without this, gnupg would search the host system headers and libraries instead of those we have provided in the staging area for the target. @@ -2552,9 +2542,9 @@ EXTRA_OECONF = "--disable-ldap \ Remember that staging is used to make things, such as headers and - libraries, available to used by other recipes later on. While header and - libraries are the most common item requiring staging other items such as - the pkgconfig files need to be staged as well, while for native packages + libraries, available for use by other recipes later on. While headers and + libraries are the most common items requiring staging, other items such as + the pkgconfig files need to be staged as well. For native packages, the binaries also need to be staged.
@@ -2591,12 +2581,12 @@ EXTRA_OECONF = "--disable-ldap \
- Installation scripts: Running scripts during package install and/or + <title>Installation scripts: Running scripts during package installation and/or removal - Packaging system such as .ipkg and .deb support pre and post + Packaging systems such as .ipkg and .deb support pre and post installation and pre and post removal scripts which are run during package - install and/or package removal on the target system. + installation and/or package removal on the target system. These scripts can be defined in your recipes to enable actions to be performed at the appropriate time. Common uses include starting new @@ -2637,7 +2627,7 @@ EXTRA_OECONF = "--disable-ldap \ The prerm is run prior to the removal of the contents of a package. During prerm the contents of the package are still - available for use by the script. The prerm scripts + available for use by the script. @@ -2684,7 +2674,7 @@ pkg_postinst_${PN}-rdisc6 () { Note that several classes will also register scripts, and that any - script you declare will have the script for the classes append to by these + script you declare will have the script for the classes appended by these classes. The following classes all generate additional script contents: @@ -2693,7 +2683,7 @@ pkg_postinst_${PN}-rdisc6 () { update-rc.d - This class is used by daemons to register there init scripts + This class is used by daemons to register their init scripts with the init code. Details are provided in the This class is used by packages that contain binaries which may - also be available for other packages. It tells that system that + also be provided by other packages. It tells the system that another alternative is available for consideration. The alternatives system will create a symlink to the correct alternative from one or more available on the system. @@ -2772,18 +2762,18 @@ pkg_postinst_${PN}-rdisc6 () { The base class used by packaging classes such as those for .ipkg and .deb. The package class may create scripts used to update - the dynamic linkers ld cache. + the dynamic linker's ld cache. - The following example from p3scan shows and postinst script which - ensure that the required user and group entries exist, and registers the + The following example from p3scan shows a postinst script which + ensures that the required user and group entries exist, and registers the need for volatiles (directories and/or files under /var). In addition to explicitly declaring a postinst script it uses the update-rc.d class which will result in an additional entry being added to the postinst script to register the init - scripts and start the daemon (via call to update-rc.d as describes in the + scripts and start the daemon (via call to update-rc.d as described in the section).inherit autotools update-rc.d ... @@ -2825,7 +2815,7 @@ fi In order to prevent this from happening you need to tell the packaging system which files are configuration files. Such files will - result in the user being asked how the user wants to handle any + result in the user being asked how they want to handle any configuration file changes (if any), as shown in this example:Downloading http://nynaeve.twibble.org/ipkg-titan-glibc//./p3scan_2.9.05d-r1_sh4.ipk Configuration file '/etc/p3scan/p3scan.conf' ==> File on system created by you or by a script. @@ -2841,7 +2831,7 @@ fi separated list of configuration files. The following example from clamav shows two files being marked as configuration files:CONFFILES_${PN}-daemon = "${sysconfdir}/clamd.conf \ ${sysconfdir}/default/clamav-daemon"Note - the user of ${PN}-daemon as the package name. The + the use of ${PN}-daemon as the package name. The ${PN} variable will expand to clamav and therefore these conf files are declared as being in the clamav-daemon package. @@ -2885,7 +2875,7 @@ fi Used to specify that the current package replaces an older - package with a different name. During package installing the package + package with a different name. During package installation the package that is being replaced will be removed since it is no longer needed when this package is installed. @@ -2910,7 +2900,7 @@ fi udev and linux-hotplug. Both declare that they runtime provide "hotplug". So any packages that require "hotplug" to work simply declare that it RDEPENDS on "hotplug". It's up to the distribution - to specify which actual implementation of "virtual/xserver" is + to specify which actual implementation of "virtual/hotplug" is used. @@ -2922,7 +2912,7 @@ fi Used to explicitly specify what a package provides at build time. This is typically used when two or more packages can provide the same functionality. For example there are several different X - servers in OpenEmbedded, and each as declared as providing + servers in OpenEmbedded, and each declared as providing "virtual/xserver". Therefore a package that depends on an X server to build can simply declare that it DEPENDS on "virtual/xserver". It's up to the distribution to specify which actual implementation @@ -2935,10 +2925,10 @@ fi
Fakeroot: Dealing with the need for "root" - Sometimes packages requires root permissions in order to perform + Sometimes packages require root permissions in order to perform some action, such as changing user or group owners or creating device nodes. Since OpenEmbedded will not keep the user and group information - it's usually preferably to remove that from the makefiles. For device + it's usually preferabe to remove that from the makefiles. For device nodes it's usually preferably to create them from the initial device node lists or via udev configuration. @@ -2951,7 +2941,7 @@ fi you also need to add a dependency on fakeroot-native:DEPENDS = "fakeroot-native"See the fuse recipe for an example. Further information on , including a description of it works, is provided in + linkend="fakeroot" />, including a description of how it works, is provided in the reference section: .
@@ -3034,7 +3024,7 @@ fi - This in turn result in packaging system, such as ipkg, considering + This results in the packaging system, such as ipkg, considering the released version to be older then the rc version. In OpenEmbedded the correct naming of pre and rc versions is to use @@ -3111,7 +3101,7 @@ require iproute2.inc DATE = "060323" The following example from cherokee shows a similar method of - including additional patches for this version only. However it also show + including additional patches for this version only. However it also shows another technique in which the configure task is defined in the recipe for this version, thus replacing the configure task that is provided by the common include:PR = "r7" @@ -3142,7 +3132,7 @@ do_configure() { ${@...}, as shown in the following example:TAG = ${@bb.data.getVar('PV',d,1).replace('.', '_')} The above example retrieves the PV variable from the bitbake data - object, the replaces any dots with underscores. Therefore if the PV was 0.9.0 then TAG will be set to 0-9-0. @@ -3182,10 +3172,10 @@ do_configure() { Return the directory only part of a filename. - This is most commonly seen in existing recipes when settings + This is most commonly seen in existing recipes when setting the FILESDIR variable (as described in the section). By - obtaining name of the recipe file itself, FILE, and then using os.path.dirname to strip the filename part:FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/make-${PV}"Note however that this is no longer required as <variable>.split(<key>)[<index>] - Splits are variable around the specified key. Use Splits the variable around the specified key. Use [<index>] to select one of the matching items from the array generated by the split command. - The following example from the recipe genext2fs_1.3+1.4rc1.bb would take the + The following example from the recipe genext2fs_1.3+1.4rc1.bb would take the PV of 1.3+1.4rc1 and split it around the + sign, resulting in an array containing @@ -3230,7 +3220,7 @@ do_configure() { base_conditional - This functions is used to set a variable to one of two values + This function is used to set a variable to one of two values based on the definition of a third variable. The general usage is:${@base_conditional('<variable-name>', '<value>', '<true-result>', <false-result>', d)}"where: @@ -3272,7 +3262,7 @@ do_configure() { The following example from the openssl recipe shows the - addition of either -DL_ENDING or + addition of either -DL_ENDIAN or -DB_ENDIAN depending on the value of SITEINFO_ENDIANESS which is set to le for little endian targets and to be for big endian @@ -3288,7 +3278,7 @@ do_configure() { base_contains - Similar to base_conditional expect that it is checking for the + Similar to base_conditional except that it is checking for the value being an element of an array. The general usage is:${@base_contains('<array-name>', '<value>', '<true-result>', <false-result>', d)}" where: @@ -3341,7 +3331,7 @@ do_configure() { Tasks may be implemented in python by prefixing the task function with "python ". In general this should not be needed and should be avoided where possible. The following example from the devshell recipe shows how - the compile task is implemented python:python do_compile() { + the compile task is implemented in python:python do_compile() { import os import os.path @@ -3393,7 +3383,7 @@ procps_3.1.15.bb procps_3.2.1.bb procps_3.2.5.bb procps_3.2.7.bb Imagine that you are adding procps version 4.0.0, but that it does not yet work. You could delete or rename your new recipe so you can build - a working image, but what you really to do is just ignore the new 4.0.0 + a working image, but what you really want to do is just ignore the new 4.0.0 version until it works. By adding:DEFAULT_PREFERENCE = "-1"to the recipe this is what will happen. Bitbake will now ignore this version (since all of the existing versions have a preference of 0). Note that you @@ -3513,7 +3503,7 @@ which find - The is the provides + The provides the simplest method of using alternatives but it only works for a single alternative. For multiple alternatives they need to be manually registered during post install. @@ -3608,7 +3598,7 @@ which find method that is suitable for its goals all packages should be configured by default to log via syslog, and not log directly to a file, if possible. If the distribution and/or end-user requires logging to a file - then they can configured syslog and/or your application to implement + then they can configure syslog and/or your application to implement this.
@@ -3621,7 +3611,7 @@ which find Configure all logging to use syslog whenever possible. This - leaves the decision on where to log upto the individual + leaves the decision on where to log up to the individual distributions. -- cgit 1.2.3-korg