1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-01 13:09:50 +00:00

dev-manual: Updated managing granular level packaging discussion.

In the section that talks about building an image for multiple
machines, there was a bullet item on managing granular level
packaging.  It had an old example that used the "daisy" release
that showed how to share packages and re-use binaries.  I replaced
the example with a discussion of Freescale's "fsl-dynamic-packagearch"
class, which does this type of sharing.

(From yocto-docs rev: ddc224d6d1fe172292dfd0a17f743a1e0a4cabe6)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Scott Rifenbark
2018-04-23 11:12:04 -07:00
committed by Richard Purdie
parent 4034d8ec69
commit 01fd8fcd50
@@ -8140,13 +8140,15 @@ Some notes from Cal:
cause the OpenEmbedded build system to reuse software across the cause the OpenEmbedded build system to reuse software across the
various machines where it makes sense. various machines where it makes sense.
</para> </para>
<para> <para>
If build speed and package feed maintenance are considerations, If build speed and package feed maintenance are considerations,
you should consider the points in this section that can help you you should consider the points in this section that can help you
optimize your tunings to best consider build times and package optimize your tunings to best consider build times and package
feed maintenance. feed maintenance.
<itemizedlist> <itemizedlist>
<listitem><para><emphasis>Share the Build Directory:</emphasis> <listitem><para>
<emphasis>Share the Build Directory:</emphasis>
If at all possible, share the If at all possible, share the
<ulink url='&YOCTO_DOCS_REF_URL;#var-TMPDIR'><filename>TMPDIR</filename></ulink> <ulink url='&YOCTO_DOCS_REF_URL;#var-TMPDIR'><filename>TMPDIR</filename></ulink>
across builds. across builds.
@@ -8172,7 +8174,8 @@ Some notes from Cal:
<filename>TMPDIR</filename>. <filename>TMPDIR</filename>.
</note> </note>
</para></listitem> </para></listitem>
<listitem><para><emphasis>Enable the Appropriate Package Architecture:</emphasis> <listitem><para>
<emphasis>Enable the Appropriate Package Architecture:</emphasis>
By default, the OpenEmbedded build system enables three By default, the OpenEmbedded build system enables three
levels of package architectures: "all", "tune" or "package", levels of package architectures: "all", "tune" or "package",
and "machine". and "machine".
@@ -8181,6 +8184,7 @@ Some notes from Cal:
Depending for what a given recipe creates packages, making Depending for what a given recipe creates packages, making
sure you enable the appropriate package architecture can sure you enable the appropriate package architecture can
directly impact the build time.</para> directly impact the build time.</para>
<para>A recipe that just generates scripts can enable <para>A recipe that just generates scripts can enable
"all" architecture because there are no binaries to build. "all" architecture because there are no binaries to build.
To specifically enable "all" architecture, be sure your To specifically enable "all" architecture, be sure your
@@ -8190,6 +8194,7 @@ Some notes from Cal:
This class is useful for "all" architectures because it This class is useful for "all" architectures because it
configures many variables so packages can be used across configures many variables so packages can be used across
multiple architectures.</para> multiple architectures.</para>
<para>If your recipe needs to generate packages that are <para>If your recipe needs to generate packages that are
machine-specific or when one of the build or runtime machine-specific or when one of the build or runtime
dependencies is already machine-architecture dependent, dependencies is already machine-architecture dependent,
@@ -8211,7 +8216,8 @@ Some notes from Cal:
PACKAGE_ARCH = "${TUNE_PKGARCH}" PACKAGE_ARCH = "${TUNE_PKGARCH}"
</literallayout> </literallayout>
</para></listitem> </para></listitem>
<listitem><para><emphasis>Choose a Generic Tuning File if Possible:</emphasis> <listitem><para>
<emphasis>Choose a Generic Tuning File if Possible:</emphasis>
Some tunes are more generic and can run on multiple targets Some tunes are more generic and can run on multiple targets
(e.g. an <filename>armv5</filename> set of packages could (e.g. an <filename>armv5</filename> set of packages could
run on <filename>armv6</filename> and run on <filename>armv6</filename> and
@@ -8220,6 +8226,7 @@ Some notes from Cal:
on <filename>i586</filename> and higher processors. on <filename>i586</filename> and higher processors.
You should realize, however, that advances on newer You should realize, however, that advances on newer
processor versions would not be used.</para> processor versions would not be used.</para>
<para>If you select the same tune for several different <para>If you select the same tune for several different
machines, the OpenEmbedded build system reuses software machines, the OpenEmbedded build system reuses software
previously built, thus speeding up the overall build time. previously built, thus speeding up the overall build time.
@@ -8227,34 +8234,35 @@ Some notes from Cal:
generated, the software is not recompiled and only one generated, the software is not recompiled and only one
package feed exists. package feed exists.
</para></listitem> </para></listitem>
<listitem><para><emphasis>Manage Granular Level Packaging:</emphasis> <listitem><para>
Sometimes cases exist where injecting another level <emphasis>Manage Granular Level Packaging:</emphasis>
of package architecture beyond the three higher levels Sometimes cases exist where injecting another level of
noted earlier can be useful. package architecture beyond the three higher levels noted
For example, consider the <filename>emgd</filename> earlier can be useful.
graphics stack in the For example, consider how NXP (formerly Freescale) allows
<filename>meta-intel</filename> layer. for the easy reuse of binary packages in their layer
In this layer, a subset of software exists that is <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/meta-freescale/'><filename>meta-freescale</filename></ulink>.
compiled against something different from the rest of the In this example, the
generic packages. <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/meta-freescale/tree/classes/fsl-dynamic-packagearch.bbclass'><filename>fsl-dynamic-packagearch</filename></ulink>
You can examine the key code in the class shares GPU packages for i.MX53 boards because
<ulink url='http://git.yoctoproject.org/cgit/cgit.cgi'>Source Repositories</ulink> all boards share the AMD GPU.
"daisy" branch in The i.MX6-based boards can do the same because all boards
<filename>classes/emgd-gl.bbclass</filename>. share the Vivante GPU.
For a specific set of packages, the code redefines This class inspects the BitBake datastore to identify if
<ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_ARCH'><filename>PACKAGE_ARCH</filename></ulink>. the package provides or depends on one of the
<ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_EXTRA_ARCHS'><filename>PACKAGE_EXTRA_ARCHS</filename></ulink> sub-architecture values.
is then appended with this extra tune name in If so, the class sets the
<filename>meta-intel-emgd.inc</filename>. <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_ARCH'><filename>PACKAGE_ARCH</filename></ulink>
The result is that when searching for packages, the value as <filename>MACHINE_SUBARCH</filename>.
build system uses a four-level search and the packages If the package does not provide or depend on one of the
in this new level are preferred as compared to the standard sub-architecture values but it matches a value in the
tune. machine-specific filter, it sets
The overall result is that the build system reuses most <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE_ARCH'><filename>MACHINE_ARCH</filename></ulink>.
software from the common tune except for specific cases This behavior reduces the number of packages built and
as needed. saves build time by reusing binaries.
</para></listitem> </para></listitem>
<listitem><para><emphasis>Use Tools to Debug Issues:</emphasis> <listitem><para>
<emphasis>Use Tools to Debug Issues:</emphasis>
Sometimes you can run into situations where software is Sometimes you can run into situations where software is
being rebuilt when you think it should not be. being rebuilt when you think it should not be.
For example, the OpenEmbedded build system might not be For example, the OpenEmbedded build system might not be
@@ -8279,17 +8287,20 @@ Some notes from Cal:
Patches to fix any issues identified are most welcome Patches to fix any issues identified are most welcome
as these issues occasionally do occur. as these issues occasionally do occur.
</note></para> </note></para>
<para>For such cases, you can use some tools to help you <para>For such cases, you can use some tools to help you
sort out the situation: sort out the situation:
<itemizedlist> <itemizedlist>
<listitem><para><emphasis><filename>sstate-diff-machines.sh</filename>:</emphasis> <listitem><para>
<emphasis><filename>sstate-diff-machines.sh</filename>:</emphasis>
You can find this tool in the You can find this tool in the
<filename>scripts</filename> directory of the <filename>scripts</filename> directory of the
Source Repositories. Source Repositories.
See the comments in the script for information on See the comments in the script for information on
how to use the tool. how to use the tool.
</para></listitem> </para></listitem>
<listitem><para><emphasis>BitBake's "-S printdiff" Option:</emphasis> <listitem><para>
<emphasis>BitBake's "-S printdiff" Option:</emphasis>
Using this option causes BitBake to try to Using this option causes BitBake to try to
establish the closest signature match it can establish the closest signature match it can
(e.g. in the shared state cache) and then run (e.g. in the shared state cache) and then run