summaryrefslogtreecommitdiffstats
path: root/documentation
diff options
context:
space:
mode:
authorAntonin Godard <antonin.godard@bootlin.com>2024-10-16 14:08:56 +0200
committerSteve Sakoman <steve@sakoman.com>2024-11-02 06:06:09 -0700
commit85bb126fc14dc8847ada6d3b83ee208ed7fc9b6c (patch)
tree951e00e2907016e49493b4afe2782ecc8fb3fa49 /documentation
parentbd6884543da5491103b91a455f5cab81308f4fb5 (diff)
downloadpoky-85bb126fc14dc8847ada6d3b83ee208ed7fc9b6c.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: ef4150029d377ce1c35645971502ae56345915a6) 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.rst61
1 files changed, 56 insertions, 5 deletions
diff --git a/documentation/overview-manual/concepts.rst b/documentation/overview-manual/concepts.rst
index e70c778263..c7e062bdfb 100644
--- a/documentation/overview-manual/concepts.rst
+++ b/documentation/overview-manual/concepts.rst
@@ -939,11 +939,62 @@ the analysis and package splitting process use several areas:
939 execute on a system and it generates code for yet another machine 939 execute on a system and it generates code for yet another machine
940 (e.g. cross-canadian recipes). 940 (e.g. cross-canadian recipes).
941 941
942The :term:`FILES` variable defines the 942Packages for a recipe are listed in the :term:`PACKAGES` variable. The
943files that go into each package in 943:oe_git:`bitbake.conf </openembedded-core/tree/meta/conf/bitbake.conf>`
944:term:`PACKAGES`. If you want 944configuration file defines the following default list of packages::
945details on how this is accomplished, you can look at 945
946:yocto_git:`package.bbclass </poky/tree/meta/classes/package.bbclass>`. 946 PACKAGES = "${PN}-src ${PN}-dbg ${PN}-staticdev ${PN}-dev ${PN}-doc ${PN}-locale ${PACKAGE_BEFORE_PN} ${PN}"
947
948Each of these packages contains a default list of files defined with the
949:term:`FILES` variable. For example, the package ``${PN}-dev`` represents files
950useful to the development of applications depending on ``${PN}``. The default
951list of files for ``${PN}-dev``, also defined in :oe_git:`bitbake.conf
952</openembedded-core/tree/meta/conf/bitbake.conf>`, is defined as follows::
953
954 FILES:${PN}-dev = "${includedir} ${FILES_SOLIBSDEV} ${libdir}/*.la \
955 ${libdir}/*.o ${libdir}/pkgconfig ${datadir}/pkgconfig \
956 ${datadir}/aclocal ${base_libdir}/*.o \
957 ${libdir}/${BPN}/*.la ${base_libdir}/*.la \
958 ${libdir}/cmake ${datadir}/cmake"
959
960The paths in this list must be *absolute* paths from the point of view of the
961root filesystem on the target, and must *not* make a reference to the variable
962:term:`D` or any :term:`WORKDIR` related variable. A correct example would be::
963
964 ${sysconfdir}/foo.conf
965
966.. note::
967
968 The list of files for a package is defined using the override syntax by
969 separating :term:`FILES` and the package name by a semi-colon (``:``).
970
971A given file can only ever be in one package. By iterating from the leftmost to
972rightmost package in :term:`PACKAGES`, each file matching one of the patterns
973defined in the corresponding :term:`FILES` definition is included in the
974package.
975
976.. note::
977
978 To find out which package installs a file, the ``oe-pkgdata-util``
979 command-line utility can be used::
980
981 $ oe-pkgdata-util find-path '/etc/fstab'
982 base-files: /etc/fstab
983
984 For more information on the ``oe-pkgdata-util`` utility, see the section
985 :ref:`dev-manual/debugging:Viewing Package Information with
986 \`\`oe-pkgdata-util\`\`` of the Yocto Project Development Tasks Manual.
987
988To add a custom package variant of the ``${PN}`` recipe named
989``${PN}-extra`` (name is arbitrary), one can add it to the
990:term:`PACKAGE_BEFORE_PN` variable::
991
992 PACKAGE_BEFORE_PN += "${PN}-extra"
993
994Alternatively, a custom package can be added by adding it to the
995:term:`PACKAGES` variable using the prepend operator (``=+``)::
996
997 PACKAGES =+ "${PN}-extra"
947 998
948Depending on the type of packages being created (RPM, DEB, or IPK), the 999Depending on the type of packages being created (RPM, DEB, or IPK), the
949:ref:`do_package_write_* <ref-tasks-package_write_deb>` 1000:ref:`do_package_write_* <ref-tasks-package_write_deb>`