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

overview-manual: Updated "Source Fetching" section.

I scrubbed through this section and provided much better
explanations of the inside workings of BitBake fetching source
with building recipes.  During that, I fixed an error where
the PN variable was being used rather than the BPN variable.

(From yocto-docs rev: 5765987259ac46f140e099d8e1da2ab33f006d36)

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-05-02 09:17:22 -07:00
committed by Richard Purdie
parent b57adc5531
commit 4c813dd7a8
@@ -1083,18 +1083,17 @@
<para> <para>
The OpenEmbedded build system uses The OpenEmbedded build system uses
<ulink url='&YOCTO_DOCS_REF_URL;#bitbake-term'>BitBake</ulink> <ulink url='&YOCTO_DOCS_REF_URL;#bitbake-term'>BitBake</ulink>
to produce images. to produce images and Software Development Kits (SDKs).
You can see from the You can see from the
<link linkend='general-workflow-figure'>general workflow figure</link>, <link linkend='general-workflow-figure'>general workflow figure</link>,
the BitBake area consists of several functional areas. the BitBake area consists of several functional areas.
This section takes a closer look at each of those areas. This section takes a closer look at each of those areas.
</para> <note>
Separate documentation exists for the BitBake tool.
<para> See the
Separate documentation exists for the BitBake tool. <ulink url='&YOCTO_DOCS_BB_URL;#bitbake-user-manual'>BitBake User Manual</ulink>
See the for reference material on BitBake.
<ulink url='&YOCTO_DOCS_BB_URL;#bitbake-user-manual'>BitBake User Manual</ulink> </note>
for reference material on BitBake.
</para> </para>
<section id='source-fetching-dev-environment'> <section id='source-fetching-dev-environment'>
@@ -1111,8 +1110,8 @@
<ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-fetch'><filename>do_fetch</filename></ulink> <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-fetch'><filename>do_fetch</filename></ulink>
and and
<ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-unpack'><filename>do_unpack</filename></ulink> <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-unpack'><filename>do_unpack</filename></ulink>
tasks fetch the source files and unpack them into the work tasks fetch the source files and unpack them into the
directory. <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>.
<note> <note>
For every local file (e.g. <filename>file://</filename>) For every local file (e.g. <filename>file://</filename>)
that is part of a recipe's that is part of a recipe's
@@ -1120,14 +1119,13 @@
statement, the OpenEmbedded build system takes a statement, the OpenEmbedded build system takes a
checksum of the file for the recipe and inserts the checksum of the file for the recipe and inserts the
checksum into the signature for the checksum into the signature for the
<filename>do_fetch</filename>. <filename>do_fetch</filename> task.
If any local file has been modified, the If any local file has been modified, the
<filename>do_fetch</filename> task and all tasks that <filename>do_fetch</filename> task and all tasks that
depend on it are re-executed. depend on it are re-executed.
</note> </note>
By default, everything is accomplished in the By default, everything is accomplished in the Build
<ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>, Directory, which has a defined structure.
which has a defined structure.
For additional general information on the Build Directory, For additional general information on the Build Directory,
see the see the
"<ulink url='&YOCTO_DOCS_REF_URL;#structure-core-build'><filename>build/</filename></ulink>" "<ulink url='&YOCTO_DOCS_REF_URL;#structure-core-build'><filename>build/</filename></ulink>"
@@ -1135,54 +1133,97 @@
</para> </para>
<para> <para>
Unpacked source files are pointed to by the
<ulink url='&YOCTO_DOCS_REF_URL;#var-S'><filename>S</filename></ulink>
variable.
Each recipe has an area in the Build Directory where the Each recipe has an area in the Build Directory where the
unpacked source code resides. unpacked source code resides.
The
<ulink url='&YOCTO_DOCS_REF_URL;#var-S'><filename>S</filename></ulink>
variable points to this area for a recipe's unpacked source
code.
The name of that directory for any given recipe is defined The name of that directory for any given recipe is defined
from several different variables. from several different variables.
You can see the variables that define these directories The preceding figure and the following list describe
by looking at the figure: the Build Directory's hierarchy:
<itemizedlist> <itemizedlist>
<listitem><para> <listitem><para>
<ulink url='&YOCTO_DOCS_REF_URL;#var-TMPDIR'><filename>TMPDIR</filename></ulink>: <ulink url='&YOCTO_DOCS_REF_URL;#var-TMPDIR'><filename>TMPDIR</filename></ulink>:
The base directory where the OpenEmbedded build The base directory where the OpenEmbedded build
system performs all its work during the build. system performs all its work during the build.
The default base directory is the
<filename>tmp</filename> directory.
</para></listitem> </para></listitem>
<listitem><para> <listitem><para>
<ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_ARCH'><filename>PACKAGE_ARCH</filename></ulink>: <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_ARCH'><filename>PACKAGE_ARCH</filename></ulink>:
The architecture of the built package or packages. The architecture of the built package or packages.
Depending on the eventual destination of the
package or packages (i.e. machine architecture,
<ulink url='&YOCTO_DOCS_REF_URL;#hardware-build-system-term'>build host</ulink>,
SDK, or specific machine),
<filename>PACKAGE_ARCH</filename> varies.
See the variable's description for details.
</para></listitem> </para></listitem>
<listitem><para> <listitem><para>
<ulink url='&YOCTO_DOCS_REF_URL;#var-TARGET_OS'><filename>TARGET_OS</filename></ulink>: <ulink url='&YOCTO_DOCS_REF_URL;#var-TARGET_OS'><filename>TARGET_OS</filename></ulink>:
The operating system of the target device. The operating system of the target device.
A typical value would be "linux" (e.g.
"qemux86-poky-linux").
</para></listitem> </para></listitem>
<listitem><para> <listitem><para>
<ulink url='&YOCTO_DOCS_REF_URL;#var-PN'><filename>PN</filename></ulink>: <ulink url='&YOCTO_DOCS_REF_URL;#var-PN'><filename>PN</filename></ulink>:
The name of the built package. The name of the recipe used to build the package.
</para></listitem> This variable can have multiple meanings.
<listitem><para> However, when used in the context of input files,
<ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink>: <filename>PN</filename> represents the the name
The version of the recipe used to build the of the recipe.
package.
</para></listitem>
<listitem><para>
<ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink>:
The revision of the recipe used to build the
package.
</para></listitem> </para></listitem>
<listitem><para> <listitem><para>
<ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink>: <ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink>:
The location within <filename>TMPDIR</filename> The location where the OpenEmbedded build system
where a specific package is built. builds a recipe (i.e. does the work to create the
package).
<itemizedlist>
<listitem><para>
<ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink>:
The version of the recipe used to build the
package.
</para></listitem>
<listitem><para>
<ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink>:
The revision of the recipe used to build the
package.
</para></listitem>
</itemizedlist>
</para></listitem> </para></listitem>
<listitem><para> <listitem><para>
<ulink url='&YOCTO_DOCS_REF_URL;#var-S'><filename>S</filename></ulink>: <ulink url='&YOCTO_DOCS_REF_URL;#var-S'><filename>S</filename></ulink>:
Contains the unpacked source files for a given Contains the unpacked source files for a given
recipe. recipe.
<itemizedlist>
<listitem><para>
<ulink url='&YOCTO_DOCS_REF_URL;#var-BPN'><filename>BPN</filename></ulink>:
The name of the recipe used to build the
package.
The <filename>BPN</filename> variable is
a version of the <filename>PN</filename>
variable but with common prefixes and
suffixes removed.
</para></listitem>
<listitem><para>
<ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink>:
The version of the recipe used to build the
package.
</para></listitem>
</itemizedlist>
</para></listitem> </para></listitem>
</itemizedlist> </itemizedlist>
In the previous figure, notice that two sample
hierarchies exist: one based on package architecture (i.e.
<filename>PACKAGE_ARCH</filename>) and one based on a
machine (i.e. <filename>MACHINE</filename>).
The underlying structures are identical.
The differentiator being what the OpenEmbedded build
system is using as a build target (e.g. general
architecture, a build host, an SDK, or a specific
machine).
</para> </para>
</section> </section>