mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 12:59:02 +02:00
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>
This commit is contained in:
parent
bd6884543d
commit
85bb126fc1
|
@ -939,11 +939,62 @@ the analysis and package splitting process use several areas:
|
|||
execute on a system and it generates code for yet another machine
|
||||
(e.g. cross-canadian recipes).
|
||||
|
||||
The :term:`FILES` variable defines the
|
||||
files that go into each package in
|
||||
:term:`PACKAGES`. If you want
|
||||
details on how this is accomplished, you can look at
|
||||
:yocto_git:`package.bbclass </poky/tree/meta/classes/package.bbclass>`.
|
||||
Packages for a recipe are listed in the :term:`PACKAGES` variable. The
|
||||
:oe_git:`bitbake.conf </openembedded-core/tree/meta/conf/bitbake.conf>`
|
||||
configuration file defines the following default list of packages::
|
||||
|
||||
PACKAGES = "${PN}-src ${PN}-dbg ${PN}-staticdev ${PN}-dev ${PN}-doc ${PN}-locale ${PACKAGE_BEFORE_PN} ${PN}"
|
||||
|
||||
Each of these packages contains a default list of files defined with the
|
||||
:term:`FILES` variable. For example, the package ``${PN}-dev`` represents files
|
||||
useful to the development of applications depending on ``${PN}``. The default
|
||||
list of files for ``${PN}-dev``, also defined in :oe_git:`bitbake.conf
|
||||
</openembedded-core/tree/meta/conf/bitbake.conf>`, is defined as follows::
|
||||
|
||||
FILES:${PN}-dev = "${includedir} ${FILES_SOLIBSDEV} ${libdir}/*.la \
|
||||
${libdir}/*.o ${libdir}/pkgconfig ${datadir}/pkgconfig \
|
||||
${datadir}/aclocal ${base_libdir}/*.o \
|
||||
${libdir}/${BPN}/*.la ${base_libdir}/*.la \
|
||||
${libdir}/cmake ${datadir}/cmake"
|
||||
|
||||
The paths in this list must be *absolute* paths from the point of view of the
|
||||
root filesystem on the target, and must *not* make a reference to the variable
|
||||
:term:`D` or any :term:`WORKDIR` related variable. A correct example would be::
|
||||
|
||||
${sysconfdir}/foo.conf
|
||||
|
||||
.. note::
|
||||
|
||||
The list of files for a package is defined using the override syntax by
|
||||
separating :term:`FILES` and the package name by a semi-colon (``:``).
|
||||
|
||||
A given file can only ever be in one package. By iterating from the leftmost to
|
||||
rightmost package in :term:`PACKAGES`, each file matching one of the patterns
|
||||
defined in the corresponding :term:`FILES` definition is included in the
|
||||
package.
|
||||
|
||||
.. note::
|
||||
|
||||
To find out which package installs a file, the ``oe-pkgdata-util``
|
||||
command-line utility can be used::
|
||||
|
||||
$ oe-pkgdata-util find-path '/etc/fstab'
|
||||
base-files: /etc/fstab
|
||||
|
||||
For more information on the ``oe-pkgdata-util`` utility, see the section
|
||||
:ref:`dev-manual/debugging:Viewing Package Information with
|
||||
\`\`oe-pkgdata-util\`\`` of the Yocto Project Development Tasks Manual.
|
||||
|
||||
To add a custom package variant of the ``${PN}`` recipe named
|
||||
``${PN}-extra`` (name is arbitrary), one can add it to the
|
||||
:term:`PACKAGE_BEFORE_PN` variable::
|
||||
|
||||
PACKAGE_BEFORE_PN += "${PN}-extra"
|
||||
|
||||
Alternatively, a custom package can be added by adding it to the
|
||||
:term:`PACKAGES` variable using the prepend operator (``=+``)::
|
||||
|
||||
PACKAGES =+ "${PN}-extra"
|
||||
|
||||
Depending on the type of packages being created (RPM, DEB, or IPK), the
|
||||
:ref:`do_package_write_* <ref-tasks-package_write_deb>`
|
||||
|
|
Loading…
Reference in New Issue
Block a user