diff options
Diffstat (limited to 'documentation/overview-manual/concepts.rst')
-rw-r--r-- | documentation/overview-manual/concepts.rst | 51 |
1 files changed, 17 insertions, 34 deletions
diff --git a/documentation/overview-manual/concepts.rst b/documentation/overview-manual/concepts.rst index ada5143b2a..2e3f1af442 100644 --- a/documentation/overview-manual/concepts.rst +++ b/documentation/overview-manual/concepts.rst | |||
@@ -55,8 +55,7 @@ This section briefly introduces BitBake. If you want more information on | |||
55 | BitBake, see the :doc:`BitBake User Manual <bitbake:index>`. | 55 | BitBake, see the :doc:`BitBake User Manual <bitbake:index>`. |
56 | 56 | ||
57 | To see a list of the options BitBake supports, use either of the | 57 | To see a list of the options BitBake supports, use either of the |
58 | following commands: | 58 | following commands:: |
59 | :: | ||
60 | 59 | ||
61 | $ bitbake -h | 60 | $ bitbake -h |
62 | $ bitbake --help | 61 | $ bitbake --help |
@@ -66,8 +65,7 @@ The most common usage for BitBake is ``bitbake recipename``, where | |||
66 | to as the "target"). The target often equates to the first part of a | 65 | to as the "target"). The target often equates to the first part of a |
67 | recipe's filename (e.g. "foo" for a recipe named ``foo_1.3.0-r0.bb``). | 66 | recipe's filename (e.g. "foo" for a recipe named ``foo_1.3.0-r0.bb``). |
68 | So, to process the ``matchbox-desktop_1.2.3.bb`` recipe file, you might | 67 | So, to process the ``matchbox-desktop_1.2.3.bb`` recipe file, you might |
69 | type the following: | 68 | type the following:: |
70 | :: | ||
71 | 69 | ||
72 | $ bitbake matchbox-desktop | 70 | $ bitbake matchbox-desktop |
73 | 71 | ||
@@ -1068,15 +1066,13 @@ the image. The formats used for the root filesystem depend on the | |||
1068 | support compression. | 1066 | support compression. |
1069 | 1067 | ||
1070 | As an example, a dynamically created task when creating a particular | 1068 | As an example, a dynamically created task when creating a particular |
1071 | image type would take the following form: | 1069 | image type would take the following form:: |
1072 | :: | ||
1073 | 1070 | ||
1074 | do_image_type | 1071 | do_image_type |
1075 | 1072 | ||
1076 | So, if the type | 1073 | So, if the type |
1077 | as specified by the ``IMAGE_FSTYPES`` were ``ext4``, the dynamically | 1074 | as specified by the ``IMAGE_FSTYPES`` were ``ext4``, the dynamically |
1078 | generated task would be as follows: | 1075 | generated task would be as follows:: |
1079 | :: | ||
1080 | 1076 | ||
1081 | do_image_ext4 | 1077 | do_image_ext4 |
1082 | 1078 | ||
@@ -1478,8 +1474,7 @@ cross-compiler that is used internally within BitBake only. | |||
1478 | gcc-cross | 1474 | gcc-cross |
1479 | . | 1475 | . |
1480 | 1476 | ||
1481 | The chain of events that occurs when the standard toolchain is bootstrapped: | 1477 | The chain of events that occurs when the standard toolchain is bootstrapped:: |
1482 | :: | ||
1483 | 1478 | ||
1484 | binutils-cross -> linux-libc-headers -> gcc-cross -> libgcc-initial -> glibc -> libgcc -> gcc-runtime | 1479 | binutils-cross -> linux-libc-headers -> gcc-cross -> libgcc-initial -> glibc -> libgcc -> gcc-runtime |
1485 | 1480 | ||
@@ -1528,8 +1523,7 @@ might not be the same machine as the Build Host. | |||
1528 | can take advantage of pre-built images that ship with the Yocto | 1523 | can take advantage of pre-built images that ship with the Yocto |
1529 | Project and already contain cross-development toolchain installers. | 1524 | Project and already contain cross-development toolchain installers. |
1530 | 1525 | ||
1531 | Here is the bootstrap process for the relocatable toolchain: | 1526 | Here is the bootstrap process for the relocatable toolchain:: |
1532 | :: | ||
1533 | 1527 | ||
1534 | gcc -> binutils-crosssdk -> gcc-crosssdk-initial -> linux-libc-headers -> glibc-initial -> nativesdk-glibc -> gcc-crosssdk -> gcc-cross-canadian | 1528 | gcc -> binutils-crosssdk -> gcc-crosssdk-initial -> linux-libc-headers -> glibc-initial -> nativesdk-glibc -> gcc-crosssdk -> gcc-cross-canadian |
1535 | 1529 | ||
@@ -1703,8 +1697,7 @@ to the task. | |||
1703 | 1697 | ||
1704 | Like the ``WORKDIR`` case, situations exist where dependencies should be | 1698 | Like the ``WORKDIR`` case, situations exist where dependencies should be |
1705 | ignored. For these situations, you can instruct the build process to | 1699 | ignored. For these situations, you can instruct the build process to |
1706 | ignore a dependency by using a line like the following: | 1700 | ignore a dependency by using a line like the following:: |
1707 | :: | ||
1708 | 1701 | ||
1709 | PACKAGE_ARCHS[vardepsexclude] = "MACHINE" | 1702 | PACKAGE_ARCHS[vardepsexclude] = "MACHINE" |
1710 | 1703 | ||
@@ -1714,8 +1707,7 @@ reference it. | |||
1714 | 1707 | ||
1715 | Equally, there are cases where you need to add dependencies BitBake is | 1708 | Equally, there are cases where you need to add dependencies BitBake is |
1716 | not able to find. You can accomplish this by using a line like the | 1709 | not able to find. You can accomplish this by using a line like the |
1717 | following: | 1710 | following:: |
1718 | :: | ||
1719 | 1711 | ||
1720 | PACKAGE_ARCHS[vardeps] = "MACHINE" | 1712 | PACKAGE_ARCHS[vardeps] = "MACHINE" |
1721 | 1713 | ||
@@ -1745,8 +1737,7 @@ and the dependent task hashes can be influenced. Within the BitBake | |||
1745 | configuration file, you can give BitBake some extra information to help | 1737 | configuration file, you can give BitBake some extra information to help |
1746 | it construct the basehash. The following statement effectively results | 1738 | it construct the basehash. The following statement effectively results |
1747 | in a list of global variable dependency excludes (i.e. variables never | 1739 | in a list of global variable dependency excludes (i.e. variables never |
1748 | included in any checksum): | 1740 | included in any checksum):: |
1749 | :: | ||
1750 | 1741 | ||
1751 | BB_HASHBASE_WHITELIST ?= "TMPDIR FILE PATH PWD BB_TASKHASH BBPATH DL_DIR \\ | 1742 | BB_HASHBASE_WHITELIST ?= "TMPDIR FILE PATH PWD BB_TASKHASH BBPATH DL_DIR \\ |
1752 | SSTATE_DIR THISDIR FILESEXTRAPATHS FILE_DIRNAME HOME LOGNAME SHELL TERM \\ | 1743 | SSTATE_DIR THISDIR FILESEXTRAPATHS FILE_DIRNAME HOME LOGNAME SHELL TERM \\ |
@@ -1771,8 +1762,7 @@ desired. This file defines the two basic signature generators | |||
1771 | "OEBasicHash". By default, a dummy "noop" signature handler is enabled | 1762 | "OEBasicHash". By default, a dummy "noop" signature handler is enabled |
1772 | in BitBake. This means that behavior is unchanged from previous | 1763 | in BitBake. This means that behavior is unchanged from previous |
1773 | versions. OE-Core uses the "OEBasicHash" signature handler by default | 1764 | versions. OE-Core uses the "OEBasicHash" signature handler by default |
1774 | through this setting in the ``bitbake.conf`` file: | 1765 | through this setting in the ``bitbake.conf`` file:: |
1775 | :: | ||
1776 | 1766 | ||
1777 | BB_SIGNATURE_HANDLER ?= "OEBasicHash" | 1767 | BB_SIGNATURE_HANDLER ?= "OEBasicHash" |
1778 | 1768 | ||
@@ -1826,8 +1816,7 @@ The Yocto Project team has tried to keep the details of the | |||
1826 | implementation hidden in ``sstate`` class. From a user's perspective, | 1816 | implementation hidden in ``sstate`` class. From a user's perspective, |
1827 | adding shared state wrapping to a task is as simple as this | 1817 | adding shared state wrapping to a task is as simple as this |
1828 | :ref:`ref-tasks-deploy` example taken | 1818 | :ref:`ref-tasks-deploy` example taken |
1829 | from the :ref:`deploy <ref-classes-deploy>` class: | 1819 | from the :ref:`deploy <ref-classes-deploy>` class:: |
1830 | :: | ||
1831 | 1820 | ||
1832 | DEPLOYDIR = "${WORKDIR}/deploy-${PN}" | 1821 | DEPLOYDIR = "${WORKDIR}/deploy-${PN}" |
1833 | SSTATETASKS += "do_deploy" | 1822 | SSTATETASKS += "do_deploy" |
@@ -1871,8 +1860,7 @@ The following list explains the previous example: | |||
1871 | instead, skipping the ``do_deploy`` task. | 1860 | instead, skipping the ``do_deploy`` task. |
1872 | 1861 | ||
1873 | - The following task definition is glue logic needed to make the | 1862 | - The following task definition is glue logic needed to make the |
1874 | previous settings effective: | 1863 | previous settings effective:: |
1875 | :: | ||
1876 | 1864 | ||
1877 | python do_deploy_setscene () { | 1865 | python do_deploy_setscene () { |
1878 | sstate_setscene(d) | 1866 | sstate_setscene(d) |
@@ -1898,8 +1886,7 @@ The following list explains the previous example: | |||
1898 | In cases where ``sstate-inputdirs`` and ``sstate-outputdirs`` would be | 1886 | In cases where ``sstate-inputdirs`` and ``sstate-outputdirs`` would be |
1899 | the same, you can use ``sstate-plaindirs``. For example, to preserve the | 1887 | the same, you can use ``sstate-plaindirs``. For example, to preserve the |
1900 | ${:term:`PKGD`} and ${:term:`PKGDEST`} output from the ``do_package`` | 1888 | ${:term:`PKGD`} and ${:term:`PKGDEST`} output from the ``do_package`` |
1901 | task, use the following: | 1889 | task, use the following:: |
1902 | :: | ||
1903 | 1890 | ||
1904 | do_package[sstate-plaindirs] = "${PKGD} ${PKGDEST}" | 1891 | do_package[sstate-plaindirs] = "${PKGD} ${PKGDEST}" |
1905 | 1892 | ||
@@ -1917,24 +1904,21 @@ The following list explains the previous example: | |||
1917 | multiple directories. For example, the following declares | 1904 | multiple directories. For example, the following declares |
1918 | ``PKGDESTWORK`` and ``SHLIBWORK`` as shared state input directories, | 1905 | ``PKGDESTWORK`` and ``SHLIBWORK`` as shared state input directories, |
1919 | which populates the shared state cache, and ``PKGDATA_DIR`` and | 1906 | which populates the shared state cache, and ``PKGDATA_DIR`` and |
1920 | ``SHLIBSDIR`` as the corresponding shared state output directories: | 1907 | ``SHLIBSDIR`` as the corresponding shared state output directories:: |
1921 | :: | ||
1922 | 1908 | ||
1923 | do_package[sstate-inputdirs] = "${PKGDESTWORK} ${SHLIBSWORKDIR}" | 1909 | do_package[sstate-inputdirs] = "${PKGDESTWORK} ${SHLIBSWORKDIR}" |
1924 | do_package[sstate-outputdirs] = "${PKGDATA_DIR} ${SHLIBSDIR}" | 1910 | do_package[sstate-outputdirs] = "${PKGDATA_DIR} ${SHLIBSDIR}" |
1925 | 1911 | ||
1926 | - These methods also include the ability to take a lockfile when | 1912 | - These methods also include the ability to take a lockfile when |
1927 | manipulating shared state directory structures, for cases where file | 1913 | manipulating shared state directory structures, for cases where file |
1928 | additions or removals are sensitive: | 1914 | additions or removals are sensitive:: |
1929 | :: | ||
1930 | 1915 | ||
1931 | do_package[sstate-lockfile] = "${PACKAGELOCK}" | 1916 | do_package[sstate-lockfile] = "${PACKAGELOCK}" |
1932 | 1917 | ||
1933 | Behind the scenes, the shared state code works by looking in | 1918 | Behind the scenes, the shared state code works by looking in |
1934 | :term:`SSTATE_DIR` and | 1919 | :term:`SSTATE_DIR` and |
1935 | :term:`SSTATE_MIRRORS` for | 1920 | :term:`SSTATE_MIRRORS` for |
1936 | shared state files. Here is an example: | 1921 | shared state files. Here is an example:: |
1937 | :: | ||
1938 | 1922 | ||
1939 | SSTATE_MIRRORS ?= "\ | 1923 | SSTATE_MIRRORS ?= "\ |
1940 | file://.\* http://someserver.tld/share/sstate/PATH;downloadfilename=PATH \n \ | 1924 | file://.\* http://someserver.tld/share/sstate/PATH;downloadfilename=PATH \n \ |
@@ -2116,8 +2100,7 @@ accomplished using fakeroot. | |||
2116 | under fakeroot. Otherwise, the task cannot run root-only operations, | 2100 | under fakeroot. Otherwise, the task cannot run root-only operations, |
2117 | and cannot see the fake file ownership and permissions set by the | 2101 | and cannot see the fake file ownership and permissions set by the |
2118 | other task. You need to also add a dependency on | 2102 | other task. You need to also add a dependency on |
2119 | ``virtual/fakeroot-native:do_populate_sysroot``, giving the following: | 2103 | ``virtual/fakeroot-native:do_populate_sysroot``, giving the following:: |
2120 | :: | ||
2121 | 2104 | ||
2122 | fakeroot do_mytask () { | 2105 | fakeroot do_mytask () { |
2123 | ... | 2106 | ... |