summaryrefslogtreecommitdiffstats
path: root/documentation
diff options
context:
space:
mode:
authorRobert P. J. Day <rpjday@crashcourse.ca>2014-08-04 08:05:34 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-08-12 13:50:29 +0100
commit99a3c1911c72547327c1167caab5f4bfd2b1eb14 (patch)
treee90a50e40b71d7c9701b25a2ce6db46a762bade4 /documentation
parent034640585f97327ba163ae773f1b95c0cc2adbd2 (diff)
downloadpoky-99a3c1911c72547327c1167caab5f4bfd2b1eb14.tar.gz
dev-manual: Edits to several examples and some typos.
These catches are from Robert P. J. Day and applied as a patch. (From yocto-docs rev: b805795e9bf68286aa5b79a94792e2fefd293b92) Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation')
-rw-r--r--documentation/dev-manual/dev-manual-common-tasks.xml68
1 files changed, 36 insertions, 32 deletions
diff --git a/documentation/dev-manual/dev-manual-common-tasks.xml b/documentation/dev-manual/dev-manual-common-tasks.xml
index 05d1e95bdf..a8ef2d1576 100644
--- a/documentation/dev-manual/dev-manual-common-tasks.xml
+++ b/documentation/dev-manual/dev-manual-common-tasks.xml
@@ -1320,7 +1320,7 @@
1320 <listitem><para><emphasis>Functions:</emphasis> 1320 <listitem><para><emphasis>Functions:</emphasis>
1321 Functions provide a series of actions to be performed. 1321 Functions provide a series of actions to be performed.
1322 You usually use functions to override the default 1322 You usually use functions to override the default
1323 implementation of a task function or to compliment 1323 implementation of a task function or to complement
1324 a default function (i.e. append or prepend to an 1324 a default function (i.e. append or prepend to an
1325 existing function). 1325 existing function).
1326 Standard functions use <filename>sh</filename> shell 1326 Standard functions use <filename>sh</filename> shell
@@ -1332,12 +1332,13 @@
1332 do_install () { 1332 do_install () {
1333 autotools_do_install 1333 autotools_do_install
1334 install -d ${D}${base_bindir} 1334 install -d ${D}${base_bindir}
1335 mv ${D}${bindir}/sed ${D}${base_bindir}/sed.${PN} 1335 mv ${D}${bindir}/sed ${D}${base_bindir}/sed
1336 rmdir ${D}${bindir}/
1336 } 1337 }
1337 </literallayout> 1338 </literallayout>
1338 It is also possible to implement new functions that 1339 It is also possible to implement new functions that
1339 are called between existing tasks as long as the 1340 are called between existing tasks as long as the
1340 new functions are not replacing or complimenting the 1341 new functions are not replacing or complementing the
1341 default functions. 1342 default functions.
1342 You can implement functions in Python 1343 You can implement functions in Python
1343 instead of shell. 1344 instead of shell.
@@ -1488,7 +1489,6 @@
1488 Use the <filename>_prepend</filename> operator to 1489 Use the <filename>_prepend</filename> operator to
1489 prepend values to existing variables. 1490 prepend values to existing variables.
1490 This operator does not add any additional space. 1491 This operator does not add any additional space.
1491 This operator does not add any additional space.
1492 Also, the operator is applied after all the 1492 Also, the operator is applied after all the
1493 <filename>+=</filename>, and 1493 <filename>+=</filename>, and
1494 <filename>=+</filename> operators have been applied and 1494 <filename>=+</filename> operators have been applied and
@@ -1506,12 +1506,12 @@
1506 only being performed for the specified target or 1506 only being performed for the specified target or
1507 machine: 1507 machine:
1508 <literallayout class='monospaced'> 1508 <literallayout class='monospaced'>
1509 CFLAGS_prepend_sh4 = " file://fix-makefile.patch" 1509 CFLAGS_prepend_sh4 = "-I${S}/myincludes "
1510 </literallayout> 1510 </literallayout>
1511 </para></listitem> 1511 </para></listitem>
1512 <listitem><para><emphasis>Overrides:</emphasis> - 1512 <listitem><para><emphasis>Overrides:</emphasis> -
1513 You can use overrides to set a value conditionally, 1513 You can use overrides to set a value conditionally,
1514 typically on how the recipe is being built. 1514 typically based on how the recipe is being built.
1515 For example, to set the 1515 For example, to set the
1516 <ulink url='&YOCTO_DOCS_REF_URL;#var-KBRANCH'><filename>KBRANCH</filename></ulink> 1516 <ulink url='&YOCTO_DOCS_REF_URL;#var-KBRANCH'><filename>KBRANCH</filename></ulink>
1517 variable's value to "standard/base" for any target 1517 variable's value to "standard/base" for any target
@@ -1528,7 +1528,7 @@
1528 For example, when setting variables such as 1528 For example, when setting variables such as
1529 <ulink url='&YOCTO_DOCS_REF_URL;#var-FILES'><filename>FILES</filename></ulink> 1529 <ulink url='&YOCTO_DOCS_REF_URL;#var-FILES'><filename>FILES</filename></ulink>
1530 and 1530 and
1531 <ulink url='&YOCTO_DOCS_REF_URL;#var-RDEPENDS'><filename>RDEPENDS</filename></ulink>, 1531 <ulink url='&YOCTO_DOCS_REF_URL;#var-RDEPENDS'><filename>RDEPENDS</filename></ulink>
1532 that are specific to individual packages produced by 1532 that are specific to individual packages produced by
1533 a recipe, you should always use an override that 1533 a recipe, you should always use an override that
1534 specifies the name of the package. 1534 specifies the name of the package.
@@ -1577,7 +1577,7 @@
1577 Creating a new recipe is usually an iterative process that 1577 Creating a new recipe is usually an iterative process that
1578 requires using BitBake to process the recipe multiple times in 1578 requires using BitBake to process the recipe multiple times in
1579 order to progressively discover and add information to the 1579 order to progressively discover and add information to the
1580 recipe. 1580 recipe file.
1581 </para> 1581 </para>
1582 1582
1583 <para> 1583 <para>
@@ -1599,17 +1599,18 @@
1599 1599
1600 <para> 1600 <para>
1601 During the build, the OpenEmbedded build system creates a 1601 During the build, the OpenEmbedded build system creates a
1602 temporary work directory for the recipe 1602 temporary work directory for each recipe
1603 (<filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink><filename>}</filename>) 1603 (<filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink><filename>}</filename>)
1604 where it keeps extracted source files, log files, intermediate 1604 where it keeps extracted source files, log files, intermediate
1605 compilation and packaging files, and so forth. 1605 compilation and packaging files, and so forth.
1606 </para> 1606 </para>
1607 1607
1608 <para> 1608 <para>
1609 The temporary work directory is constructed as follows and 1609 The per-recipe temporary work directory is constructed as follows and
1610 depends on several factors: 1610 depends on several factors:
1611 <literallayout class='monospaced'> 1611 <literallayout class='monospaced'>
1612 ${TMPDIR}/work/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR} 1612 BASE_WORKDIR ?= "${TMPDIR}/work"
1613 WORKDIR = "${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR}"
1613 </literallayout> 1614 </literallayout>
1614 As an example, assume a Source Directory top-level folder named 1615 As an example, assume a Source Directory top-level folder named
1615 <filename>poky</filename>, a default Build Directory at 1616 <filename>poky</filename>, a default Build Directory at
@@ -1687,7 +1688,7 @@
1687 The 1688 The
1688 <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-fetch'><filename>do_fetch</filename></ulink> 1689 <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-fetch'><filename>do_fetch</filename></ulink>
1689 task uses the prefix of each entry in the 1690 task uses the prefix of each entry in the
1690 <filename>SRC_URI</filename> variable value to determine what 1691 <filename>SRC_URI</filename> variable value to determine which
1691 fetcher to use to get your source files. 1692 fetcher to use to get your source files.
1692 It is the <filename>SRC_URI</filename> variable that triggers 1693 It is the <filename>SRC_URI</filename> variable that triggers
1693 the fetcher. 1694 the fetcher.
@@ -1717,7 +1718,7 @@
1717 1718
1718 <para> 1719 <para>
1719 Here is a simple example from the 1720 Here is a simple example from the
1720 <filename>meta/recipes-devtools/cdrtools/cdrtools-native_3.01a17.bb</filename> 1721 <filename>meta/recipes-devtools/cdrtools/cdrtools-native_3.01a20.bb</filename>
1721 recipe where the source comes from a single tarball. 1722 recipe where the source comes from a single tarball.
1722 Notice the use of the 1723 Notice the use of the
1723 <ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink> 1724 <ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink>
@@ -1824,7 +1825,7 @@
1824 1825
1825 <para> 1826 <para>
1826 This final example is a bit more complicated and is from the 1827 This final example is a bit more complicated and is from the
1827 <filename>meta/recipes-sato/rxvt-unicode/rxvt-unicode_9.19.bb</filename> 1828 <filename>meta/recipes-sato/rxvt-unicode/rxvt-unicode_9.20.bb</filename>
1828 recipe. 1829 recipe.
1829 The example's <filename>SRC_URI</filename> statement identifies 1830 The example's <filename>SRC_URI</filename> statement identifies
1830 multiple files as the source files for the recipe: a tarball, a 1831 multiple files as the source files for the recipe: a tarball, a
@@ -1844,8 +1845,8 @@
1844 The path is relative to the 1845 The path is relative to the
1845 <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESPATH'><filename>FILESPATH</filename></ulink> 1846 <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESPATH'><filename>FILESPATH</filename></ulink>
1846 variable and searches specific directories in a certain order: 1847 variable and searches specific directories in a certain order:
1847 <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-BPN'><filename>BPN</filename></ulink><filename>}</filename>,
1848 <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-BP'><filename>BP</filename></ulink><filename>}</filename>, 1848 <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-BP'><filename>BP</filename></ulink><filename>}</filename>,
1849 <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-BPN'><filename>BPN</filename></ulink><filename>}</filename>,
1849 and <filename>files</filename>. 1850 and <filename>files</filename>.
1850 The directories are assumed to be subdirectories of the 1851 The directories are assumed to be subdirectories of the
1851 directory in which the recipe or append file resides. 1852 directory in which the recipe or append file resides.
@@ -2434,7 +2435,7 @@
2434 needs to inherit the 2435 needs to inherit the
2435 <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-systemd'><filename>systemd</filename></ulink> 2436 <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-systemd'><filename>systemd</filename></ulink>
2436 class. 2437 class.
2437 See the <filename>systemd.class</filename> file 2438 See the <filename>systemd.bbclass</filename> file
2438 located in your 2439 located in your
2439 <link linkend='source-directory'>Source Directory</link>. 2440 <link linkend='source-directory'>Source Directory</link>.
2440 section for more information. 2441 section for more information.
@@ -2606,7 +2607,7 @@
2606 <para> 2607 <para>
2607 A post-installation function has the following structure: 2608 A post-installation function has the following structure:
2608 <literallayout class='monospaced'> 2609 <literallayout class='monospaced'>
2609 pkg_postinst_PACKAGENAME () { 2610 pkg_postinst_PACKAGENAME() {
2610 #!/bin/sh -e 2611 #!/bin/sh -e
2611 # Commands to carry out 2612 # Commands to carry out
2612 } 2613 }
@@ -2629,7 +2630,7 @@
2629 To delay script execution until boot time, use the following 2630 To delay script execution until boot time, use the following
2630 structure in the post-installation script: 2631 structure in the post-installation script:
2631 <literallayout class='monospaced'> 2632 <literallayout class='monospaced'>
2632 pkg_postinst_PACKAGENAME () { 2633 pkg_postinst_PACKAGENAME() {
2633 #!/bin/sh -e 2634 #!/bin/sh -e
2634 if [ x"$D" = "x" ]; then 2635 if [ x"$D" = "x" ]; then
2635 # Actions to carry out on the device go here 2636 # Actions to carry out on the device go here
@@ -2811,33 +2812,36 @@
2811 <para> 2812 <para>
2812 In the following example, <filename>mtd-utils</filename> is a makefile-based package: 2813 In the following example, <filename>mtd-utils</filename> is a makefile-based package:
2813 <literallayout class='monospaced'> 2814 <literallayout class='monospaced'>
2814 SUMMARY = "Tools for managing memory technology devices." 2815 SUMMARY = "Tools for managing memory technology devices"
2815 SECTION = "base" 2816 SECTION = "base"
2816 DEPENDS = "zlib lzo e2fsprogs util-linux" 2817 DEPENDS = "zlib lzo e2fsprogs util-linux"
2817 HOMEPAGE = "http://www.linux-mtd.infradead.org/" 2818 HOMEPAGE = "http://www.linux-mtd.infradead.org/"
2818 LICENSE = "GPLv2+" 2819 LICENSE = "GPLv2+"
2819 LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \ 2820 LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
2820 file://include/common.h;beginline=1;endline=17;md5=ba05b07912a44ea2bf81ce409380049c" 2821 file://include/common.h;beginline=1;endline=17;md5=ba05b07912a44ea2bf81ce409380049c"
2821 2822
2822 SRC_URI = "git://git.infradead.org/mtd-utils.git;protocol=git;tag=995cfe51b0a3cf32f381c140bf72b21bf91cef1b \ 2823 # Use the latest version at 26 Oct, 2013
2823 file://add-exclusion-to-mkfs-jffs2-git-2.patch" 2824 SRCREV = "9f107132a6a073cce37434ca9cda6917dd8d866b"
2825 SRC_URI = "git://git.infradead.org/mtd-utils.git \
2826 file://add-exclusion-to-mkfs-jffs2-git-2.patch \
2827 "
2824 2828
2825 S = "${WORKDIR}/git/" 2829 PV = "1.5.1+git${SRCPV}"
2826 2830
2827 PR = "r1" 2831 S = "${WORKDIR}/git/"
2828 2832
2829 EXTRA_OEMAKE = "'CC=${CC}' 'RANLIB=${RANLIB}' 'AR=${AR}' \ 2833 EXTRA_OEMAKE = "'CC=${CC}' 'RANLIB=${RANLIB}' 'AR=${AR}' 'CFLAGS=${CFLAGS} -I${S}/include -DWITHOUT_XATTR' 'BUILDDIR=${S}'"
2830 'CFLAGS=${CFLAGS} -I${S}/include -DWITHOUT_XATTR' 'BUILDDIR=${S}'"
2831 2834
2832 do_install () { 2835 do_install () {
2833 oe_runmake install DESTDIR=${D} SBINDIR=${sbindir} MANDIR=${mandir} \ 2836 oe_runmake install DESTDIR=${D} SBINDIR=${sbindir} MANDIR=${mandir} INCLUDEDIR=${includedir}
2834 INCLUDEDIR=${includedir}
2835 install -d ${D}${includedir}/mtd/
2836 for f in ${S}/include/mtd/*.h; do
2837 install -m 0644 $f ${D}${includedir}/mtd/
2838 done
2839 } 2837 }
2840 2838
2839 PACKAGES =+ "mtd-utils-jffs2 mtd-utils-ubifs mtd-utils-misc"
2840
2841 FILES_mtd-utils-jffs2 = "${sbindir}/mkfs.jffs2 ${sbindir}/jffs2dump ${sbindir}/jffs2reader ${sbindir}/sumtool"
2842 FILES_mtd-utils-ubifs = "${sbindir}/mkfs.ubifs ${sbindir}/ubi*"
2843 FILES_mtd-utils-misc = "${sbindir}/nftl* ${sbindir}/ftl* ${sbindir}/rfd* ${sbindir}/doc* ${sbindir}/serve_image ${sbindir}/recv_image"
2844
2841 PARALLEL_MAKE = "" 2845 PARALLEL_MAKE = ""
2842 2846
2843 BBCLASSEXTEND = "native" 2847 BBCLASSEXTEND = "native"