diff options
author | Antonin Godard <antonin.godard@bootlin.com> | 2024-10-16 14:08:56 +0200 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2024-10-30 08:30:00 -0700 |
commit | cab2c6b225aebdd09b86274b036ff15b862ea02e (patch) | |
tree | 33d02ebf4c6b800a47c975ee8347f9887a1ac304 /documentation | |
parent | ddace1be7089892d87beea674bd957eb3003bff6 (diff) | |
download | poky-cab2c6b225aebdd09b86274b036ff15b862ea02e.tar.gz |
overview-manual: concepts: add details on package splitting
The package splitting section of the overview manual currently lacks any
explanation of how package splitting is implemented and redirects to
the package class, which is not really understandable for newcomers to
the project.
This patch adds a short explanation of what is done:
* How the PACKAGES variable is defined.
* How the FILES variable is defined.
* How the two work together.
* How to add a custom package.
This should give enough details to a new user on what package splitting
achieves and how to add a custom package.
Adresses [YOCTO #13225]
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
(From yocto-docs rev: ccda7c8bb890a290fb41e104f6d818076f4eeaa8)
Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
(cherry picked from commit 143c3cacdec36c9d7ab81c89bbcc12c0c3936bd9)
Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'documentation')
-rw-r--r-- | documentation/overview-manual/concepts.rst | 61 |
1 files changed, 56 insertions, 5 deletions
diff --git a/documentation/overview-manual/concepts.rst b/documentation/overview-manual/concepts.rst index 62f2327a7e..70766559f8 100644 --- a/documentation/overview-manual/concepts.rst +++ b/documentation/overview-manual/concepts.rst | |||
@@ -912,11 +912,62 @@ the analysis and package splitting process use several areas: | |||
912 | execute on a system and it generates code for yet another machine | 912 | execute on a system and it generates code for yet another machine |
913 | (e.g. :ref:`ref-classes-cross-canadian` recipes). | 913 | (e.g. :ref:`ref-classes-cross-canadian` recipes). |
914 | 914 | ||
915 | The :term:`FILES` variable defines the | 915 | Packages for a recipe are listed in the :term:`PACKAGES` variable. The |
916 | files that go into each package in | 916 | :oe_git:`bitbake.conf </openembedded-core/tree/meta/conf/bitbake.conf>` |
917 | :term:`PACKAGES`. If you want | 917 | configuration file defines the following default list of packages:: |
918 | details on how this is accomplished, you can look at | 918 | |
919 | :yocto_git:`package.bbclass </poky/tree/meta/classes-global/package.bbclass>`. | 919 | PACKAGES = "${PN}-src ${PN}-dbg ${PN}-staticdev ${PN}-dev ${PN}-doc ${PN}-locale ${PACKAGE_BEFORE_PN} ${PN}" |
920 | |||
921 | Each of these packages contains a default list of files defined with the | ||
922 | :term:`FILES` variable. For example, the package ``${PN}-dev`` represents files | ||
923 | useful to the development of applications depending on ``${PN}``. The default | ||
924 | list of files for ``${PN}-dev``, also defined in :oe_git:`bitbake.conf | ||
925 | </openembedded-core/tree/meta/conf/bitbake.conf>`, is defined as follows:: | ||
926 | |||
927 | FILES:${PN}-dev = "${includedir} ${FILES_SOLIBSDEV} ${libdir}/*.la \ | ||
928 | ${libdir}/*.o ${libdir}/pkgconfig ${datadir}/pkgconfig \ | ||
929 | ${datadir}/aclocal ${base_libdir}/*.o \ | ||
930 | ${libdir}/${BPN}/*.la ${base_libdir}/*.la \ | ||
931 | ${libdir}/cmake ${datadir}/cmake" | ||
932 | |||
933 | The paths in this list must be *absolute* paths from the point of view of the | ||
934 | root filesystem on the target, and must *not* make a reference to the variable | ||
935 | :term:`D` or any :term:`WORKDIR` related variable. A correct example would be:: | ||
936 | |||
937 | ${sysconfdir}/foo.conf | ||
938 | |||
939 | .. note:: | ||
940 | |||
941 | The list of files for a package is defined using the override syntax by | ||
942 | separating :term:`FILES` and the package name by a semi-colon (``:``). | ||
943 | |||
944 | A given file can only ever be in one package. By iterating from the leftmost to | ||
945 | rightmost package in :term:`PACKAGES`, each file matching one of the patterns | ||
946 | defined in the corresponding :term:`FILES` definition is included in the | ||
947 | package. | ||
948 | |||
949 | .. note:: | ||
950 | |||
951 | To find out which package installs a file, the ``oe-pkgdata-util`` | ||
952 | command-line utility can be used:: | ||
953 | |||
954 | $ oe-pkgdata-util find-path '/etc/fstab' | ||
955 | base-files: /etc/fstab | ||
956 | |||
957 | For more information on the ``oe-pkgdata-util`` utility, see the section | ||
958 | :ref:`dev-manual/debugging:Viewing Package Information with | ||
959 | \`\`oe-pkgdata-util\`\`` of the Yocto Project Development Tasks Manual. | ||
960 | |||
961 | To add a custom package variant of the ``${PN}`` recipe named | ||
962 | ``${PN}-extra`` (name is arbitrary), one can add it to the | ||
963 | :term:`PACKAGE_BEFORE_PN` variable:: | ||
964 | |||
965 | PACKAGE_BEFORE_PN += "${PN}-extra" | ||
966 | |||
967 | Alternatively, a custom package can be added by adding it to the | ||
968 | :term:`PACKAGES` variable using the prepend operator (``=+``):: | ||
969 | |||
970 | PACKAGES =+ "${PN}-extra" | ||
920 | 971 | ||
921 | Depending on the type of packages being created (RPM, DEB, or IPK), the | 972 | Depending on the type of packages being created (RPM, DEB, or IPK), the |
922 | :ref:`do_package_write_* <ref-tasks-package_write_deb>` | 973 | :ref:`do_package_write_* <ref-tasks-package_write_deb>` |