Yocto 2.4
Move OpenBMC to Yocto 2.4(rocko)
Tested: Built and verified Witherspoon and Palmetto images
Change-Id: I12057b18610d6fb0e6903c60213690301e9b0c67
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/import-layers/yocto-poky/documentation/dev-manual/dev-manual-common-tasks.xml b/import-layers/yocto-poky/documentation/dev-manual/dev-manual-common-tasks.xml
index 598f877..0081738 100644
--- a/import-layers/yocto-poky/documentation/dev-manual/dev-manual-common-tasks.xml
+++ b/import-layers/yocto-poky/documentation/dev-manual/dev-manual-common-tasks.xml
@@ -18,7 +18,8 @@
<para>
The OpenEmbedded build system supports organizing
- <link linkend='metadata'>Metadata</link> into multiple layers.
+ <ulink url='&YOCTO_DOCS_REF_URL;#metadata'>Metadata</ulink> into
+ multiple layers.
Layers allow you to isolate different types of customizations from
each other.
You might find it tempting to keep everything in one layer when
@@ -58,7 +59,7 @@
<title>Layers</title>
<para>
- The <link linkend='source-directory'>Source Directory</link>
+ The <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
contains both general layers and BSP
layers right out of the box.
You can easily identify layers that ship with a
@@ -107,7 +108,7 @@
"<ulink url='&YOCTO_DOCS_BSP_URL;#creating-a-new-bsp-layer-using-the-yocto-bsp-script'>Creating a New BSP Layer Using the yocto-bsp Script</ulink>"
section in the Yocto Project Board Support Package (BSP)
Developer's Guide and the
- "<link linkend='creating-a-general-layer-using-the-yocto-layer-script'>Creating a General Layer Using the yocto-layer Script</link>"
+ "<link linkend='creating-a-general-layer-using-the-bitbake-layers-script'>Creating a General Layer Using the <filename>bitbake-layers</filename> Script</link>"
section further down in this manual.
</para>
@@ -254,197 +255,182 @@
</section>
<section id='best-practices-to-follow-when-creating-layers'>
- <title>Best Practices to Follow When Creating Layers</title>
+ <title>Following Best Practices When Creating Layers</title>
<para>
To create layers that are easier to maintain and that will
not impact builds for other machines, you should consider the
- information in the following sections.
- </para>
-
- <section id='avoid-overlaying-entire-recipes'>
- <title>Avoid "Overlaying" Entire Recipes</title>
-
- <para>
- Avoid "overlaying" entire recipes from other layers in your
- configuration.
- In other words, do not copy an entire recipe into your
- layer and then modify it.
- Rather, use an append file (<filename>.bbappend</filename>)
- to override
- only those parts of the original recipe you need to modify.
- </para>
- </section>
-
- <section id='avoid-duplicating-include-files'>
- <title>Avoid Duplicating Include Files</title>
-
- <para>
- Avoid duplicating include files.
- Use append files (<filename>.bbappend</filename>)
- for each recipe
- that uses an include file.
- Or, if you are introducing a new recipe that requires
- the included file, use the path relative to the original
- layer directory to refer to the file.
- For example, use
- <filename>require recipes-core/</filename><replaceable>package</replaceable><filename>/</filename><replaceable>file</replaceable><filename>.inc</filename>
- instead of <filename>require </filename><replaceable>file</replaceable><filename>.inc</filename>.
- If you're finding you have to overlay the include file,
- it could indicate a deficiency in the include file in
- the layer to which it originally belongs.
- If this is the case, you should try to address that
- deficiency instead of overlaying the include file.
- For example, you could address this by getting the
- maintainer of the include file to add a variable or
- variables to make it easy to override the parts needing
- to be overridden.
- </para>
- </section>
-
- <section id='structure-your-layers'>
- <title>Structure Your Layers</title>
-
- <para>
- Proper use of overrides within append files and placement
- of machine-specific files within your layer can ensure that
- a build is not using the wrong Metadata and negatively
- impacting a build for a different machine.
- Following are some examples:
- <itemizedlist>
- <listitem><para><emphasis>Modifying Variables to Support
- a Different Machine:</emphasis>
- Suppose you have a layer named
- <filename>meta-one</filename> that adds support
- for building machine "one".
- To do so, you use an append file named
- <filename>base-files.bbappend</filename> and
- create a dependency on "foo" by altering the
- <ulink url='&YOCTO_DOCS_REF_URL;#var-DEPENDS'><filename>DEPENDS</filename></ulink>
- variable:
- <literallayout class='monospaced'>
+ information in the following list:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Avoid "Overlaying" Entire Recipes from Other Layers in Your Configuration:</emphasis>
+ In other words, do not copy an entire recipe into your
+ layer and then modify it.
+ Rather, use an append file
+ (<filename>.bbappend</filename>) to override only those
+ parts of the original recipe you need to modify.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Avoid Duplicating Include Files:</emphasis>
+ Use append files (<filename>.bbappend</filename>)
+ for each recipe that uses an include file.
+ Or, if you are introducing a new recipe that requires
+ the included file, use the path relative to the
+ original layer directory to refer to the file.
+ For example, use
+ <filename>require recipes-core/</filename><replaceable>package</replaceable><filename>/</filename><replaceable>file</replaceable><filename>.inc</filename>
+ instead of
+ <filename>require </filename><replaceable>file</replaceable><filename>.inc</filename>.
+ If you're finding you have to overlay the include file,
+ it could indicate a deficiency in the include file in
+ the layer to which it originally belongs.
+ If this is the case, you should try to address that
+ deficiency instead of overlaying the include file.
+ For example, you could address this by getting the
+ maintainer of the include file to add a variable or
+ variables to make it easy to override the parts needing
+ to be overridden.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Structure Your Layers:</emphasis>
+ Proper use of overrides within append files and
+ placement of machine-specific files within your layer
+ can ensure that a build is not using the wrong Metadata
+ and negatively impacting a build for a different
+ machine.
+ Following are some examples:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Modify Variables to Support a
+ Different Machine:</emphasis>
+ Suppose you have a layer named
+ <filename>meta-one</filename> that adds support
+ for building machine "one".
+ To do so, you use an append file named
+ <filename>base-files.bbappend</filename> and
+ create a dependency on "foo" by altering the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DEPENDS'><filename>DEPENDS</filename></ulink>
+ variable:
+ <literallayout class='monospaced'>
DEPENDS = "foo"
- </literallayout>
- The dependency is created during any build that
- includes the layer
- <filename>meta-one</filename>.
- However, you might not want this dependency
- for all machines.
- For example, suppose you are building for
- machine "two" but your
- <filename>bblayers.conf</filename> file has the
- <filename>meta-one</filename> layer included.
- During the build, the
- <filename>base-files</filename> for machine
- "two" will also have the dependency on
- <filename>foo</filename>.</para>
- <para>To make sure your changes apply only when
- building machine "one", use a machine override
- with the <filename>DEPENDS</filename> statement:
- <literallayout class='monospaced'>
+ </literallayout>
+ The dependency is created during any build that
+ includes the layer
+ <filename>meta-one</filename>.
+ However, you might not want this dependency
+ for all machines.
+ For example, suppose you are building for
+ machine "two" but your
+ <filename>bblayers.conf</filename> file has the
+ <filename>meta-one</filename> layer included.
+ During the build, the
+ <filename>base-files</filename> for machine
+ "two" will also have the dependency on
+ <filename>foo</filename>.</para>
+ <para>To make sure your changes apply only when
+ building machine "one", use a machine override
+ with the <filename>DEPENDS</filename> statement:
+ <literallayout class='monospaced'>
DEPENDS_one = "foo"
- </literallayout>
- You should follow the same strategy when using
- <filename>_append</filename> and
- <filename>_prepend</filename> operations:
- <literallayout class='monospaced'>
+ </literallayout>
+ You should follow the same strategy when using
+ <filename>_append</filename> and
+ <filename>_prepend</filename> operations:
+ <literallayout class='monospaced'>
DEPENDS_append_one = " foo"
DEPENDS_prepend_one = "foo "
- </literallayout>
- As an actual example, here's a line from the recipe
- for gnutls, which adds dependencies on
- "argp-standalone" when building with the musl C
- library:
- <literallayout class='monospaced'>
+ </literallayout>
+ As an actual example, here's a line from the recipe
+ for gnutls, which adds dependencies on
+ "argp-standalone" when building with the musl C
+ library:
+ <literallayout class='monospaced'>
DEPENDS_append_libc-musl = " argp-standalone"
- </literallayout>
- <note>
- Avoiding "+=" and "=+" and using
- machine-specific
- <filename>_append</filename>
- and <filename>_prepend</filename> operations
- is recommended as well.
- </note></para></listitem>
- <listitem><para><emphasis>Place Machine-Specific Files
- in Machine-Specific Locations:</emphasis>
- When you have a base recipe, such as
- <filename>base-files.bb</filename>, that
- contains a
- <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
- statement to a file, you can use an append file
- to cause the build to use your own version of
- the file.
- For example, an append file in your layer at
- <filename>meta-one/recipes-core/base-files/base-files.bbappend</filename>
- could extend
- <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESPATH'><filename>FILESPATH</filename></ulink>
- using
- <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></ulink>
- as follows:
- <literallayout class='monospaced'>
+ </literallayout>
+ <note>
+ Avoiding "+=" and "=+" and using
+ machine-specific
+ <filename>_append</filename>
+ and <filename>_prepend</filename> operations
+ is recommended as well.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Place Machine-Specific Files in
+ Machine-Specific Locations:</emphasis>
+ When you have a base recipe, such as
+ <filename>base-files.bb</filename>, that
+ contains a
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+ statement to a file, you can use an append file
+ to cause the build to use your own version of
+ the file.
+ For example, an append file in your layer at
+ <filename>meta-one/recipes-core/base-files/base-files.bbappend</filename>
+ could extend
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESPATH'><filename>FILESPATH</filename></ulink>
+ using
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></ulink>
+ as follows:
+ <literallayout class='monospaced'>
FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
- </literallayout>
- The build for machine "one" will pick up your
- machine-specific file as long as you have the
- file in
- <filename>meta-one/recipes-core/base-files/base-files/</filename>.
- However, if you are building for a different
- machine and the
- <filename>bblayers.conf</filename> file includes
- the <filename>meta-one</filename> layer and
- the location of your machine-specific file is
- the first location where that file is found
- according to <filename>FILESPATH</filename>,
- builds for all machines will also use that
- machine-specific file.</para>
- <para>You can make sure that a machine-specific
- file is used for a particular machine by putting
- the file in a subdirectory specific to the
- machine.
- For example, rather than placing the file in
- <filename>meta-one/recipes-core/base-files/base-files/</filename>
- as shown above, put it in
- <filename>meta-one/recipes-core/base-files/base-files/one/</filename>.
- Not only does this make sure the file is used
- only when building for machine "one", but the
- build process locates the file more quickly.</para>
- <para>In summary, you need to place all files
- referenced from <filename>SRC_URI</filename>
- in a machine-specific subdirectory within the
- layer in order to restrict those files to
- machine-specific builds.</para></listitem>
- </itemizedlist>
- </para>
- </section>
-
- <section id='other-recommendations'>
- <title>Other Recommendations</title>
-
- <para>
- We also recommend the following:
- <itemizedlist>
- <listitem><para>If you want permission to use the
- Yocto Project Compatibility logo with your layer
- or application that uses your layer, perform the
- steps to apply for compatibility.
- See the
- "<link linkend='making-sure-your-layer-is-compatible-with-yocto-project'>Making Sure Your Layer is Compatible With Yocto Project</link>"
- section for more information.
- </para></listitem>
- <listitem><para>Store custom layers in a Git repository
- that uses the
- <filename>meta-<replaceable>layer_name</replaceable></filename> format.
- </para></listitem>
- <listitem><para>Clone the repository alongside other
- <filename>meta</filename> directories in the
- <link linkend='source-directory'>Source Directory</link>.
- </para></listitem>
- </itemizedlist>
- Following these recommendations keeps your Source Directory and
- its configuration entirely inside the Yocto Project's core
- base.
- </para>
- </section>
+ </literallayout>
+ The build for machine "one" will pick up your
+ machine-specific file as long as you have the
+ file in
+ <filename>meta-one/recipes-core/base-files/base-files/</filename>.
+ However, if you are building for a different
+ machine and the
+ <filename>bblayers.conf</filename> file includes
+ the <filename>meta-one</filename> layer and
+ the location of your machine-specific file is
+ the first location where that file is found
+ according to <filename>FILESPATH</filename>,
+ builds for all machines will also use that
+ machine-specific file.</para>
+ <para>You can make sure that a machine-specific
+ file is used for a particular machine by putting
+ the file in a subdirectory specific to the
+ machine.
+ For example, rather than placing the file in
+ <filename>meta-one/recipes-core/base-files/base-files/</filename>
+ as shown above, put it in
+ <filename>meta-one/recipes-core/base-files/base-files/one/</filename>.
+ Not only does this make sure the file is used
+ only when building for machine "one", but the
+ build process locates the file more quickly.</para>
+ <para>In summary, you need to place all files
+ referenced from <filename>SRC_URI</filename>
+ in a machine-specific subdirectory within the
+ layer in order to restrict those files to
+ machine-specific builds.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Perform Steps to Apply for Yocto Project Compatibility:</emphasis>
+ If you want permission to use the
+ Yocto Project Compatibility logo with your layer
+ or application that uses your layer, perform the
+ steps to apply for compatibility.
+ See the
+ "<link linkend='making-sure-your-layer-is-compatible-with-yocto-project'>Making Sure Your Layer is Compatible With Yocto Project</link>"
+ section for more information.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Follow the Layer Naming Convention:</emphasis>
+ Store custom layers in a Git repository that use the
+ <filename>meta-<replaceable>layer_name</replaceable></filename>
+ format.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Group Your Layers Locally:</emphasis>
+ Clone your repository alongside other cloned
+ <filename>meta</filename> directories from the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>.
+ </para></listitem>
+ </itemizedlist>
+ </para>
</section>
<section id='making-sure-your-layer-is-compatible-with-yocto-project'>
@@ -456,65 +442,74 @@
existing Yocto Project layers (i.e. the layer is compatible
with the Yocto Project).
Ensuring compatibility makes the layer easy to be consumed
- by others in the Yocto Project community and allows you
- permission to use the Yocto Project Compatibility logo.
- </para>
-
- <para>
- Version 1.0 of the Yocto Project Compatibility Program has
- been in existence for a number of releases.
- This version of the program consists of the layer application
- process that requests permission to use the Yocto Project
- Compatibility logo for your layer and application.
- You can find version 1.0 of the form at
- <ulink url='https://www.yoctoproject.org/webform/yocto-project-compatible-registration'></ulink>.
- To be granted permission to use the logo, you need to be able
- to answer "Yes" to the questions or have an acceptable
- explanation for any questions answered "No".
- </para>
-
- <para>
- A second version (2.0) of the Yocto Project Compatibility
- Program is currently under development.
- Included as part of version 2.0 (and currently available) is
- the <filename>yocto-compat-layer.py</filename> script.
- When run against a layer, this script tests the layer against
- tighter constraints based on experiences of how layers have
- worked in the real world and where pitfalls have been found.
- </para>
-
- <para>
- Part of the 2.0 version of the program that is not currently
- available but is in development is an updated compatibility
- application form.
- This updated form, among other questions, specifically
- asks if your layer has passed the test using the
- <filename>yocto-compat-layer.py</filename> script.
- <note><title>Tip</title>
- Even though the updated application form is currently
- unavailable for version 2.0 of the Yocto Project
- Compatibility Program, the
- <filename>yocto-compat-layer.py</filename> script is
- available in OE-Core.
- You can use the script to assess the status of your
- layers in advance of the 2.0 release of the program.
+ by others in the Yocto Project community and could allow you
+ permission to use the Yocto Project Compatible Logo.
+ <note>
+ Only Yocto Project member organizations are permitted to
+ use the Yocto Project Compatible Logo.
+ The logo is not available for general use.
+ For information on how to become a Yocto Project member
+ organization, see the
+ <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink>.
</note>
</para>
<para>
- The remainder of this section presents information on the
- version 1.0 registration form and on the
- <filename>yocto-compat-layer.py</filename> script.
+ The Yocto Project Compatibility Program consists of a layer
+ application process that requests permission to use the Yocto
+ Project Compatibility Logo for your layer and application.
+ The process consists of two parts:
+ <orderedlist>
+ <listitem><para>
+ Successfully passing a script
+ (<filename>yocto-check-layer</filename>) that
+ when run against your layer, tests it against
+ constraints based on experiences of how layers have
+ worked in the real world and where pitfalls have been
+ found.
+ Getting a "PASS" result from the script is required for
+ successful compatibility registration.
+ </para></listitem>
+ <listitem><para>
+ Completion of an application acceptance form, which
+ you can find at
+ <ulink url='https://www.yoctoproject.org/webform/yocto-project-compatible-registration'></ulink>.
+ </para></listitem>
+ </orderedlist>
</para>
- <section id='yocto-project-compatibility-program-application'>
- <title>Yocto Project Compatibility Program Application</title>
+ <para>
+ To be granted permission to use the logo, you need to satisfy
+ the following:
+ <itemizedlist>
+ <listitem><para>
+ Be able to check the box indicating that you
+ got a "PASS" when running the script against your
+ layer.
+ </para></listitem>
+ <listitem><para>
+ Answer "Yes" to the questions on the form or have an
+ acceptable explanation for any questions answered "No".
+ </para></listitem>
+ <listitem><para>
+ You need to be a Yocto Project Member Organization.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ The remainder of this section presents information on the
+ registration form and on the
+ <filename>yocto-check-layer</filename> script.
+ </para>
+
+ <section id='yocto-project-compatible-program-application'>
+ <title>Yocto Project Compatible Program Application</title>
<para>
- Use the 1.0 version of the form to apply for your
- layer's compatibility approval.
+ Use the form to apply for your layer's approval.
Upon successful application, you can use the Yocto
- Project Compatibility logo with your layer and the
+ Project Compatibility Logo with your layer and the
application that uses your layer.
</para>
@@ -552,26 +547,18 @@
</para>
</section>
- <section id='yocto-compat-layer-py-script'>
- <title><filename>yocto-compat-layer.py</filename> Script</title>
+ <section id='yocto-check-layer-script'>
+ <title><filename>yocto-check-layer</filename> Script</title>
<para>
- The <filename>yocto-compat-layer.py</filename> script,
- which is currently available, provides you a way to
- assess how compatible your layer is with the Yocto
- Project.
+ The <filename>yocto-check-layer</filename> script
+ provides you a way to assess how compatible your layer is
+ with the Yocto Project.
You should run this script prior to using the form to
apply for compatibility as described in the previous
section.
- <note>
- Because the script is part of the 2.0 release of the
- Yocto Project Compatibility Program, you are not
- required to successfully run your layer against it
- in order to be granted compatibility status.
- However, it is a good idea as it promotes
- well-behaved layers and gives you an idea of where your
- layer stands regarding compatibility.
- </note>
+ You need to achieve a "PASS" result in order to have
+ your application form successfully processed.
</para>
<para>
@@ -588,7 +575,7 @@
your build directory:
<literallayout class='monospaced'>
$ source oe-init-build-env
- $ yocto-compat-layer.py <replaceable>your_layer_directory</replaceable>
+ $ yocto-check-layer <replaceable>your_layer_directory</replaceable>
</literallayout>
Be sure to provide the actual directory for your layer
as part of the command.
@@ -655,7 +642,7 @@
<filename><ulink url='&YOCTO_DOCS_REF_URL;#var-BBLAYERS'>BBLAYERS</ulink></filename>
variable in your <filename>conf/bblayers.conf</filename> file,
which is found in the
- <link linkend='build-directory'>Build Directory</link>.
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>.
The following example shows how to enable a layer named
<filename>meta-mylayer</filename>:
<literallayout class='monospaced'>
@@ -736,7 +723,7 @@
<para>
As an example, consider the main formfactor recipe and a
corresponding formfactor append file both from the
- <link linkend='source-directory'>Source Directory</link>.
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>.
Here is the main formfactor recipe, which is named
<filename>formfactor_0.0.bb</filename> and located in the
"meta" layer at
@@ -975,128 +962,163 @@
...
EXTRA_OECONF = "--enable-something --enable-somethingelse"
...
- </literallayout></para></listitem>
- </itemizedlist></para></listitem>
+ </literallayout>
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>layerindex-fetch</filename>:</emphasis>
+ Fetches a layer from a layer index, along with its
+ dependent layers, and adds the layers to the
+ <filename>conf/bblayers.conf</filename> file.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>layerindex-show-depends</filename>:</emphasis>
+ Finds layer dependencies from the layer index.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>create-layer</filename>:</emphasis>
+ Creates a basic layer.
+ </para></listitem>
</itemizedlist>
</para>
</section>
- <section id='creating-a-general-layer-using-the-yocto-layer-script'>
- <title>Creating a General Layer Using the yocto-layer Script</title>
+ <section id='creating-a-general-layer-using-the-bitbake-layers-script'>
+ <title>Creating a General Layer Using the <filename>bitbake-layers</filename> Script</title>
<para>
- The <filename>yocto-layer</filename> script simplifies
+ The <filename>bitbake-layers</filename> script with the
+ <filename>create-layer</filename> subcommand simplifies
creating a new general layer.
- <note>
- For information on BSP layers, see the
- "<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-layers'>BSP Layers</ulink>"
- section in the Yocto Project Board Specific (BSP)
- Developer's Guide.
+ <note><title>Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ For information on BSP layers, see the
+ "<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-layers'>BSP Layers</ulink>"
+ section in the Yocto Project Board Specific (BSP)
+ Developer's Guide.
+ </para></listitem>
+ <listitem><para>
+ The <filename>bitbake-layers</filename> script
+ replaces the <filename>yocto-layer</filename>
+ script, which is deprecated in the Yocto Project
+ 2.4 release.
+ The <filename>yocto-layer</filename> script
+ continues to function as part of the 2.4 release
+ but will be removed post 2.4.
+ </para></listitem>
+ </itemizedlist>
</note>
- The default mode of the script's operation is to prompt you for
- information needed to generate the layer:
+ The default mode of the script's operation with this
+ subcommand is to create a layer with the following:
<itemizedlist>
- <listitem><para>The layer priority.
+ <listitem><para>A layer priority of 6.
</para></listitem>
- <listitem><para>Whether or not to create a sample recipe.
+ <listitem><para>A <filename>conf</filename>
+ subdirectory that contains a
+ <filename>layer.conf</filename> file.
</para></listitem>
- <listitem><para>Whether or not to create a sample
- append file.
+ <listitem><para>
+ A <filename>recipes-example</filename> subdirectory
+ that contains a further subdirectory named
+ <filename>example</filename>, which contains
+ an <filename>example.bb</filename> recipe file.
+ </para></listitem>
+ <listitem><para>A <filename >COPYING.MIT</filename>,
+ which is the license statement for the layer.
+ The script assumes you want to use the MIT license,
+ which is typical for most layers, for the contents of
+ the layer itself.
+ </para></listitem>
+ <listitem><para>
+ A <filename>README</filename> file, which is a file
+ describing the contents of your new layer.
</para></listitem>
</itemizedlist>
</para>
<para>
- Use the <filename>yocto-layer create</filename> sub-command
- to create a new general layer.
- In its simplest form, you can create a layer as follows:
+ In its simplest form, you can use the following command form
+ to create a layer.
+ The command creates a layer whose name corresponds to
+ <replaceable>your_layer_name</replaceable> in the current
+ directory:
<literallayout class='monospaced'>
- $ yocto-layer create mylayer
+ $ bitbake-layers create-layer <replaceable>your_layer_name</replaceable>
</literallayout>
- The previous example creates a layer named
- <filename>meta-mylayer</filename> in the current directory.
</para>
<para>
- As the <filename>yocto-layer create</filename> command runs,
- default values for the prompts appear in brackets.
- Pressing enter without supplying anything for the prompts
- or pressing enter and providing an invalid response causes the
- script to accept the default value.
- Once the script completes, the new layer
- is created in the current working directory.
- The script names the layer by prepending
- <filename>meta-</filename> to the name you provide.
+ If you want to set the priority of the layer to other than the
+ default value of "6", you can either use the
+ <filename>‐‐priority</filename> option or you can
+ edit the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-BBFILE_PRIORITY'><filename>BBFILE_PRIORITY</filename></ulink>
+ value in the <filename>conf/layer.conf</filename> after the
+ script creates it.
+ Furthermore, if you want to give the example recipe file
+ some name other than the default, you can
+ use the
+ <filename>‐‐example-recipe-name</filename> option.
</para>
<para>
- Minimally, the script creates the following within the layer:
- <itemizedlist>
- <listitem><para><emphasis>The <filename>conf</filename>
- directory:</emphasis>
- This directory contains the layer's configuration file.
- The root name for the file is the same as the root name
- your provided for the layer (e.g.
- <filename><replaceable>layer</replaceable>.conf</filename>).
- </para></listitem>
- <listitem><para><emphasis>The
- <filename>COPYING.MIT</filename> file:</emphasis>
- The copyright and use notice for the software.
- </para></listitem>
- <listitem><para><emphasis>The <filename>README</filename>
- file:</emphasis>
- A file describing the contents of your new layer.
- </para></listitem>
- </itemizedlist>
- </para>
-
- <para>
- If you choose to generate a sample recipe file, the script
- prompts you for the name for the recipe and then creates it
- in <filename><replaceable>layer</replaceable>/recipes-example/example/</filename>.
- The script creates a <filename>.bb</filename> file and a
- directory, which contains a sample
- <filename>helloworld.c</filename> source file, along with
- a sample patch file.
- If you do not provide a recipe name, the script uses
- "example".
- </para>
-
- <para>
- If you choose to generate a sample append file, the script
- prompts you for the name for the file and then creates it
- in <filename><replaceable>layer</replaceable>/recipes-example-bbappend/example-bbappend/</filename>.
- The script creates a <filename>.bbappend</filename> file and a
- directory, which contains a sample patch file.
- If you do not provide a recipe name, the script uses
- "example".
- The script also prompts you for the version of the append file.
- The version should match the recipe to which the append file
- is associated.
- </para>
-
- <para>
- The easiest way to see how the <filename>yocto-layer</filename>
- script works is to experiment with the script.
+ The easiest way to see how the
+ <filename>bitbake-layers create-layer</filename> command
+ works is to experiment with the script.
You can also read the usage information by entering the
following:
<literallayout class='monospaced'>
- $ yocto-layer help
+ $ bitbake-layers create-layer --help
+ NOTE: Starting bitbake server...
+ usage: bitbake-layers create-layer [-h] [--priority PRIORITY]
+ [--example-recipe-name EXAMPLERECIPE]
+ layerdir
+
+ Create a basic layer
+
+ positional arguments:
+ layerdir Layer directory to create
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --priority PRIORITY, -p PRIORITY
+ Layer directory to create
+ --example-recipe-name EXAMPLERECIPE, -e EXAMPLERECIPE
+ Filename of the example recipe
</literallayout>
</para>
<para>
Once you create your general layer, you must add it to your
<filename>bblayers.conf</filename> file.
- Here is an example where a layer named
- <filename>meta-mylayer</filename> is added:
+ You can add your layer by using the
+ <filename>bitbake-layers add-layer</filename> command:
<literallayout class='monospaced'>
- BBLAYERS = ?" \
- /usr/local/src/yocto/meta \
- /usr/local/src/yocto/meta-poky \
- /usr/local/src/yocto/meta-yocto-bsp \
- /usr/local/src/yocto/meta-mylayer \
- "
+ $ bitbake-layers add-layer <replaceable>your_layer_name</replaceable>
+ </literallayout>
+ Here is an example where a layer named
+ <filename>meta-scottrif</filename> is added and then the
+ layers are shown using the
+ <filename>bitbake-layers show-layers</filename> command:
+ <literallayout class='monospaced'>
+ $ bitbake-layers add-layer meta-scottrif
+ NOTE: Starting bitbake server...
+ Loading cache: 100% |############################################| Time: 0:00:00
+ Loaded 1275 entries from dependency cache.
+ Parsing recipes: 100% |##########################################| Time: 0:00:00
+ Parsing of 819 .bb files complete (817 cached, 2 parsed). 1276 targets, 44 skipped, 0 masked, 0 errors.
+ $ bitbake-layers show-layers
+ NOTE: Starting bitbake server...
+ layer path priority
+ ==========================================================================
+ meta /home/scottrif/poky/meta 5
+ meta-poky /home/scottrif/poky/meta-poky 5
+ meta-yocto-bsp /home/scottrif/poky/meta-yocto-bsp 5
+ meta-mylayer /home/scottrif/meta-mylayer 6
+ workspace /home/scottrif/poky/build/workspace 99
+ meta-scottrif /home/scottrif/poky/build/meta-scottrif 6
</literallayout>
Adding the layer to this file enables the build system to
locate the layer during the build.
@@ -1193,7 +1215,7 @@
from within a recipe and using
<filename>EXTRA_IMAGE_FEATURES</filename> from within
your <filename>local.conf</filename> file, which is found in the
- <link linkend='build-directory'>Build Directory</link>.
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>.
</para>
<para>
@@ -1496,6 +1518,11 @@
similar in function to the recipe you need.
</para></listitem>
</itemizedlist>
+ <note>
+ For information on recipe syntax, see the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#recipe-syntax'>Recipe Syntax</ulink>"
+ section in the Yocto Project Reference Manual.
+ </note>
</para>
<section id='new-recipe-creating-the-base-recipe-using-devtool'>
@@ -1516,8 +1543,9 @@
<para>
You can find a complete description of the
<filename>devtool add</filename> command in the
- "<link linkend='use-devtool-to-integrate-new-code'>Use <filename>devtool add</filename> to Add an Application</link>"
- section.
+ "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-a-closer-look-at-devtool-add'>A Closer Look at <filename>devtool</filename> add</ulink>"
+ section in the Yocto Project Application Development
+ and the Extensible Software Development Kit (eSDK) manual.
</para>
</section>
@@ -1540,12 +1568,10 @@
<para>
To run the tool, you just need to be in your
- <link linkend='build-directory'>Build Directory</link>
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
and have sourced the build environment setup script
(i.e.
- <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>oe-init-build-env</filename></ulink>
- or
- <ulink url='&YOCTO_DOCS_REF_URL;#structure-memres-core-script'><filename>oe-init-build-env-memres</filename></ulink>).
+ <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>oe-init-build-env</filename></ulink>).
Here is the basic <filename>recipetool</filename> syntax:
<note>
Running <filename>recipetool -h</filename> or
@@ -1715,303 +1741,6 @@
</itemizedlist>
</section>
- <section id='understanding-recipe-syntax'>
- <title>Understanding Recipe Syntax</title>
-
- <para>
- Understanding recipe file syntax is important for
- writing recipes.
- The following list overviews the basic items that make up a
- BitBake recipe file.
- For more complete BitBake syntax descriptions, see the
- "<ulink url='&YOCTO_DOCS_BB_URL;#bitbake-user-manual-metadata'>Syntax and Operators</ulink>"
- chapter of the BitBake User Manual.
- <itemizedlist>
- <listitem><para><emphasis>Variable Assignments and Manipulations:</emphasis>
- Variable assignments allow a value to be assigned to a
- variable.
- The assignment can be static text or might include
- the contents of other variables.
- In addition to the assignment, appending and prepending
- operations are also supported.</para>
- <para>The following example shows some of the ways
- you can use variables in recipes:
- <literallayout class='monospaced'>
- S = "${WORKDIR}/postfix-${PV}"
- CFLAGS += "-DNO_ASM"
- SRC_URI_append = " file://fixup.patch"
- </literallayout>
- </para></listitem>
- <listitem><para><emphasis>Functions:</emphasis>
- Functions provide a series of actions to be performed.
- You usually use functions to override the default
- implementation of a task function or to complement
- a default function (i.e. append or prepend to an
- existing function).
- Standard functions use <filename>sh</filename> shell
- syntax, although access to OpenEmbedded variables and
- internal methods are also available.</para>
- <para>The following is an example function from the
- <filename>sed</filename> recipe:
- <literallayout class='monospaced'>
- do_install () {
- autotools_do_install
- install -d ${D}${base_bindir}
- mv ${D}${bindir}/sed ${D}${base_bindir}/sed
- rmdir ${D}${bindir}/
- }
- </literallayout>
- It is also possible to implement new functions that
- are called between existing tasks as long as the
- new functions are not replacing or complementing the
- default functions.
- You can implement functions in Python
- instead of shell.
- Both of these options are not seen in the majority of
- recipes.</para></listitem>
- <listitem><para><emphasis>Keywords:</emphasis>
- BitBake recipes use only a few keywords.
- You use keywords to include common
- functions (<filename>inherit</filename>), load parts
- of a recipe from other files
- (<filename>include</filename> and
- <filename>require</filename>) and export variables
- to the environment (<filename>export</filename>).</para>
- <para>The following example shows the use of some of
- these keywords:
- <literallayout class='monospaced'>
- export POSTCONF = "${STAGING_BINDIR}/postconf"
- inherit autoconf
- require otherfile.inc
- </literallayout>
- </para></listitem>
- <listitem><para><emphasis>Comments:</emphasis>
- Any lines that begin with the hash character
- (<filename>#</filename>) are treated as comment lines
- and are ignored:
- <literallayout class='monospaced'>
- # This is a comment
- </literallayout>
- </para></listitem>
- </itemizedlist>
- </para>
-
- <para>
- This next list summarizes the most important and most commonly
- used parts of the recipe syntax.
- For more information on these parts of the syntax, you can
- reference the
- <ulink url='&YOCTO_DOCS_BB_URL;#bitbake-user-manual-metadata'>Syntax and Operators</ulink>
- chapter in the BitBake User Manual.
- <itemizedlist>
- <listitem><para><emphasis>Line Continuation: <filename>\</filename></emphasis> -
- Use the backward slash (<filename>\</filename>)
- character to split a statement over multiple lines.
- Place the slash character at the end of the line that
- is to be continued on the next line:
- <literallayout class='monospaced'>
- VAR = "A really long \
- line"
- </literallayout>
- <note>
- You cannot have any characters including spaces
- or tabs after the slash character.
- </note>
- </para></listitem>
- <listitem><para>
- <emphasis>Using Variables: <filename>${...}</filename></emphasis> -
- Use the <filename>${<replaceable>VARNAME</replaceable>}</filename> syntax to
- access the contents of a variable:
- <literallayout class='monospaced'>
- SRC_URI = "${SOURCEFORGE_MIRROR}/libpng/zlib-${PV}.tar.gz"
- </literallayout>
- <note>
- It is important to understand that the value of a
- variable expressed in this form does not get
- substituted automatically.
- The expansion of these expressions happens
- on-demand later (e.g. usually when a function that
- makes reference to the variable executes).
- This behavior ensures that the values are most
- appropriate for the context in which they are
- finally used.
- On the rare occasion that you do need the variable
- expression to be expanded immediately, you can use
- the <filename>:=</filename> operator instead of
- <filename>=</filename> when you make the
- assignment, but this is not generally needed.
- </note>
- </para></listitem>
- <listitem><para><emphasis>Quote All Assignments: <filename>"<replaceable>value</replaceable>"</filename></emphasis> -
- Use double quotes around the value in all variable
- assignments.
- <literallayout class='monospaced'>
- VAR1 = "${OTHERVAR}"
- VAR2 = "The version is ${PV}"
- </literallayout>
- </para></listitem>
- <listitem><para><emphasis>Conditional Assignment: <filename>?=</filename></emphasis> -
- Conditional assignment is used to assign a value to
- a variable, but only when the variable is currently
- unset.
- Use the question mark followed by the equal sign
- (<filename>?=</filename>) to make a "soft" assignment
- used for conditional assignment.
- Typically, "soft" assignments are used in the
- <filename>local.conf</filename> file for variables
- that are allowed to come through from the external
- environment.
- </para>
- <para>Here is an example where
- <filename>VAR1</filename> is set to "New value" if
- it is currently empty.
- However, if <filename>VAR1</filename> has already been
- set, it remains unchanged:
- <literallayout class='monospaced'>
- VAR1 ?= "New value"
- </literallayout>
- In this next example, <filename>VAR1</filename>
- is left with the value "Original value":
- <literallayout class='monospaced'>
- VAR1 = "Original value"
- VAR1 ?= "New value"
- </literallayout>
- </para></listitem>
- <listitem><para><emphasis>Appending: <filename>+=</filename></emphasis> -
- Use the plus character followed by the equals sign
- (<filename>+=</filename>) to append values to existing
- variables.
- <note>
- This operator adds a space between the existing
- content of the variable and the new content.
- </note></para>
- <para>Here is an example:
- <literallayout class='monospaced'>
- SRC_URI += "file://fix-makefile.patch"
- </literallayout>
- </para></listitem>
- <listitem><para><emphasis>Prepending: <filename>=+</filename></emphasis> -
- Use the equals sign followed by the plus character
- (<filename>=+</filename>) to prepend values to existing
- variables.
- <note>
- This operator adds a space between the new content
- and the existing content of the variable.
- </note></para>
- <para>Here is an example:
- <literallayout class='monospaced'>
- VAR =+ "Starts"
- </literallayout>
- </para></listitem>
- <listitem><para><emphasis>Appending: <filename>_append</filename></emphasis> -
- Use the <filename>_append</filename> operator to
- append values to existing variables.
- This operator does not add any additional space.
- Also, the operator is applied after all the
- <filename>+=</filename>, and
- <filename>=+</filename> operators have been applied and
- after all <filename>=</filename> assignments have
- occurred.
- </para>
- <para>The following example shows the space being
- explicitly added to the start to ensure the appended
- value is not merged with the existing value:
- <literallayout class='monospaced'>
- SRC_URI_append = " file://fix-makefile.patch"
- </literallayout>
- You can also use the <filename>_append</filename>
- operator with overrides, which results in the actions
- only being performed for the specified target or
- machine:
- <literallayout class='monospaced'>
- SRC_URI_append_sh4 = " file://fix-makefile.patch"
- </literallayout>
- </para></listitem>
- <listitem><para><emphasis>Prepending: <filename>_prepend</filename></emphasis> -
- Use the <filename>_prepend</filename> operator to
- prepend values to existing variables.
- This operator does not add any additional space.
- Also, the operator is applied after all the
- <filename>+=</filename>, and
- <filename>=+</filename> operators have been applied and
- after all <filename>=</filename> assignments have
- occurred.
- </para>
- <para>The following example shows the space being
- explicitly added to the end to ensure the prepended
- value is not merged with the existing value:
- <literallayout class='monospaced'>
- CFLAGS_prepend = "-I${S}/myincludes "
- </literallayout>
- You can also use the <filename>_prepend</filename>
- operator with overrides, which results in the actions
- only being performed for the specified target or
- machine:
- <literallayout class='monospaced'>
- CFLAGS_prepend_sh4 = "-I${S}/myincludes "
- </literallayout>
- </para></listitem>
- <listitem><para><emphasis>Overrides:</emphasis> -
- You can use overrides to set a value conditionally,
- typically based on how the recipe is being built.
- For example, to set the
- <ulink url='&YOCTO_DOCS_REF_URL;#var-KBRANCH'><filename>KBRANCH</filename></ulink>
- variable's value to "standard/base" for any target
- <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>,
- except for qemuarm where it should be set to
- "standard/arm-versatile-926ejs", you would do the
- following:
- <literallayout class='monospaced'>
- KBRANCH = "standard/base"
- KBRANCH_qemuarm = "standard/arm-versatile-926ejs"
- </literallayout>
- Overrides are also used to separate alternate values
- of a variable in other situations.
- For example, when setting variables such as
- <ulink url='&YOCTO_DOCS_REF_URL;#var-FILES'><filename>FILES</filename></ulink>
- and
- <ulink url='&YOCTO_DOCS_REF_URL;#var-RDEPENDS'><filename>RDEPENDS</filename></ulink>
- that are specific to individual packages produced by
- a recipe, you should always use an override that
- specifies the name of the package.
- </para></listitem>
- <listitem><para><emphasis>Indentation:</emphasis>
- Use spaces for indentation rather than than tabs.
- For shell functions, both currently work.
- However, it is a policy decision of the Yocto Project
- to use tabs in shell functions.
- Realize that some layers have a policy to use spaces
- for all indentation.
- </para></listitem>
- <listitem><para><emphasis>Using Python for Complex Operations: <filename>${@<replaceable>python_code</replaceable>}</filename></emphasis> -
- For more advanced processing, it is possible to use
- Python code during variable assignments (e.g.
- search and replacement on a variable).</para>
- <para>You indicate Python code using the
- <filename>${@<replaceable>python_code</replaceable>}</filename>
- syntax for the variable assignment:
- <literallayout class='monospaced'>
- SRC_URI = "ftp://ftp.info-zip.org/pub/infozip/src/zip${@d.getVar('PV',1).replace('.', '')}.tgz
- </literallayout>
- </para></listitem>
- <listitem><para><emphasis>Shell Function Syntax:</emphasis>
- Write shell functions as if you were writing a shell
- script when you describe a list of actions to take.
- You should ensure that your script works with a generic
- <filename>sh</filename> and that it does not require
- any <filename>bash</filename> or other shell-specific
- functionality.
- The same considerations apply to various system
- utilities (e.g. <filename>sed</filename>,
- <filename>grep</filename>, <filename>awk</filename>,
- and so forth) that you might wish to use.
- If in doubt, you should check with multiple
- implementations - including those from BusyBox.
- </para></listitem>
- </itemizedlist>
- </para>
- </section>
-
<section id='new-recipe-running-a-build-on-the-recipe'>
<title>Running a Build on the Recipe</title>
@@ -2023,12 +1752,10 @@
</para>
<para>
- Assuming you have sourced a build environment setup script (i.e.
- <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>
- or
- <ulink url='&YOCTO_DOCS_REF_URL;#structure-memres-core-script'><filename>oe-init-build-env-memres</filename></ulink>)
+ Assuming you have sourced the build environment setup script (i.e.
+ <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>)
and you are in the
- <link linkend='build-directory'>Build Directory</link>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>,
use BitBake to process your recipe.
All you need to provide is the
<filename><replaceable>basename</replaceable></filename> of the recipe as described
@@ -2083,8 +1810,8 @@
</para>
<para>
- You can find more information about the build process in the
- "<ulink url='&YOCTO_DOCS_REF_URL;#closer-look'>A Closer Look at the Yocto Project Development Environment</ulink>"
+ You can find more information about the build process in
+ "<ulink url='&YOCTO_DOCS_REF_URL;#ref-development-environment'>The Yocto Project Development Environment</ulink>"
chapter of the Yocto Project Reference Manual.
</para>
</section>
@@ -3074,7 +2801,7 @@
class.
See the <filename>systemd.bbclass</filename> file
located in your
- <link linkend='source-directory'>Source Directory</link>.
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>.
section for more information.
</para></listitem>
</itemizedlist>
@@ -3967,6 +3694,417 @@
</section>
</section>
+ <section id='finding-the-temporary-source-code'>
+ <title>Finding Temporary Source Code</title>
+
+ <para>
+ You might find it helpful during development to modify the
+ temporary source code used by recipes to build packages.
+ For example, suppose you are developing a patch and you need to
+ experiment a bit to figure out your solution.
+ After you have initially built the package, you can iteratively
+ tweak the source code, which is located in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>,
+ and then you can force a re-compile and quickly test your altered
+ code.
+ Once you settle on a solution, you can then preserve your changes
+ in the form of patches.
+ </para>
+
+ <para>
+ During a build, the unpacked temporary source code used by recipes
+ to build packages is available in the Build Directory as
+ defined by the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-S'><filename>S</filename></ulink>
+ variable.
+ Below is the default value for the <filename>S</filename> variable
+ as defined in the
+ <filename>meta/conf/bitbake.conf</filename> configuration file
+ in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>:
+ <literallayout class='monospaced'>
+ S = "${WORKDIR}/${BP}"
+ </literallayout>
+ You should be aware that many recipes override the
+ <filename>S</filename> variable.
+ For example, recipes that fetch their source from Git usually set
+ <filename>S</filename> to <filename>${WORKDIR}/git</filename>.
+ <note>
+ The
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-BP'><filename>BP</filename></ulink>
+ represents the base recipe name, which consists of the name
+ and version:
+ <literallayout class='monospaced'>
+ BP = "${BPN}-${PV}"
+ </literallayout>
+ </note>
+ </para>
+
+ <para>
+ The path to the work directory for the recipe
+ (<ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink>)
+ is defined as follows:
+ <literallayout class='monospaced'>
+ ${TMPDIR}/work/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR}
+ </literallayout>
+ The actual directory depends on several things:
+ <itemizedlist>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-TMPDIR'><filename>TMPDIR</filename></ulink>:
+ The top-level build output directory.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MULTIMACH_TARGET_SYS'><filename>MULTIMACH_TARGET_SYS</filename></ulink>:
+ The target system identifier.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PN'><filename>PN</filename></ulink>:
+ The recipe name.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTENDPE'><filename>EXTENDPE</filename></ulink>:
+ The epoch - (if
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PE'><filename>PE</filename></ulink>
+ is not specified, which is usually the case for most
+ recipes, then <filename>EXTENDPE</filename> is blank).
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink>:
+ The recipe version.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink>:
+ The recipe revision.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ As an example, assume a Source Directory top-level folder
+ named <filename>poky</filename>, a default Build Directory at
+ <filename>poky/build</filename>, and a
+ <filename>qemux86-poky-linux</filename> machine target
+ system.
+ Furthermore, suppose your recipe is named
+ <filename>foo_1.3.0.bb</filename>.
+ In this case, the work directory the build system uses to
+ build the package would be as follows:
+ <literallayout class='monospaced'>
+ poky/build/tmp/work/qemux86-poky-linux/foo/1.3.0-r0
+ </literallayout>
+ </para>
+ </section>
+
+ <section id="using-a-quilt-workflow">
+ <title>Using Quilt in Your Workflow</title>
+
+ <para>
+ <ulink url='http://savannah.nongnu.org/projects/quilt'>Quilt</ulink>
+ is a powerful tool that allows you to capture source code changes
+ without having a clean source tree.
+ This section outlines the typical workflow you can use to modify
+ source code, test changes, and then preserve the changes in the
+ form of a patch all using Quilt.
+ <note><title>Tip</title>
+ With regard to preserving changes to source files, if you
+ clean a recipe or have <filename>rm_work</filename> enabled,
+ the
+ <ulink url='&YOCTO_DOCS_SDK_URL;#using-devtool-in-your-sdk-workflow'><filename>devtool</filename> workflow</ulink>
+ as described in the Yocto Project Application Development
+ and the Extensible Software Development Kit (eSDK) manual
+ is a safer development flow than the flow that uses Quilt.
+ </note>
+ </para>
+
+ <para>
+ Follow these general steps:
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Find the Source Code:</emphasis>
+ Temporary source code used by the OpenEmbedded build system
+ is kept in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>.
+ See the
+ "<link linkend='finding-the-temporary-source-code'>Finding Temporary Source Code</link>"
+ section to learn how to locate the directory that has the
+ temporary source code for a particular package.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Change Your Working Directory:</emphasis>
+ You need to be in the directory that has the temporary
+ source code.
+ That directory is defined by the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-S'><filename>S</filename></ulink>
+ variable.</para></listitem>
+ <listitem><para>
+ <emphasis>Create a New Patch:</emphasis>
+ Before modifying source code, you need to create a new
+ patch.
+ To create a new patch file, use
+ <filename>quilt new</filename> as below:
+ <literallayout class='monospaced'>
+ $ quilt new my_changes.patch
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Notify Quilt and Add Files:</emphasis>
+ After creating the patch, you need to notify Quilt about
+ the files you plan to edit.
+ You notify Quilt by adding the files to the patch you
+ just created:
+ <literallayout class='monospaced'>
+ $ quilt add file1.c file2.c file3.c
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Edit the Files:</emphasis>
+ Make your changes in the source code to the files you added
+ to the patch.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Test Your Changes:</emphasis>
+ Once you have modified the source code, the easiest way to
+ test your changes is by calling the
+ <filename>do_compile</filename> task as shown in the
+ following example:
+ <literallayout class='monospaced'>
+ $ bitbake -c compile -f <replaceable>package</replaceable>
+ </literallayout>
+ The <filename>-f</filename> or <filename>--force</filename>
+ option forces the specified task to execute.
+ If you find problems with your code, you can just keep
+ editing and re-testing iteratively until things work
+ as expected.
+ <note>
+ All the modifications you make to the temporary
+ source code disappear once you run the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-clean'><filename>do_clean</filename></ulink>
+ or
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-cleanall'><filename>do_cleanall</filename></ulink>
+ tasks using BitBake (i.e.
+ <filename>bitbake -c clean <replaceable>package</replaceable></filename>
+ and
+ <filename>bitbake -c cleanall <replaceable>package</replaceable></filename>).
+ Modifications will also disappear if you use the
+ <filename>rm_work</filename> feature as described
+ in the
+ "<ulink url='&YOCTO_DOCS_QS_URL;#qs-building-images'>Building Images</ulink>"
+ section of the Yocto Project Quick Start.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Generate the Patch:</emphasis>
+ Once your changes work as expected, you need to use Quilt
+ to generate the final patch that contains all your
+ modifications.
+ <literallayout class='monospaced'>
+ $ quilt refresh
+ </literallayout>
+ At this point, the <filename>my_changes.patch</filename>
+ file has all your edits made to the
+ <filename>file1.c</filename>, <filename>file2.c</filename>,
+ and <filename>file3.c</filename> files.</para>
+
+ <para>You can find the resulting patch file in the
+ <filename>patches/</filename> subdirectory of the source
+ (<filename>S</filename>) directory.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Copy the Patch File:</emphasis>
+ For simplicity, copy the patch file into a directory
+ named <filename>files</filename>, which you can create
+ in the same directory that holds the recipe
+ (<filename>.bb</filename>) file or the append
+ (<filename>.bbappend</filename>) file.
+ Placing the patch here guarantees that the OpenEmbedded
+ build system will find the patch.
+ Next, add the patch into the
+ <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'>SRC_URI</ulink></filename>
+ of the recipe.
+ Here is an example:
+ <literallayout class='monospaced'>
+ SRC_URI += "file://my_changes.patch"
+ </literallayout>
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id="platdev-appdev-devshell">
+ <title>Using a Development Shell</title>
+
+ <para>
+ When debugging certain commands or even when just editing packages,
+ <filename>devshell</filename> can be a useful tool.
+ When you invoke <filename>devshell</filename>, all tasks up to and
+ including
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-patch'><filename>do_patch</filename></ulink>
+ are run for the specified target.
+ Then, a new terminal is opened and you are placed in
+ <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-S'><filename>S</filename></ulink><filename>}</filename>,
+ the source directory.
+ In the new terminal, all the OpenEmbedded build-related environment variables are
+ still defined so you can use commands such as <filename>configure</filename> and
+ <filename>make</filename>.
+ The commands execute just as if the OpenEmbedded build system were executing them.
+ Consequently, working this way can be helpful when debugging a build or preparing
+ software to be used with the OpenEmbedded build system.
+ </para>
+
+ <para>
+ Following is an example that uses <filename>devshell</filename> on a target named
+ <filename>matchbox-desktop</filename>:
+ <literallayout class='monospaced'>
+ $ bitbake matchbox-desktop -c devshell
+ </literallayout>
+ </para>
+
+ <para>
+ This command spawns a terminal with a shell prompt within the OpenEmbedded build environment.
+ The <ulink url='&YOCTO_DOCS_REF_URL;#var-OE_TERMINAL'><filename>OE_TERMINAL</filename></ulink>
+ variable controls what type of shell is opened.
+ </para>
+
+ <para>
+ For spawned terminals, the following occurs:
+ <itemizedlist>
+ <listitem><para>The <filename>PATH</filename> variable includes the
+ cross-toolchain.</para></listitem>
+ <listitem><para>The <filename>pkgconfig</filename> variables find the correct
+ <filename>.pc</filename> files.</para></listitem>
+ <listitem><para>The <filename>configure</filename> command finds the
+ Yocto Project site files as well as any other necessary files.</para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Within this environment, you can run configure or compile
+ commands as if they were being run by
+ the OpenEmbedded build system itself.
+ As noted earlier, the working directory also automatically changes to the
+ Source Directory (<ulink url='&YOCTO_DOCS_REF_URL;#var-S'><filename>S</filename></ulink>).
+ </para>
+
+ <para>
+ To manually run a specific task using <filename>devshell</filename>,
+ run the corresponding <filename>run.*</filename> script in
+ the
+ <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink><filename>}/temp</filename>
+ directory (e.g.,
+ <filename>run.do_configure.</filename><replaceable>pid</replaceable>).
+ If a task's script does not exist, which would be the case if the task was
+ skipped by way of the sstate cache, you can create the task by first running
+ it outside of the <filename>devshell</filename>:
+ <literallayout class='monospaced'>
+ $ bitbake -c <replaceable>task</replaceable>
+ </literallayout>
+ <note><title>Notes</title>
+ <itemizedlist>
+ <listitem><para>Execution of a task's <filename>run.*</filename>
+ script and BitBake's execution of a task are identical.
+ In other words, running the script re-runs the task
+ just as it would be run using the
+ <filename>bitbake -c</filename> command.
+ </para></listitem>
+ <listitem><para>Any <filename>run.*</filename> file that does not
+ have a <filename>.pid</filename> extension is a
+ symbolic link (symlink) to the most recent version of that
+ file.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </para>
+
+ <para>
+ Remember, that the <filename>devshell</filename> is a mechanism that allows
+ you to get into the BitBake task execution environment.
+ And as such, all commands must be called just as BitBake would call them.
+ That means you need to provide the appropriate options for
+ cross-compilation and so forth as applicable.
+ </para>
+
+ <para>
+ When you are finished using <filename>devshell</filename>, exit the shell
+ or close the terminal window.
+ </para>
+
+ <note><title>Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ It is worth remembering that when using <filename>devshell</filename>
+ you need to use the full compiler name such as <filename>arm-poky-linux-gnueabi-gcc</filename>
+ instead of just using <filename>gcc</filename>.
+ The same applies to other applications such as <filename>binutils</filename>,
+ <filename>libtool</filename> and so forth.
+ BitBake sets up environment variables such as <filename>CC</filename>
+ to assist applications, such as <filename>make</filename> to find the correct tools.
+ </para></listitem>
+ <listitem><para>
+ It is also worth noting that <filename>devshell</filename> still works over
+ X11 forwarding and similar situations.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </section>
+
+ <section id="platdev-appdev-devpyshell">
+ <title>Using a Development Python Shell</title>
+
+ <para>
+ Similar to working within a development shell as described in
+ the previous section, you can also spawn and work within an
+ interactive Python development shell.
+ When debugging certain commands or even when just editing packages,
+ <filename>devpyshell</filename> can be a useful tool.
+ When you invoke <filename>devpyshell</filename>, all tasks up to and
+ including
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-patch'><filename>do_patch</filename></ulink>
+ are run for the specified target.
+ Then a new terminal is opened.
+ Additionally, key Python objects and code are available in the same
+ way they are to BitBake tasks, in particular, the data store 'd'.
+ So, commands such as the following are useful when exploring the data
+ store and running functions:
+ <literallayout class='monospaced'>
+ pydevshell> d.getVar("STAGING_DIR", True)
+ '/media/build1/poky/build/tmp/sysroots'
+ pydevshell> d.getVar("STAGING_DIR", False)
+ '${TMPDIR}/sysroots'
+ pydevshell> d.setVar("FOO", "bar")
+ pydevshell> d.getVar("FOO", True)
+ 'bar'
+ pydevshell> d.delVar("FOO")
+ pydevshell> d.getVar("FOO", True)
+ pydevshell> bb.build.exec_func("do_unpack", d)
+ pydevshell>
+ </literallayout>
+ The commands execute just as if the OpenEmbedded build system were executing them.
+ Consequently, working this way can be helpful when debugging a build or preparing
+ software to be used with the OpenEmbedded build system.
+ </para>
+
+ <para>
+ Following is an example that uses <filename>devpyshell</filename> on a target named
+ <filename>matchbox-desktop</filename>:
+ <literallayout class='monospaced'>
+ $ bitbake matchbox-desktop -c devpyshell
+ </literallayout>
+ </para>
+
+ <para>
+ This command spawns a terminal and places you in an interactive
+ Python interpreter within the OpenEmbedded build environment.
+ The <ulink url='&YOCTO_DOCS_REF_URL;#var-OE_TERMINAL'><filename>OE_TERMINAL</filename></ulink>
+ variable controls what type of shell is opened.
+ </para>
+
+ <para>
+ When you are finished using <filename>devpyshell</filename>, you
+ can exit the shell either by using Ctrl+d or closing the terminal
+ window.
+ </para>
+ </section>
+
<section id='platdev-building-targets-with-multiple-configurations'>
<title>Building Targets with Multiple Configurations</title>
@@ -4177,7 +4315,7 @@
<para>
Several examples exist in the
<filename>meta-skeleton</filename> layer found in the
- <link linkend='source-directory'>Source Directory</link>:
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>:
<itemizedlist>
<listitem><para><filename>conf/multilib-example.conf</filename>
configuration file</para></listitem>
@@ -4203,7 +4341,7 @@
Many standard recipes are already extended and support multiple libraries.
You can check in the <filename>meta/conf/multilib.conf</filename>
configuration file in the
- <link linkend='source-directory'>Source Directory</link> to see how this is
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink> to see how this is
done using the
<ulink url='&YOCTO_DOCS_REF_URL;#var-BBCLASSEXTEND'><filename>BBCLASSEXTEND</filename></ulink>
variable.
@@ -4239,7 +4377,7 @@
combination of multiple libraries you want to build.
You accomplish this through your <filename>local.conf</filename>
configuration file in the
- <link linkend='build-directory'>Build Directory</link>.
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>.
An example configuration would be as follows:
<literallayout class='monospaced'>
MACHINE = "qemux86-64"
@@ -4315,7 +4453,7 @@
<listitem><para>A unique architecture is defined for the Multilib packages,
along with creating a unique deploy folder under
<filename>tmp/deploy/rpm</filename> in the
- <link linkend='build-directory'>Build Directory</link>.
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>.
For example, consider <filename>lib32</filename> in a
<filename>qemux86-64</filename> image.
The possible architectures in the system are "all", "qemux86_64",
@@ -4675,8 +4813,8 @@
</para>
</section>
- <section id='creating-partitioned-images'>
- <title>Creating Partitioned Images</title>
+ <section id='creating-partitioned-images-using-wic'>
+ <title>Creating Partitioned Images Using Wic</title>
<para>
Creating an image for a particular hardware target using the
@@ -4692,1124 +4830,781 @@
</para>
<para>
- You can generate partitioned images
- (<replaceable>image</replaceable><filename>.wic</filename>)
- two ways: using the OpenEmbedded build system and by running
- the OpenEmbedded Image Creator Wic directly.
- The former way is preferable as it is easier to use and understand.
+ The <filename>wic</filename> command generates partitioned
+ images from existing OpenEmbedded build artifacts.
+ Image generation is driven by partitioning commands
+ contained in an Openembedded kickstart file
+ (<filename>.wks</filename>) specified either directly on
+ the command line or as one of a selection of canned
+ kickstart files as shown with the
+ <filename>wic list images</filename> command in the
+ "<link linkend='using-a-provided-kickstart-file'>Using an Existing Kickstart File</link>"
+ section.
+ When you apply the command to a given set of build
+ artifacts, the result is an image or set of images that
+ can be directly written onto media and used on a particular
+ system.
+ <note>
+ For a kickstart file reference, see the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#openembedded-kickstart-wks-reference'>OpenEmbedded Kickstart (<filename>.wks</filename>) Reference</ulink>"
+ Chapter in the Yocto Project Reference Manual.
+ </note>
</para>
- <section id='creating-wic-images-oe'>
- <title>Creating Partitioned Images</title>
+ <para>
+ The <filename>wic</filename> command and the infrastructure
+ it is based on is by definition incomplete.
+ The purpose of the command is to allow the generation of
+ customized images, and as such, was designed to be
+ completely extensible through a plug-in interface.
+ See the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#wic-plug-ins-interface'>Wic Plug-Ins Interface</ulink>"
+ section in the Yocto Project Reference Manual for information
+ on these plug-ins.
+ </para>
+
+ <para>
+ This section provides some background information on Wic,
+ describes what you need to have in
+ place to run the tool, provides instruction on how to use
+ the Wic utility, and provides several examples.
+ </para>
+
+ <section id='wic-background'>
+ <title>Background</title>
<para>
- The OpenEmbedded build system can generate
- partitioned images the same way as it generates
- any other image type.
- To generate a partitioned image, you need to modify
- two variables.
+ This section provides some background on the Wic utility.
+ While none of this information is required to use
+ Wic, you might find it interesting.
<itemizedlist>
<listitem><para>
+ The name "Wic" is derived from OpenEmbedded
+ Image Creator (oeic).
+ The "oe" diphthong in "oeic" was promoted to the
+ letter "w", because "oeic" is both difficult to
+ remember and to pronounce.
+ </para></listitem>
+ <listitem><para>
+ Wic is loosely based on the
+ Meego Image Creator (<filename>mic</filename>)
+ framework.
+ The Wic implementation has been
+ heavily modified to make direct use of OpenEmbedded
+ build artifacts instead of package installation and
+ configuration, which are already incorporated within
+ the OpenEmbedded artifacts.
+ </para></listitem>
+ <listitem><para>
+ Wic is a completely independent
+ standalone utility that initially provides
+ easier-to-use and more flexible replacements for an
+ existing functionality in OE Core's
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-image-live'><filename>image-live</filename></ulink>
+ class and <filename>mkefidisk.sh</filename> script.
+ The difference between
+ Wic and those examples is
+ that with Wic the
+ functionality of those scripts is implemented
+ by a general-purpose partitioning language, which is
+ based on Redhat kickstart syntax.</para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='wic-requirements'>
+ <title>Requirements</title>
+
+ <para>
+ In order to use the Wic utility with the OpenEmbedded Build
+ system, your system needs to meet the following
+ requirements:
+ <itemizedlist>
+ <listitem><para>
+ The Linux distribution on your development host must
+ support the Yocto Project.
+ See the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#detailed-supported-distros'>Supported Linux Distributions</ulink>"
+ section in the Yocto Project Reference Manual for
+ the list of distributions that support the
+ Yocto Project.
+ </para></listitem>
+ <listitem><para>
+ The standard system utilities, such as
+ <filename>cp</filename>, must be installed on your
+ development host system.
+ </para></listitem>
+ <listitem><para>
+ You must have sourced the build environment
+ setup script (i.e.
+ <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>)
+ found in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>.
+ </para></listitem>
+ <listitem><para>
+ You need to have the build artifacts already
+ available, which typically means that you must
+ have already created an image using the
+ Openembedded build system (e.g.
+ <filename>core-image-minimal</filename>).
+ While it might seem redundant to generate an image
+ in order to create an image using
+ Wic, the current version of
+ Wic requires the artifacts
+ in the form generated by the OpenEmbedded build
+ system.
+ </para></listitem>
+ <listitem><para>
+ You must build several native tools, which are
+ built to run on the build system:
+ <literallayout class='monospaced'>
+ $ bitbake parted-native dosfstools-native mtools-native
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
Include "wic" as part of the
<ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></ulink>
variable.
</para></listitem>
<listitem><para>
Include the name of the
- <link linkend='openembedded-kickstart-wks-reference'>wic kickstart file</link>
+ <ulink url='&YOCTO_DOCS_REF_URL;#openembedded-kickstart-wks-reference'>wic kickstart file</ulink>
as part of the
<ulink url='&YOCTO_DOCS_REF_URL;#var-WKS_FILE'><filename>WKS_FILE</filename></ulink>
variable
</para></listitem>
</itemizedlist>
- Further steps to generate a partitioned image
- are the same as for any other image type.
- For information on image types, see the
- "<link linkend='building-images'>Building Images</link>"
- section.
</para>
</section>
- <section id='create-wic-images-wic'>
- <title>Using OpenEmbedded Image Creator Wic to Generate Partitioned Images</title>
+ <section id='wic-getting-help'>
+ <title>Getting Help</title>
<para>
- The <filename>wic</filename> command generates partitioned
- images from existing OpenEmbedded build artifacts.
- Image generation is driven by partitioning commands
- contained in an Openembedded kickstart file
- (<filename>.wks</filename>) specified either directly on
- the command line or as one of a selection of canned
- <filename>.wks</filename> files as shown with the
- <filename>wic list images</filename> command in the
- "<link linkend='using-a-provided-kickstart-file'>Using an Existing Kickstart File</link>"
- section.
- When you apply the command to a given set of build
- artifacts, the result is an image or set of images that
- can be directly written onto media and used on a particular
- system.
- </para>
-
- <para>
- The <filename>wic</filename> command and the infrastructure
- it is based on is by definition incomplete.
- The purpose of the command is to allow the generation of
- customized images, and as such, was designed to be
- completely extensible through a plug-in interface.
- See the
- "<link linkend='openembedded-kickstart-plugins'>Plug-ins</link>"
- section for information on these plug-ins.
- </para>
-
- <para>
- This section provides some background information on Wic,
- describes what you need to have in
- place to run the tool, provides instruction on how to use
- the <filename>wic</filename> utility,
- and provides several examples.
- </para>
-
- <section id='wic-background'>
- <title>Background</title>
-
- <para>
- This section provides some background on the
- <filename>wic</filename> utility.
- While none of this information is required to use
- Wic, you might find it interesting.
- <itemizedlist>
- <listitem><para>
- The name "Wic" is derived from OpenEmbedded
- Image Creator (oeic).
- The "oe" diphthong in "oeic" was promoted to the
- letter "w", because "oeic" is both difficult to
- remember and to pronounce.
- </para></listitem>
- <listitem><para>
- Wic is loosely based on the
- Meego Image Creator (<filename>mic</filename>)
- framework.
- The Wic implementation has been
- heavily modified to make direct use of OpenEmbedded
- build artifacts instead of package installation and
- configuration, which are already incorporated within
- the OpenEmbedded artifacts.
- </para></listitem>
- <listitem><para>
- Wic is a completely independent
- standalone utility that initially provides
- easier-to-use and more flexible replacements for an
- existing functionality in OE Core's
- <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-image-live'><filename>image-live</filename></ulink>
- class and <filename>mkefidisk.sh</filename> script.
- The difference between
- Wic and those examples is
- that with Wic the
- functionality of those scripts is implemented
- by a general-purpose partitioning language, which is
- based on Redhat kickstart syntax.</para></listitem>
- </itemizedlist>
- </para>
- </section>
-
- <section id='wic-requirements'>
- <title>Requirements</title>
-
- <para>
- In order to use the <filename>wic</filename> utility
- with the OpenEmbedded Build system, your system needs
- to meet the following requirements:
- <itemizedlist>
- <listitem><para>The Linux distribution on your
- development host must support the Yocto Project.
- See the
- "<ulink url='&YOCTO_DOCS_REF_URL;#detailed-supported-distros'>Supported Linux Distributions</ulink>"
- section in the Yocto Project Reference Manual for
- the list of distributions that support the
- Yocto Project.
- </para></listitem>
- <listitem><para>
- The standard system utilities, such as
- <filename>cp</filename>, must be installed on your
- development host system.
- </para></listitem>
- <listitem><para>
- You need to have the build artifacts already
- available, which typically means that you must
- have already created an image using the
- Openembedded build system (e.g.
- <filename>core-image-minimal</filename>).
- While it might seem redundant to generate an image
- in order to create an image using
- Wic, the current version of
- Wic requires the artifacts
- in the form generated by the build system.
- </para></listitem>
- <listitem><para>
- You must build several native tools, which are tools
- built to run on the build system:
- <literallayout class='monospaced'>
- $ bitbake parted-native dosfstools-native mtools-native
- </literallayout>
- </para></listitem>
- <listitem><para>
- You must have sourced one of the build environment
- setup scripts (i.e.
- <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>
- or
- <ulink url='&YOCTO_DOCS_REF_URL;#structure-memres-core-script'><filename>oe-init-build-env-memres</filename></ulink>)
- found in the
- <link linkend='build-directory'>Build Directory</link>.
- </para></listitem>
- </itemizedlist>
- </para>
- </section>
-
- <section id='wic-getting-help'>
- <title>Getting Help</title>
-
- <para>
- You can get general help for the <filename>wic</filename>
- command by entering the <filename>wic</filename> command
- by itself or by entering the command with a help argument
- as follows:
- <literallayout class='monospaced'>
+ You can get general help for the <filename>wic</filename>
+ command by entering the <filename>wic</filename> command
+ by itself or by entering the command with a help argument
+ as follows:
+ <literallayout class='monospaced'>
$ wic -h
$ wic --help
- </literallayout>
- </para>
+ </literallayout>
+ </para>
- <para>
- Currently, Wic supports two commands:
- <filename>create</filename> and <filename>list</filename>.
- You can get help for these commands as follows:
- <literallayout class='monospaced'>
+ <para>
+ Currently, Wic supports seven commands:
+ <filename>cp</filename>, <filename>create</filename>,
+ <filename>help</filename>, <filename>list</filename>,
+ <filename>ls</filename>, <filename>rm</filename>, and
+ <filename>write</filename>.
+ You can get help for these commands as follows with
+ <replaceable>command</replaceable> being one of the
+ supported commands:
+ <literallayout class='monospaced'>
$ wic help <replaceable>command</replaceable>
- with <replaceable>command</replaceable> being either
- <filename>create</filename> or <filename>list</filename>.
- </literallayout>
- </para>
+ </literallayout>
+ </para>
- <para>
- You can also get detailed help on a number of topics
- from the help system.
- The output of <filename>wic --help</filename>
- displays a list of available help
- topics under a "Help topics" heading.
- You can have the help system display the help text for
- a given topic by prefacing the topic with
- <filename>wic help</filename>:
- <literallayout class='monospaced'>
+ <para>
+ You can also get detailed help on a number of topics
+ from the help system.
+ The output of <filename>wic --help</filename>
+ displays a list of available help
+ topics under a "Help topics" heading.
+ You can have the help system display the help text for
+ a given topic by prefacing the topic with
+ <filename>wic help</filename>:
+ <literallayout class='monospaced'>
$ wic help <replaceable>help_topic</replaceable>
- </literallayout>
- </para>
+ </literallayout>
+ </para>
- <para>
- You can find out more about the images
- Wic creates using the existing
- kickstart files with the following form of the command:
- <literallayout class='monospaced'>
+ <para>
+ You can find out more about the images Wic creates using
+ the existing kickstart files with the following form of
+ the command:
+ <literallayout class='monospaced'>
$ wic list <replaceable>image</replaceable> help
- </literallayout>
- with <filename><replaceable>image</replaceable></filename>
- being either <filename>directdisk</filename> or
- <filename>mkefidisk</filename>.
- </para>
- </section>
+ </literallayout>
+ For <replaceable>image</replaceable>, you can provide
+ any of the following:
+ <literallayout class='monospaced'>
+ beaglebone
+ mpc8315e-rdb
+ genericx86
+ edgerouter
+ qemux86-directdisk
+ directdisk-gpt
+ mkefidisk
+ directdisk
+ systemd-bootdisk
+ mkhybridiso
+ sdimage-bootpart
+ directdisk-multi-rootfs
+ directdisk-bootloader-config
+ </literallayout>
+ </para>
+ </section>
- <section id='operational-modes'>
- <title>Operational Modes</title>
+ <section id='operational-modes'>
+ <title>Operational Modes</title>
+
+ <para>
+ You can use Wic in two different
+ modes, depending on how much control you need for
+ specifying the Openembedded build artifacts that are
+ used for creating the image: Raw and Cooked:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Raw Mode:</emphasis>
+ You explicitly specify build artifacts through
+ <filename>wic</filename> command-line arguments.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Cooked Mode:</emphasis>
+ The current
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
+ setting and image name are used to automatically
+ locate and provide the build artifacts.
+ You just supply a kickstart file and the name
+ of the image from which to use artifacts.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Regardless of the mode you use, you need to have the build
+ artifacts ready and available.
+ </para>
+
+ <section id='raw-mode'>
+ <title>Raw Mode</title>
<para>
- You can use Wic in two different
- modes, depending on how much control you need for
- specifying the Openembedded build artifacts that are
- used for creating the image: Raw and Cooked:
- <itemizedlist>
- <listitem><para>
- <emphasis>Raw Mode:</emphasis>
- You explicitly specify build artifacts through
- command-line arguments.
- </para></listitem>
- <listitem><para>
- <emphasis>Cooked Mode:</emphasis>
- The current
- <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
- setting and image name are used to automatically
- locate and provide the build artifacts.
- </para></listitem>
- </itemizedlist>
+ Running Wic in raw mode allows you to specify all the
+ partitions through the <filename>wic</filename>
+ command line.
+ The primary use for raw mode is if you have built
+ your kernel outside of the Yocto Project
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>.
+ In other words, you can point to arbitrary kernel,
+ root filesystem locations, and so forth.
+ Contrast this behavior with cooked mode where Wic
+ looks in the Build Directory (e.g.
+ <filename>tmp/deploy/images/</filename><replaceable>machine</replaceable>).
</para>
<para>
- Regardless of the mode you use, you need to have the build
- artifacts ready and available.
- Additionally, the environment must be set up using the
- <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>
- or
- <ulink url='&YOCTO_DOCS_REF_URL;#structure-memres-core-script'><filename>oe-init-build-env-memres</filename></ulink>
- script found in the
- <link linkend='build-directory'>Build Directory</link>.
- </para>
-
- <section id='raw-mode'>
- <title>Raw Mode</title>
-
- <para>
- The general form of the
- <filename>wic</filename> command in raw mode is:
- <literallayout class='monospaced'>
- $ wic create <replaceable>image_name</replaceable>.wks [<replaceable>options</replaceable>] [...]
+ The general form of the
+ <filename>wic</filename> command in raw mode is:
+ <literallayout class='monospaced'>
+ $ wic create <replaceable>wks_file</replaceable> <replaceable>options</replaceable> ...
Where:
- <replaceable>image_name</replaceable>.wks
+ <replaceable>wks_file</replaceable>:
An OpenEmbedded kickstart file. You can provide
your own custom file or use a file from a set of
existing files as described by further options.
- -o <replaceable>OUTDIR</replaceable>, --outdir=<replaceable>OUTDIR</replaceable>
- The name of a directory in which to create image.
+ optional arguments:
+ -h, --help show this help message and exit
+ -o <replaceable>OUTDIR</replaceable>, --outdir <replaceable>OUTDIR</replaceable>
+ name of directory to create image in
+ -e <replaceable>IMAGE_NAME</replaceable>, --image-name <replaceable>IMAGE_NAME</replaceable>
+ name of the image to use the artifacts from e.g. core-
+ image-sato
+ -r <replaceable>ROOTFS_DIR</replaceable>, --rootfs-dir <replaceable>ROOTFS_DIR</replaceable>
+ path to the /rootfs dir to use as the .wks rootfs
+ source
+ -b <replaceable>BOOTIMG_DIR</replaceable>, --bootimg-dir <replaceable>BOOTIMG_DIR</replaceable>
+ path to the dir containing the boot artifacts (e.g.
+ /EFI or /syslinux dirs) to use as the .wks bootimg
+ source
+ -k <replaceable>KERNEL_DIR</replaceable>, --kernel-dir <replaceable>KERNEL_DIR</replaceable>
+ path to the dir containing the kernel to use in the
+ .wks bootimg
+ -n <replaceable>NATIVE_SYSROOT</replaceable>, --native-sysroot <replaceable>NATIVE_SYSROOT</replaceable>
+ path to the native sysroot containing the tools to use
+ to build the image
+ -s, --skip-build-check
+ skip the build check
+ -f, --build-rootfs build rootfs
+ -c {gzip,bzip2,xz}, --compress-with {gzip,bzip2,xz}
+ compress image with specified compressor
+ -m, --bmap generate .bmap
+ --no-fstab-update Do not change fstab file.
+ -v <replaceable>VARS_DIR</replaceable>, --vars <replaceable>VARS_DIR</replaceable>
+ directory with <image>.env files that store bitbake
+ variables
+ -D, --debug output debug information
+ </literallayout>
+ <note>
+ You do not need root privileges to run
+ Wic.
+ In fact, you should not run as root when using the
+ utility.
+ </note>
+ </para>
+ </section>
- -i <replaceable>PROPERTIES_FILE</replaceable>, --infile=<replaceable>PROPERTIES_FILE</replaceable>
- The name of a file containing the values for image
- properties as a JSON file.
+ <section id='cooked-mode'>
+ <title>Cooked Mode</title>
- -e <replaceable>IMAGE_NAME</replaceable>, --image-name=<replaceable>IMAGE_NAME</replaceable>
- The name of the image from which to use the artifacts
- (e.g. <filename>core-image-sato</filename>).
+ <para>
+ Running Wic in cooked mode leverages off artifacts in
+ Build Directory.
+ In other words, you do not have to specify kernel or
+ root filesystem locations as part of the command.
+ All you need to provide is a kickstart file and the
+ name of the image from which to use artifacts by using
+ the "-e" option.
+ Wic looks in the Build Directory (e.g.
+ <filename>tmp/deploy/images/</filename><replaceable>machine</replaceable>)
+ for artifacts.
+ </para>
- -r <replaceable>ROOTFS_DIR</replaceable>, --rootfs-dir=<replaceable>ROOTFS_DIR</replaceable>
- The path to the <filename>/rootfs</filename> directory to use as the
- <filename>.wks</filename> rootfs source.
-
- -b <replaceable>BOOTIMG_DIR</replaceable>, --bootimg-dir=<replaceable>BOOTIMG_DIR</replaceable>
- The path to the directory containing the boot artifacts
- (e.g. <filename>/EFI</filename> or <filename>/syslinux</filename>) to use as the <filename>.wks</filename> bootimg
- source.
-
- -k <replaceable>KERNEL_DIR</replaceable>, --kernel-dir=<replaceable>KERNEL_DIR</replaceable>
- The path to the directory containing the kernel to use
- in the <filename>.wks</filename> boot image.
-
- -n <replaceable>NATIVE_SYSROOT</replaceable>, --native-sysroot=<replaceable>NATIVE_SYSROOT</replaceable>
- The path to the native sysroot containing the tools to use
- to build the image.
-
- -s, --skip-build-check
- Skips the build check.
-
- -D, --debug
- Output debug information.
- </literallayout>
- <note>
- You do not need root privileges to run
- Wic.
- In fact, you should not run as root when using the
- utility.
- </note>
- </para>
- </section>
-
- <section id='cooked-mode'>
- <title>Cooked Mode</title>
-
- <para>
- The general form of the <filename>wic</filename> command
- using Cooked Mode is:
- <literallayout class='monospaced'>
- $ wic create <replaceable>kickstart_file</replaceable> -e <replaceable>image_name</replaceable>
+ <para>
+ The general form of the <filename>wic</filename>
+ command using Cooked Mode is as follows:
+ <literallayout class='monospaced'>
+ $ wic create <replaceable>wks_file</replaceable> -e <replaceable>IMAGE_NAME</replaceable>
Where:
- <replaceable>kickstart_file</replaceable>
- An OpenEmbedded kickstart file. You can provide your own
- custom file or a supplied file.
+ <replaceable>wks_file</replaceable>:
+ An OpenEmbedded kickstart file. You can provide
+ your own custom file or use a file from a set of
+ existing files provided with the Yocto Project
+ release.
- <replaceable>image_name</replaceable>
- Specifies the image built using the OpenEmbedded build
- system.
- </literallayout>
- This form is the simplest and most user-friendly, as it
- does not require specifying all individual parameters.
- All you need to provide is your own
- <filename>.wks</filename> file or one provided with the
- release.
- </para>
- </section>
- </section>
-
- <section id='using-a-provided-kickstart-file'>
- <title>Using an Existing Kickstart File</title>
-
- <para>
- If you do not want to create your own
- <filename>.wks</filename> file, you can use an existing
- file provided by the Wic installation.
- Use the following command to list the available files:
- <literallayout class='monospaced'>
- $ wic list images
- directdisk Create a 'pcbios' direct disk image
- mkefidisk Create an EFI disk image
+ required argument:
+ -e <replaceable>IMAGE_NAME</replaceable>, --image-name <replaceable>IMAGE_NAME</replaceable>
+ name of the image to use the artifacts from e.g. core-
+ image-sato
</literallayout>
- When you use an existing file, you do not have to use the
- <filename>.wks</filename> extension.
- Here is an example in Raw Mode that uses the
- <filename>directdisk</filename> file:
- <literallayout class='monospaced'>
+ </para>
+ </section>
+ </section>
+
+ <section id='using-a-provided-kickstart-file'>
+ <title>Using an Existing Kickstart File</title>
+
+ <para>
+ If you do not want to create your own kickstart file, you
+ can use an existing file provided by the Wic installation.
+ As shipped, kickstart files can be found in the
+ Yocto Project
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-repositories'>Source Repositories</ulink>
+ in the following two locations:
+ <literallayout class='monospaced'>
+ poky/meta-yocto-bsp/wic
+ poky/scripts/lib/wic/canned-wks
+ </literallayout>
+ Use the following command to list the available kickstart
+ files:
+ <literallayout class='monospaced'>
+ $ wic list images
+ beaglebone Create SD card image for Beaglebone
+ mpc8315e-rdb Create SD card image for MPC8315E-RDB
+ genericx86 Create an EFI disk image for genericx86*
+ edgerouter Create SD card image for Edgerouter
+ qemux86-directdisk Create a qemu machine 'pcbios' direct disk image
+ directdisk-gpt Create a 'pcbios' direct disk image
+ mkefidisk Create an EFI disk image
+ directdisk Create a 'pcbios' direct disk image
+ systemd-bootdisk Create an EFI disk image with systemd-boot
+ mkhybridiso Create a hybrid ISO image
+ sdimage-bootpart Create SD card image with a boot partition
+ directdisk-multi-rootfs Create multi rootfs image using rootfs plugin
+ directdisk-bootloader-config Create a 'pcbios' direct disk image with custom bootloader config
+ </literallayout>
+ When you use an existing file, you do not have to use the
+ <filename>.wks</filename> extension.
+ Here is an example in Raw Mode that uses the
+ <filename>directdisk</filename> file:
+ <literallayout class='monospaced'>
$ wic create directdisk -r <replaceable>rootfs_dir</replaceable> -b <replaceable>bootimg_dir</replaceable> \
-k <replaceable>kernel_dir</replaceable> -n <replaceable>native_sysroot</replaceable>
- </literallayout>
- </para>
+ </literallayout>
+ </para>
- <para>
- Here are the actual partition language commands
- used in the <filename>mkefidisk.wks</filename> file to
- generate an image:
- <literallayout class='monospaced'>
- # short-description: Create an EFI disk image
- # long-description: Creates a partitioned EFI disk image that the user
- # can directly dd to boot media.
-
- part /boot --source bootimg-efi --ondisk sda --label msdos --active --align 1024
-
- part / --source rootfs --ondisk sda --fstype=ext3 --label platform --align 1024
-
+ <para>
+ Here are the actual partition language commands
+ used in the <filename>genericx86.wks</filename> file to
+ generate an image:
+ <literallayout class='monospaced'>
+ # short-description: Create an EFI disk image for genericx86*
+ # long-description: Creates a partitioned EFI disk image for genericx86* machines
+ part /boot --source bootimg-efi --sourceparams="loader=grub-efi" --ondisk sda --label msdos --active --align 1024
+ part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --use-uuid
part swap --ondisk sda --size 44 --label swap1 --fstype=swap
- bootloader --timeout=10 --append="rootwait rootfstype=ext3 console=ttyPCH0,115200 console=tty0 vmalloc=256MB snd-hda-intel.enable_msi=0"
- </literallayout>
- </para>
- </section>
+ bootloader --ptable gpt --timeout=5 --append="rootfstype=ext4 console=ttyS0,115200 console=tty0"
+ </literallayout>
+ </para>
+ </section>
- <section id='wic-usage-examples'>
- <title>Examples</title>
+ <section id='wic-usage-examples'>
+ <title>Examples</title>
+
+ <para>
+ This section provides several examples that show how to use
+ the Wic utility.
+ All the examples assume the list of requirements in the
+ "<link linkend='wic-requirements'>Requirements</link>"
+ section have been met.
+ The examples assume the previously generated image is
+ <filename>core-image-minimal</filename>.
+ </para>
+
+ <section id='generate-an-image-using-a-provided-kickstart-file'>
+ <title>Generate an Image using an Existing Kickstart File</title>
<para>
- This section provides several examples that show how to use
- the <filename>wic</filename> utility.
- All the examples assume the list of requirements in the
- "<link linkend='wic-requirements'>Requirements</link>"
- section have been met.
- The examples assume the previously generated image is
- <filename>core-image-minimal</filename>.
- </para>
-
- <section id='generate-an-image-using-a-provided-kickstart-file'>
- <title>Generate an Image using an Existing Kickstart File</title>
-
- <para>
- This example runs in Cooked Mode and uses the
- <filename>mkefidisk</filename> kickstart file:
- <literallayout class='monospaced'>
+ This example runs in Cooked Mode and uses the
+ <filename>mkefidisk</filename> kickstart file:
+ <literallayout class='monospaced'>
$ wic create mkefidisk -e core-image-minimal
- Checking basic build environment...
- Done.
-
- Creating image(s)...
-
- Info: The new image(s) can be found here:
- <replaceable>current_directory</replaceable>/build/mkefidisk-201310230946-sda.direct
+ INFO: Building wic-tools...
+ .
+ .
+ .
+ INFO: The new image(s) can be found here:
+ ./mkefidisk-201710061409-sda.direct
The following build artifacts were used to create the image(s):
- ROOTFS_DIR: /home/trz/yocto/yocto-image/build/tmp/work/minnow-poky-linux/core-image-minimal/1.0-r0/rootfs
- BOOTIMG_DIR: /home/trz/yocto/yocto-image/build/tmp/work/minnow-poky-linux/core-image-minimal/1.0-r0/core-image-minimal-1.0/hddimg
- KERNEL_DIR: /home/trz/yocto/yocto-image/build/tmp/sysroots/minnow/usr/src/kernel
- NATIVE_SYSROOT: /home/trz/yocto/yocto-image/build/tmp/sysroots/x86_64-linux
+ ROOTFS_DIR: /home/scottrif/poky/build/tmp.wic.r4hkds0b/rootfs_copy
+ BOOTIMG_DIR: /home/scottrif/poky/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/recipe-sysroot/usr/share
+ KERNEL_DIR: /home/scottrif/poky/build/tmp/deploy/images/qemux86
+ NATIVE_SYSROOT: /home/scottrif/poky/build/tmp/work/i586-poky-linux/wic-tools/1.0-r0/recipe-sysroot-native
- The image(s) were created using OE kickstart file:
- /home/trz/yocto/yocto-image/scripts/lib/image/canned-wks/mkefidisk.wks
- </literallayout>
- The previous example shows the easiest way to create
- an image by running in Cooked Mode and using the
- <filename>-e</filename> option with an existing
- kickstart file.
- All that is necessary is to specify the image used to
- generate the artifacts.
- Your <filename>local.conf</filename> needs to have the
- <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
- variable set to the machine you are using, which is
- "minnow" in this example.
- </para>
+ INFO: The image(s) were created using OE kickstart file:
+ /home/scottrif/poky/scripts/lib/wic/canned-wks/mkefidisk.wks
+ </literallayout>
+ The previous example shows the easiest way to create
+ an image by running in cooked mode and supplying
+ a kickstart file and the "-e" option to point to the
+ existing build artifacts.
+ Your <filename>local.conf</filename> file needs to have
+ the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
+ variable set to the machine you are using, which is
+ "qemux86" in this example.
+ </para>
- <para>
- The output specifies the exact image created as well as
- where it was created, which is in the current
- directory by default.
- The output also names the artifacts used and the exact
- <filename>.wks</filename> script that was used to
- generate the image.
- <note>
- You should always verify the details provided in the
- output to make sure that the image was indeed
- created exactly as expected.
- </note>
- </para>
+ <para>
+ Once the image builds, the output provides image
+ location, artifact use, and kickstart file information.
+ <note>
+ You should always verify the details provided in the
+ output to make sure that the image was indeed
+ created exactly as expected.
+ </note>
+ </para>
- <para>
- Continuing with the example, you can now write the
- image to a USB stick, or whatever media for which you
- built your image, and boot the resulting media.
- You can write the image by using
- <filename>bmaptool</filename> or
- <filename>dd</filename>:
- <literallayout class='monospaced'>
- $ oe-run-native bmaptool copy build/mkefidisk-201310230946-sda.direct /dev/sd<replaceable>X</replaceable>
- </literallayout>
- or
- <literallayout class='monospaced'>
- $ sudo dd if=build/mkefidisk-201310230946-sda.direct of=/dev/sd<replaceable>X</replaceable>
- </literallayout>
- <note>
- For more information on how to use the
- <filename>bmaptool</filename> to flash a device
- with an image, see the
- "<link linkend='flashing-images-using-bmaptool'>Flashing Images Using <filename>bmaptool</filename></link>"
- section.
- </note>
- </para>
- </section>
+ <para>
+ Continuing with the example, you can now write the
+ image to a USB stick, or whatever media for which you
+ built your image, and boot from the media.
+ You can write the image by using
+ <filename>bmaptool</filename> or
+ <filename>dd</filename>:
+ <literallayout class='monospaced'>
+ $ oe-run-native bmaptool copy build/mkefidisk-201710061409-sda.direct /dev/sd<replaceable>X</replaceable>
+ </literallayout>
+ or
+ <literallayout class='monospaced'>
+ $ sudo dd if=build/mkefidisk-201710061409-sda.direct of=/dev/sd<replaceable>X</replaceable>
+ </literallayout>
+ <note>
+ For more information on how to use the
+ <filename>bmaptool</filename> to flash a device
+ with an image, see the
+ "<link linkend='flashing-images-using-bmaptool'>Flashing Images Using <filename>bmaptool</filename></link>"
+ section.
+ </note>
+ </para>
+ </section>
- <section id='using-a-modified-kickstart-file'>
- <title>Using a Modified Kickstart File</title>
+ <section id='using-a-modified-kickstart-file'>
+ <title>Using a Modified Kickstart File</title>
- <para>
- Because partitioned image creation is
- driven by the kickstart file, it is easy to affect
- image creation by changing the parameters in the file.
- This next example demonstrates that through modification
- of the <filename>directdisk</filename> kickstart file.
- </para>
+ <para>
+ Because partitioned image creation is driven by the
+ kickstart file, it is easy to affect image creation by
+ changing the parameters in the file.
+ This next example demonstrates that through modification
+ of the <filename>directdisk-gpt</filename> kickstart
+ file.
+ </para>
- <para>
- As mentioned earlier, you can use the command
- <filename>wic list images</filename> to show the list
- of existing kickstart files.
- The directory in which these files reside is
- <filename>scripts/lib/image/canned-wks/</filename>
- located in the
- <link linkend='source-directory'>Source Directory</link>.
- Because the available files reside in this directory,
- you can create and add your own custom files to the
- directory.
- Subsequent use of the
- <filename>wic list images</filename> command would then
- include your kickstart files.
- </para>
+ <para>
+ As mentioned earlier, you can use the command
+ <filename>wic list images</filename> to show the list
+ of existing kickstart files.
+ The directory in which the
+ <filename>directdisk-gpt.wks</filename> file resides is
+ <filename>scripts/lib/image/canned-wks/</filename>,
+ which is located in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
+ (e.g. <filename>poky</filename>).
+ Because available files reside in this directory,
+ you can create and add your own custom files to the
+ directory.
+ Subsequent use of the
+ <filename>wic list images</filename> command would then
+ include your kickstart files.
+ </para>
- <para>
- In this example, the existing
- <filename>directdisk</filename> file already does most
- of what is needed.
- However, for the hardware in this example, the image
- will need to boot from <filename>sdb</filename> instead
- of <filename>sda</filename>, which is what the
- <filename>directdisk</filename> kickstart file uses.
- </para>
+ <para>
+ In this example, the existing
+ <filename>directdisk-gpt</filename> file already does
+ most of what is needed.
+ However, for the hardware in this example, the image
+ will need to boot from <filename>sdb</filename> instead
+ of <filename>sda</filename>, which is what the
+ <filename>directdisk-gpt</filename> kickstart file
+ uses.
+ </para>
- <para>
- The example begins by making a copy of the
- <filename>directdisk.wks</filename> file in the
- <filename>scripts/lib/image/canned-wks</filename>
- directory and then by changing the lines that specify
- the target disk from which to boot.
- <literallayout class='monospaced'>
- $ cp /home/trz/yocto/yocto-image/scripts/lib/image/canned-wks/directdisk.wks \
- /home/trz/yocto/yocto-image/scripts/lib/image/canned-wks/directdisksdb.wks
- </literallayout>
- Next, the example modifies the
- <filename>directdisksdb.wks</filename> file and changes
- all instances of "<filename>--ondisk sda</filename>"
- to "<filename>--ondisk sdb</filename>".
- The example changes the following two lines and leaves
- the remaining lines untouched:
- <literallayout class='monospaced'>
+ <para>
+ The example begins by making a copy of the
+ <filename>directdisk-gpt.wks</filename> file in the
+ <filename>scripts/lib/image/canned-wks</filename>
+ directory and then by changing the lines that specify
+ the target disk from which to boot.
+ <literallayout class='monospaced'>
+ $ cp /home/scottrif/poky/scripts/lib/wic/canned-wks/directdisk-gpt.wks \
+ /home/scottrif/poky/scripts/lib/wic/canned-wks/directdisksdb-gpt.wks
+ </literallayout>
+ Next, the example modifies the
+ <filename>directdisksdb-gpt.wks</filename> file and
+ changes all instances of
+ "<filename>--ondisk sda</filename>" to
+ "<filename>--ondisk sdb</filename>".
+ The example changes the following two lines and leaves
+ the remaining lines untouched:
+ <literallayout class='monospaced'>
part /boot --source bootimg-pcbios --ondisk sdb --label boot --active --align 1024
- part / --source rootfs --ondisk sdb --fstype=ext3 --label platform --align 1024
- </literallayout>
- Once the lines are changed, the example generates the
- <filename>directdisksdb</filename> image.
- The command points the process at the
- <filename>core-image-minimal</filename> artifacts for
- the Next Unit of Computing (nuc)
- <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
- the <filename>local.conf</filename>.
- <literallayout class='monospaced'>
- $ wic create directdisksdb -e core-image-minimal
- Checking basic build environment...
- Done.
+ part / --source rootfs --ondisk sdb --fstype=ext4 --label platform --align 1024 --use-uuid
+ </literallayout>
+ Once the lines are changed, the example generates the
+ <filename>directdisksdb-gpt</filename> image.
+ The command points the process at the
+ <filename>core-image-minimal</filename> artifacts for
+ the Next Unit of Computing (nuc)
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
+ the <filename>local.conf</filename>.
+ <literallayout class='monospaced'>
+ $ wic create directdisksdb-gpt -e core-image-minimal
+ INFO: Building wic-tools...
+ .
+ .
+ .
+ Initialising tasks: 100% |#######################################| Time: 0:00:01
+ NOTE: Executing SetScene Tasks
+ NOTE: Executing RunQueue Tasks
+ NOTE: Tasks Summary: Attempted 1161 tasks of which 1157 didn't need to be rerun and all succeeded.
+ INFO: Creating image(s)...
- Creating image(s)...
-
- Info: The new image(s) can be found here:
- <replaceable>current_directory</replaceable>/build/directdisksdb-201310231131-sdb.direct
+ INFO: The new image(s) can be found here:
+ ./directdisksdb-gpt-201710090938-sdb.direct
The following build artifacts were used to create the image(s):
+ ROOTFS_DIR: /home/scottrif/poky/build/tmp.wic.hk3wl6zn/rootfs_copy
+ BOOTIMG_DIR: /home/scottrif/poky/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/recipe-sysroot/usr/share
+ KERNEL_DIR: /home/scottrif/poky/build/tmp/deploy/images/qemux86
+ NATIVE_SYSROOT: /home/scottrif/poky/build/tmp/work/i586-poky-linux/wic-tools/1.0-r0/recipe-sysroot-native
- ROOTFS_DIR: /home/trz/yocto/yocto-image/build/tmp/work/nuc-poky-linux/core-image-minimal/1.0-r0/rootfs
- BOOTIMG_DIR: /home/trz/yocto/yocto-image/build/tmp/sysroots/nuc/usr/share
- KERNEL_DIR: /home/trz/yocto/yocto-image/build/tmp/sysroots/nuc/usr/src/kernel
- NATIVE_SYSROOT: /home/trz/yocto/yocto-image/build/tmp/sysroots/x86_64-linux
-
- The image(s) were created using OE kickstart file:
- /home/trz/yocto/yocto-image/scripts/lib/image/canned-wks/directdisksdb.wks
- </literallayout>
- Continuing with the example, you can now directly
- <filename>dd</filename> the image to a USB stick, or
- whatever media for which you built your image,
- and boot the resulting media:
- <literallayout class='monospaced'>
- $ sudo dd if=build/directdisksdb-201310231131-sdb.direct of=/dev/sdb
- 86018+0 records in
- 86018+0 records out
- 44041216 bytes (44 MB) copied, 13.0734 s, 3.4 MB/s
- [trz at empanada tmp]$ sudo eject /dev/sdb
- </literallayout>
- </para>
- </section>
-
- <section id='creating-an-image-based-on-core-image-minimal-and-crownbay-noemgd'>
- <title>Creating an Image Based on <filename>core-image-minimal</filename> and <filename>crownbay-noemgd</filename></title>
-
- <para>
- This example creates an image based on
- <filename>core-image-minimal</filename> and a
- <filename>crownbay-noemgd</filename>
- <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
- that works right out of the box.
- <literallayout class='monospaced'>
- $ wic create directdisk -e core-image-minimal
-
- Checking basic build environment...
- Done.
-
- Creating image(s)...
-
- Info: The new image(s) can be found here:
- <replaceable>current_directory</replaceable>/build/directdisk-201309252350-sda.direct
-
- The following build artifacts were used to create the image(s):
-
- ROOTFS_DIR: /home/trz/yocto/yocto-image/build/tmp/work/crownbay_noemgd-poky-linux/core-image-minimal/1.0-r0/rootfs
- BOOTIMG_DIR: /home/trz/yocto/yocto-image/build/tmp/sysroots/crownbay-noemgd/usr/share
- KERNEL_DIR: /home/trz/yocto/yocto-image/build/tmp/sysroots/crownbay-noemgd/usr/src/kernel
- NATIVE_SYSROOT: /home/trz/yocto/yocto-image/build/tmp/sysroots/crownbay-noemgd/usr/src/kernel
-
- The image(s) were created using OE kickstart file:
- /home/trz/yocto/yocto-image/scripts/lib/image/canned-wks/directdisk.wks
- </literallayout>
- </para>
- </section>
-
- <section id='using-a-modified-kickstart-file-and-running-in-raw-mode'>
- <title>Using a Modified Kickstart File and Running in Raw Mode</title>
-
- <para>
- This next example manually specifies each build artifact
- (runs in Raw Mode) and uses a modified kickstart file.
- The example also uses the <filename>-o</filename> option
- to cause Wic to create the output
- somewhere other than the default output directory,
- which is the current directory:
- <literallayout class='monospaced'>
- $ wic create ~/test.wks -o /home/trz/testwic --rootfs-dir \
- /home/trz/yocto/yocto-image/build/tmp/work/crownbay_noemgd-poky-linux/core-image-minimal/1.0-r0/rootfs \
- --bootimg-dir /home/trz/yocto/yocto-image/build/tmp/sysroots/crownbay-noemgd/usr/share \
- --kernel-dir /home/trz/yocto/yocto-image/build/tmp/sysroots/crownbay-noemgd/usr/src/kernel \
- --native-sysroot /home/trz/yocto/yocto-image/build/tmp/sysroots/x86_64-linux
-
- Creating image(s)...
-
- Info: The new image(s) can be found here:
- /home/trz/testwic/build/test-201309260032-sda.direct
-
- The following build artifacts were used to create the image(s):
-
- ROOTFS_DIR: /home/trz/yocto/yocto-image/build/tmp/work/crownbay_noemgd-poky-linux/core-image-minimal/1.0-r0/rootfs
- BOOTIMG_DIR: /home/trz/yocto/yocto-image/build/tmp/sysroots/crownbay-noemgd/usr/share
- KERNEL_DIR: /home/trz/yocto/yocto-image/build/tmp/sysroots/crownbay-noemgd/usr/src/kernel
- NATIVE_SYSROOT: /home/trz/yocto/yocto-image/build/tmp/sysroots/crownbay-noemgd/usr/src/kernel
-
- The image(s) were created using OE kickstart file:
- /home/trz/test.wks
- </literallayout>
- For this example,
- <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
- did not have to be specified in the
- <filename>local.conf</filename> file since the
- artifact is manually specified.
- </para>
- </section>
+ INFO: The image(s) were created using OE kickstart file:
+ /home/scottrif/poky/scripts/lib/wic/canned-wks/directdisksdb-gpt.wks
+ </literallayout>
+ Continuing with the example, you can now directly
+ <filename>dd</filename> the image to a USB stick, or
+ whatever media for which you built your image,
+ and boot the resulting media:
+ <literallayout class='monospaced'>
+ $ sudo dd if=directdisksdb-gpt-201710090938-sdb.direct of=/dev/sdb
+ 140966+0 records in
+ 140966+0 records out
+ 72174592 bytes (72 MB, 69 MiB) copied, 78.0282 s, 925 kB/s
+ $ sudo eject /dev/sdb
+ </literallayout>
+ </para>
</section>
- <section id='openembedded-kickstart-plugins'>
- <title>Plug-ins</title>
+ <section id='using-a-modified-kickstart-file-and-running-in-raw-mode'>
+ <title>Using a Modified Kickstart File and Running in Raw Mode</title>
<para>
- Plug-ins allow Wic functionality to
- be extended and specialized by users.
- This section documents the plug-in interface, which is
- currently restricted to source plug-ins.
+ This next example manually specifies each build artifact
+ (runs in Raw Mode) and uses a modified kickstart file.
+ The example also uses the <filename>-o</filename> option
+ to cause Wic to create the output
+ somewhere other than the default output directory,
+ which is the current directory:
+ <literallayout class='monospaced'>
+ $ wic create /home/scottrif/my_yocto/test.wks -o /home/scottrif/testwic \
+ --rootfs-dir /home/scottrif/poky/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/rootfs \
+ --bootimg-dir /home/scottrif/poky/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/recipe-sysroot/usr/share \
+ --kernel-dir /home/scottrif/poky/build/tmp/deploy/images/qemux86 \
+ --native-sysroot /home/scottrif/poky/build/tmp/work/i586-poky-linux/wic-tools/1.0-r0/recipe-sysroot-native
+
+ INFO: Creating image(s)...
+
+ INFO: The new image(s) can be found here:
+ /home/scottrif/testwic/test-201710091445-sdb.direct
+
+ The following build artifacts were used to create the image(s):
+ ROOTFS_DIR: /home/scottrif/testwic/tmp.wic.x4wipbmb/rootfs_copy
+ BOOTIMG_DIR: /home/scottrif/poky/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/recipe-sysroot/usr/share
+ KERNEL_DIR: /home/scottrif/poky/build/tmp/deploy/images/qemux86
+ NATIVE_SYSROOT: /home/scottrif/poky/build/tmp/work/i586-poky-linux/wic-tools/1.0-r0/recipe-sysroot-native
+
+ INFO: The image(s) were created using OE kickstart file:
+ /home/scottrif/my_yocto/test.wks
+ </literallayout>
+ For this example,
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
+ did not have to be specified in the
+ <filename>local.conf</filename> file since the
+ artifact is manually specified.
</para>
+ </section>
+
+ <section id='using-wic-to-manipulate-an-image'>
+ <title>Using Wic to Manipulate an Image</title>
<para>
- Source plug-ins provide a mechanism to customize
- various aspects of the image generation process in
- Wic, mainly the contents of
- partitions.
- The plug-ins provide a mechanism for mapping values
- specified in <filename>.wks</filename> files using the
- <filename>--source</filename> keyword to a
- particular plug-in implementation that populates a
- corresponding partition.
+ Wic image manipulation allows you to shorten turnaround
+ time during image development.
+ For example, you can use Wic to delete the kernel partition
+ of a Wic image and then insert a newly built kernel.
+ This saves you time from having to rebuild the entire image
+ each time you modify the kernel.
<note>
- If you use plug-ins that have build-time dependencies
- (e.g. native tools, bootloaders, and so forth)
- when building a Wic image, you need to specify those
- dependencies using the
- <ulink url='&YOCTO_DOCS_REF_URL;#var-WKS_FILE_DEPENDS'><filename>WKS_FILE_DEPENDS</filename></ulink>
- variable.
+ In order to use Wic to manipulate a Wic image as in
+ this example, your development machine must have the
+ <filename>mtools</filename> package installed.
</note>
</para>
<para>
- A source plug-in is created as a subclass of
- <filename>SourcePlugin</filename>.
- The plug-in file containing it is added to
- <filename>scripts/lib/wic/plugins/source/</filename> to
- make the plug-in implementation available to the
- Wic implementation.
- For more information, see
- <filename>scripts/lib/wic/pluginbase.py</filename>.
- </para>
-
- <para>
- Source plug-ins can also be implemented and added by
- external layers.
- As such, any plug-ins found in a
- <filename>scripts/lib/wic/plugins/source/</filename>
- directory in an external layer are also made
- available.
- </para>
-
- <para>
- When the Wic implementation needs
- to invoke a partition-specific implementation, it looks
- for the plug-in that has the same name as the
- <filename>--source</filename> parameter given to
- that partition.
- For example, if the partition is set up as follows:
- <literallayout class='monospaced'>
- part /boot --source bootimg-pcbios ...
- </literallayout>
- The methods defined as class members of the plug-in
- having the matching <filename>bootimg-pcbios.name</filename>
- class member are used.
- </para>
-
- <para>
- To be more concrete, here is the plug-in definition that
- matches a
- <filename>--source bootimg-pcbios</filename> usage,
- along with an example
- method called by the Wic implementation
- when it needs to invoke an implementation-specific
- partition-preparation function:
- <literallayout class='monospaced'>
- class BootimgPcbiosPlugin(SourcePlugin):
- name = 'bootimg-pcbios'
-
- @classmethod
- def do_prepare_partition(self, part, ...)
- </literallayout>
- If the subclass itself does not implement a function, a
- default version in a superclass is located and
- used, which is why all plug-ins must be derived from
- <filename>SourcePlugin</filename>.
- </para>
-
- <para>
- The <filename>SourcePlugin</filename> class defines the
- following methods, which is the current set of methods
- that can be implemented or overridden by
- <filename>--source</filename> plug-ins.
- Any methods not implemented by a
- <filename>SourcePlugin</filename> subclass inherit the
- implementations present in the
- <filename>SourcePlugin</filename> class.
- For more information, see the
- <filename>SourcePlugin</filename> source for details:
- </para>
-
- <para>
- <itemizedlist>
+ The following example examines the contents of the Wic
+ image, deletes the existing kernel, and then inserts a
+ new kernel:
+ <orderedlist>
<listitem><para>
- <emphasis><filename>do_prepare_partition()</filename>:</emphasis>
- Called to do the actual content population for a
+ <emphasis>List the Partitions:</emphasis>
+ Use the <filename>wic ls</filename> command to list
+ all the partitions in the Wic image:
+ <literallayout class='monospaced'>
+ $ wic ls tmp/deploy/images/qemux86/core-image-minimal-qemux86.wic
+ Num Start End Size Fstype
+ 1 1048576 25041919 23993344 fat16
+ 2 25165824 72157183 46991360 ext4
+ </literallayout>
+ The previous output shows two partitions in the
+ <filename>core-image-minimal-qemux86.wic</filename>
+ image.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Examine a Particular Partition:</emphasis>
+ Use the <filename>wic ls</filename> command again
+ but in a different form to examine a particular
partition.
- In other words, the method prepares the final
- partition image that is incorporated into the
- disk image.
- </para></listitem>
- <listitem><para>
- <emphasis><filename>do_configure_partition()</filename>:</emphasis>
- Called before
- <filename>do_prepare_partition()</filename>.
- This method is typically used to create custom
- configuration files for a partition (e.g. syslinux
- or grub configuration files).
- </para></listitem>
- <listitem><para>
- <emphasis><filename>do_install_disk()</filename>:</emphasis>
- Called after all partitions have been prepared and
- assembled into a disk image.
- This method provides a hook to allow finalization
- of a disk image, (e.g. writing an MBR).
- </para></listitem>
- <listitem><para>
- <emphasis><filename>do_stage_partition()</filename>:</emphasis>
- Special content-staging hook called before
- <filename>do_prepare_partition()</filename>.
- This method is normally empty.</para>
- <para>Typically, a partition just uses the passed-in
- parameters (e.g. the unmodified value of
- <filename>bootimg_dir</filename>).
- However, in some cases things might need to be
- more tailored.
- As an example, certain files might additionally
- need to be taken from
- <filename>bootimg_dir + /boot</filename>.
- This hook allows those files to be staged in a
- customized fashion.
<note>
- <filename>get_bitbake_var()</filename>
- allows you to access non-standard variables
- that you might want to use for this.
+ You can get command usage on any Wic command
+ using the following form:
+ <literallayout class='monospaced'>
+ $ wic help <replaceable>command</replaceable>
+ </literallayout>
+ For example, the following command shows you
+ the various ways to use the
+ <filename>wic ls</filename> command:
+ <literallayout class='monospaced'>
+ $ wic help ls
+ </literallayout>
</note>
- </para></listitem>
- </itemizedlist>
- </para>
+ The following command shows what is in Partition
+ one:
+ <literallayout class='monospaced'>
+ $ wic ls tmp/deploy/images/qemux86/core-image-minimal-qemux86.wic:1
+ Volume in drive : is boot
+ Volume Serial Number is E894-1809
+ Directory for ::/
- <para>
- This scheme is extensible.
- Adding more hooks is a simple matter of adding more
- plug-in methods to <filename>SourcePlugin</filename> and
- derived classes.
- The code that then needs to call the plug-in methods uses
- <filename>plugin.get_source_plugin_methods()</filename>
- to find the method or methods needed by the call.
- Retrieval of those methods is accomplished
- by filling up a dict with keys
- containing the method names of interest.
- On success, these will be filled in with the actual
- methods.
- Please see the Wic
- implementation for examples and details.
- </para>
- </section>
+ libcom32 c32 186500 2017-10-09 16:06
+ libutil c32 24148 2017-10-09 16:06
+ syslinux cfg 220 2017-10-09 16:06
+ vesamenu c32 27104 2017-10-09 16:06
+ vmlinuz 6904608 2017-10-09 16:06
+ 5 files 7 142 580 bytes
+ 16 582 656 bytes free
+ </literallayout>
+ The previous output shows five files, with the
+ <filename>vmlinuz</filename> being the kernel.
+ <note>
+ If you see the following error, you need to
+ update or create a
+ <filename>~/.mtoolsrc</filename> file and
+ be sure to have the line “mtools_skip_check=1“
+ in the file.
+ Then, run the Wic command again:
+ <literallayout class='monospaced'>
+ ERROR: _exec_cmd: /usr/bin/mdir -i /tmp/wic-parttfokuwra ::/ returned '1' instead of 0
+ output: Total number of sectors (47824) not a multiple of sectors per track (32)!
+ Add mtools_skip_check=1 to your .mtoolsrc file to skip this test
+ </literallayout>
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Remove the Old Kernel:</emphasis>
+ Use the <filename>wic rm</filename> command to
+ remove the <filename>vmlinuz</filename> file
+ (kernel):
+ <literallayout class='monospaced'>
+ $ wic rm tmp/deploy/images/qemux86/core-image-minimal-qemux86.wic:1/vmlinuz
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Add In the New Kernel:</emphasis>
+ Use the <filename>wic cp</filename> command to
+ add the updated kernel to the Wic image.
+ Depending on how you built your kernel, it could
+ be in different places.
+ If you used <filename>devtool</filename> and
+ an SDK to build your kernel, it resides in the
+ <filename>tmp/work</filename> directory of the
+ extensible SDK.
+ If you used <filename>make</filename> to build the
+ kernel, the kernel will be in the
+ <filename>workspace/sources</filename> area.
+ </para>
- <section id='openembedded-kickstart-wks-reference'>
- <title>OpenEmbedded Kickstart (<filename>.wks</filename>) Reference</title>
-
- <para>
- The current Wic implementation supports
- only the basic kickstart partitioning commands:
- <filename>partition</filename> (or <filename>part</filename>
- for short) and <filename>bootloader</filename>.
- <note>
- Future updates will implement more commands and options.
- If you use anything that is not specifically
- supported, results can be unpredictable.
- </note>
- </para>
-
- <para>
- The following is a list of the commands, their syntax,
- and meanings.
- The commands are based on the Fedora
- kickstart versions but with modifications to
- reflect Wic capabilities.
- You can see the original documentation for those commands
- at the following links:
- <itemizedlist>
- <listitem><para>
- <ulink url='http://fedoraproject.org/wiki/Anaconda/Kickstart#part_or_partition'>http://fedoraproject.org/wiki/Anaconda/Kickstart#part_or_partition</ulink>
- </para></listitem>
- <listitem><para>
- <ulink url='http://fedoraproject.org/wiki/Anaconda/Kickstart#bootloader'>http://fedoraproject.org/wiki/Anaconda/Kickstart#bootloader</ulink>
- </para></listitem>
- </itemizedlist>
- </para>
-
- <section id='command-part-or-partition'>
- <title>Command: part or partition</title>
-
- <para>
- Either of these commands create a partition on the system
- and use the following syntax:
- <literallayout class='monospaced'>
- part [<replaceable>mntpoint</replaceable>]
- partition [<replaceable>mntpoint</replaceable>]
- </literallayout>
- If you do not provide
- <replaceable>mntpoint</replaceable>, Wic creates a
- partition but does not mount it.
- </para>
-
- <para>
- The
- <filename><replaceable>mntpoint</replaceable></filename>
- is where the partition will be mounted and must be of
- one of the following forms:
- <itemizedlist>
- <listitem><para>
- <filename>/<replaceable>path</replaceable></filename>:
- For example, "/", "/usr", or "/home"
- </para></listitem>
- <listitem><para>
- <filename>swap</filename>:
- The created partition is used as swap space.
- </para></listitem>
- </itemizedlist>
- </para>
-
- <para>
- Specifying a <replaceable>mntpoint</replaceable> causes
- the partition to automatically be mounted.
- Wic achieves this by adding entries to the filesystem
- table (fstab) during image generation.
- In order for wic to generate a valid fstab, you must
- also provide one of the <filename>--ondrive</filename>,
- <filename>--ondisk</filename>, or
- <filename>--use-uuid</filename> partition options as
- part of the command.
- Here is an example using "/" as the mountpoint.
- The command uses "--ondisk" to force the partition onto
- the <filename>sdb</filename> disk:
- <literallayout class='monospaced'>
- part / --source rootfs --ondisk sdb --fstype=ext3 --label platform --align 1024
- </literallayout>
- </para>
-
- <para>
- Here is a list that describes other supported options
- you can use with the <filename>part</filename> and
- <filename>partition</filename> commands:
- <itemizedlist>
- <listitem><para>
- <emphasis><filename>--size</filename>:</emphasis>
- The minimum partition size in MBytes.
- Specify an integer value such as 500.
- Do not append the number with "MB".
- You do not need this option if you use
- <filename>--source</filename>.
- </para></listitem>
- <listitem><para>
- <emphasis><filename>--source</filename>:</emphasis>
- This option is a
- Wic-specific option that
- names the source of the data that populates
- the partition.
- The most common value for this option is
- "rootfs", but you can use any value that maps to
- a valid source plug-in.
- For information on the source plug-ins, see the
- "<link linkend='openembedded-kickstart-plugins'>Plug-ins</link>"
- section.</para>
- <para>If you use
- <filename>--source rootfs</filename>,
- Wic creates a partition as
- large as needed and to fill it with the contents
- of the root filesystem pointed to by the
- <filename>-r</filename> command-line option
- or the equivalent rootfs derived from the
- <filename>-e</filename> command-line
- option.
- The filesystem type used to create the
- partition is driven by the value of the
- <filename>--fstype</filename> option
- specified for the partition.
- See the entry on
- <filename>--fstype</filename> that
- follows for more information.
- </para>
- <para>If you use
- <filename>--source <replaceable>plugin-name</replaceable></filename>,
- Wic creates a partition as
- large as needed and fills it with the contents
- of the partition that is generated by the
- specified plug-in name using the data pointed
- to by the <filename>-r</filename> command-line
- option or the equivalent rootfs derived from the
- <filename>-e</filename> command-line
- option.
- Exactly what those contents and filesystem type
- end up being are dependent on the given plug-in
- implementation.
- </para>
- <para>If you do not use the
- <filename>--source</filename> option, the
- <filename>wic</filename> command creates an
- empty partition.
- Consequently, you must use the
- <filename>--size</filename> option to specify
- the size of the empty partition.
- </para></listitem>
- <listitem><para>
- <emphasis><filename>--ondisk</filename> or <filename>--ondrive</filename>:</emphasis>
- Forces the partition to be created on a
- particular disk.
- </para></listitem>
- <listitem><para>
- <emphasis><filename>--fstype</filename>:</emphasis>
- Sets the file system type for the partition.
- Valid values are:
- <itemizedlist>
- <listitem><para><filename>ext4</filename>
- </para></listitem>
- <listitem><para><filename>ext3</filename>
- </para></listitem>
- <listitem><para><filename>ext2</filename>
- </para></listitem>
- <listitem><para><filename>btrfs</filename>
- </para></listitem>
- <listitem><para><filename>squashfs</filename>
- </para></listitem>
- <listitem><para><filename>swap</filename>
- </para></listitem>
- </itemizedlist>
- </para></listitem>
- <listitem><para>
- <emphasis><filename>--fsoptions</filename>:</emphasis>
- Specifies a free-form string of options to be
- used when mounting the filesystem.
- This string will be copied into the
- <filename>/etc/fstab</filename> file of the
- installed system and should be enclosed in
- quotes.
- If not specified, the default string
- is "defaults".
- </para></listitem>
- <listitem><para>
- <emphasis><filename>--label label</filename>:</emphasis>
- Specifies the label to give to the filesystem to
- be made on the partition.
- If the given label is already in use by another
- filesystem, a new label is created for the
- partition.
- </para></listitem>
- <listitem><para>
- <emphasis><filename>--active</filename>:</emphasis>
- Marks the partition as active.
- </para></listitem>
- <listitem><para>
- <emphasis><filename>--align (in KBytes)</filename>:</emphasis>
- This option is a
- Wic-specific option that
- says to start a partition on an
- <replaceable>x</replaceable> KBytes
- boundary.</para></listitem>
- <listitem><para>
- <emphasis><filename>--no-table</filename>:</emphasis>
- This option is a
- Wic-specific option.
- Using the option reserves space for the
- partition and causes it to become populated.
- However, the partition is not added to the
- partition table.
- </para></listitem>
- <listitem><para>
- <emphasis><filename>--extra-space</filename>:</emphasis>
- This option is a
- Wic-specific option that
- adds extra space after the space filled by the
- content of the partition.
- The final size can go beyond the size specified
- by the <filename>--size</filename> option.
- The default value is 10 Mbytes.
- </para></listitem>
- <listitem><para>
- <emphasis><filename>--overhead-factor</filename>:</emphasis>
- This option is a
- Wic-specific option that
- multiplies the size of the partition by the
- option's value.
- You must supply a value greater than or equal to
- "1".
- The default value is "1.3".
- </para></listitem>
- <listitem><para>
- <emphasis><filename>--part-type</filename>:</emphasis>
- This option is a
- Wic-specific option that
- specifies the partition type globally
- unique identifier (GUID) for GPT partitions.
- You can find the list of partition type GUIDs
- at
- <ulink url='http://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_type_GUIDs'></ulink>.
- </para></listitem>
- <listitem><para>
- <emphasis><filename>--use-uuid</filename>:</emphasis>
- This option is a
- Wic-specific option that
- causes Wic to generate a
- random GUID for the partition.
- The generated identifier is used in the
- bootloader configuration to specify the root
- partition.
- </para></listitem>
- <listitem><para>
- <emphasis><filename>--uuid</filename>:</emphasis>
- This option is a
- Wic-specific
- option that specifies the partition UUID.
- </para></listitem>
- </itemizedlist>
- </para>
- </section>
-
- <section id='command-bootloader'>
- <title>Command: bootloader</title>
-
- <para>
- This command specifies how the bootloader should be
- configured and supports the following options:
- <note>
- Bootloader functionality and boot partitions are
- implemented by the various
- <filename>--source</filename>
- plug-ins that implement bootloader functionality.
- The bootloader command essentially provides a
- means of modifying bootloader configuration.
- </note>
- <itemizedlist>
- <listitem><para>
- <emphasis><filename>--timeout</filename>:</emphasis>
- Specifies the number of seconds before the
- bootloader times out and boots the default
- option.
- </para></listitem>
- <listitem><para>
- <emphasis><filename>--append</filename>:</emphasis>
- Specifies kernel parameters.
- These parameters will be added to the syslinux
- <filename>APPEND</filename> or
- <filename>grub</filename> kernel command line.
- </para></listitem>
- <listitem><para>
- <emphasis><filename>--configfile</filename>:</emphasis>
- Specifies a user-defined configuration file for
- the bootloader.
- You can provide a full pathname for the file or
- a file that exists in the
- <filename>canned-wks</filename> folder.
- This option overrides all other bootloader
- options.
- </para></listitem>
- </itemizedlist>
- </para>
- </section>
- </section>
+ <para>The following example assumes
+ <filename>devtool</filename> was used to build
+ the kernel:
+ <literallayout class='monospaced'>
+ cp ~/poky_sdk/tmp/work/qemux86-poky-linux/linux-yocto/4.12.12+git999-r0/linux-yocto-4.12.12+git999/arch/x86/boot/bzImage \
+ ~/poky/build/tmp/deploy/images/qemux86/core-image-minimal-qemux86.wic:1/vmlinuz
+ </literallayout>
+ Once the new kernel is added back into the image,
+ you can use the <filename>dd</filename>
+ command or
+ <link linkend='flashing-images-using-bmaptool'><filename>bmaptool</filename></link>
+ to flash your wic image onto an SD card
+ or USB stick and test your target.
+ <note>
+ Using <filename>bmaptool</filename> is
+ generally 10 to 20 times faster than using
+ <filename>dd</filename>.
+ </note>
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
</section>
</section>
@@ -5817,887 +5612,231 @@
<title>Building an Initial RAM Filesystem (initramfs) Image</title>
<para>
- initramfs is the successor of Initial RAM Disk (initrd).
- It is a "copy in and out" (cpio) archive of the initial file system
- that gets loaded into memory during the Linux startup process.
- Because Linux uses the contents of the archive during
- initialization, the initramfs needs to contain all of the device
- drivers and tools needed to mount the final root filesystem.
+ An initial RAM filesystem (initramfs) image provides a temporary
+ root filesystem used for early system initialization (e.g.
+ loading of modules needed to locate and mount the "real" root
+ filesystem).
+ <note>
+ The initramfs image is the successor of initial RAM disk
+ (initrd).
+ It is a "copy in and out" (cpio) archive of the initial
+ filesystem that gets loaded into memory during the Linux
+ startup process.
+ Because Linux uses the contents of the archive during
+ initialization, the initramfs image needs to contain all of the
+ device drivers and tools needed to mount the final root
+ filesystem.
+ </note>
</para>
<para>
- To build an initramfs image and bundle it into the kernel, set the
- <ulink url='&YOCTO_DOCS_REF_URL;#var-INITRAMFS_IMAGE_BUNDLE'><filename>INITRAMFS_IMAGE_BUNDLE</filename></ulink>
- variable in your <filename>local.conf</filename> file, and set the
- <ulink url='&YOCTO_DOCS_REF_URL;#var-INITRAMFS_IMAGE'><filename>INITRAMFS_IMAGE</filename></ulink>
- variable in your <filename>machine.conf</filename> file:
+ Follow these steps to create an initramfs image:
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Create the initramfs Image Recipe:</emphasis>
+ You can reference the
+ <filename>core-image-minimal-initramfs.bb</filename>
+ recipe found in the <filename>meta/recipes-core</filename>
+ directory of the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
+ as an example from which to work.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Decide if You Need to Bundle the initramfs Image
+ Into the Kernel Image:</emphasis>
+ If you want the initramfs image that is built to be
+ bundled in with the kernel image, set the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-INITRAMFS_IMAGE_BUNDLE'><filename>INITRAMFS_IMAGE_BUNDLE</filename></ulink>
+ variable to "1" in your <filename>local.conf</filename>
+ configuration file and set the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-INITRAMFS_IMAGE'><filename>INITRAMFS_IMAGE</filename></ulink>
+ variable in the recipe that builds the kernel image.
+ <note><title>Tip</title>
+ It is recommended that you do bundle the initramfs
+ image with the kernel image to avoid circular
+ dependencies between the kernel recipe and the
+ initramfs recipe should the initramfs image
+ include kernel modules.
+ </note>
+ Setting the <filename>INITRAMFS_IMAGE_BUNDLE</filename>
+ flag causes the initramfs image to be unpacked
+ into the <filename>${B}/usr/</filename> directory.
+ The unpacked initramfs image is then passed to the kernel's
+ <filename>Makefile</filename> using the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-CONFIG_INITRAMFS_SOURCE'><filename>CONFIG_INITRAMFS_SOURCE</filename></ulink>
+ variable, allowing the initramfs image to be built into
+ the kernel normally.
+ <note>
+ If you choose to not bundle the initramfs image with
+ the kernel image, you are essentially using an
+ <ulink url='https://en.wikipedia.org/wiki/Initrd'>Initial RAM Disk (initrd)</ulink>.
+ Creating an initrd is handled primarily through the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-INITRD_IMAGE'><filename>INITRD_IMAGE</filename></ulink>,
+ <filename>INITRD_LIVE</filename>, and
+ <filename>INITRD_IMAGE_LIVE</filename> variables.
+ For more information, see the
+ <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/tree/meta/classes/image-live.bbclass'><filename>image-live.bbclass</filename></ulink>
+ file.
+ </note>
+ </para></listitem>
+<!--
+Some notes from Cal:
+
+ A non-bundled initramfs is essentially an initrd, which I am discovering
+ to be rather confusingly supported in OE at the moment.
+
+ Its primarily handled through INITRD_IMAGE(_LIVE/_VM) and INITRD(_LIVE/_VM)
+ variables. INITRD_IMAGE* is the primary image target, which gets added to
+ INITRD*, which is a list of cpio filesystems. You can add more cpio
+ filesystems to the INITRD variable to add more to the initrd. For
+ instance, meta-intel adds intel-microcode via the following:
+
+ INITRD_LIVE_prepend = "${@bb.utils.contains('MACHINE_FEATURES', 'intel-ucode', '${DEPLOY_DIR_IMAGE}/microcode.cpio ', '', d)}"
+
+ If 'intel-ucode' is in MACHINE_FEATURES, this resolves to:
+
+ INITRD_LIVE_prepend = "${DEPLOY_DIR_IMAGE}/microcode.cpio "
+
+ Unfortunately you need the full path, and its up to you to sort out
+ dependencies as well. For instance, we have the following:
+
+ MACHINE_ESSENTIAL_EXTRA_RDEPENDS_append = "${@bb.utils.contains('MACHINE_FEATURES', 'intel-ucode', ' intel-microcode', '', d)}"
+
+ which resolves to:
+
+ MACHINE_ESSENTIAL_EXTRA_RDEPENDS_append = "intel-microcode"
+
+ However, the above is only true with the "live" IMAGE_FSTYPE. Wic is
+ another beast entirely, with current wic kickstart files not supporting
+ initrds, and only partial support in the source plugins. That being said,
+ I know the generic bootfs work Ed is working on will help immensely in this
+ aspect. He or Saul can provide more details here.
+
+ Anyhow, its rather fractured and confusing and could probably use a
+ rework honestly. I don't know how feasible it is to document all the
+ details and corner cases of this area.
+-->
+ <listitem><para>
+ <emphasis>Optionally Add Items to the initramfs Image
+ Through the initramfs Image Recipe:</emphasis>
+ If you add items to the initramfs image by way of its
+ recipe, you should use
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_INSTALL'><filename>PACKAGE_INSTALL</filename></ulink>
+ rather than
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_INSTALL'><filename>IMAGE_INSTALL</filename></ulink>.
+ <filename>PACKAGE_INSTALL</filename> gives more direct
+ control of what is added to the image as compared to
+ the defaults you might not necessarily want that are
+ set by the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-image'><filename>image</filename></ulink>
+ or
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-core-image'><filename>core-image</filename></ulink>
+ classes.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Build the Kernel Image and the initramfs
+ Image:</emphasis>
+ Build your kernel image using BitBake.
+ Because the initramfs image recipe is a dependency of the
+ kernel image, the initramfs image is built as well and
+ bundled with the kernel image if you used the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-INITRAMFS_IMAGE_BUNDLE'><filename>INITRAMFS_IMAGE_BUNDLE</filename></ulink>
+ variable described earlier.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='flashing-images-using-bmaptool'>
+ <title>Flashing Images Using <filename>bmaptool</filename></title>
+
+ <para>
+ An easy way to flash an image to a bootable device is to use
+ <filename>bmaptool</filename>, which is integrated into the
+ OpenEmbedded build system.
+ </para>
+
+ <para>
+ Following, is an example that shows how to flash a Wic image.
+ <note>
+ You can use <filename>bmaptool</filename> to flash any
+ type of image.
+ </note>
+ Use these steps to flash an image using
+ <filename>bmaptool</filename>:
+ <note>
+ Unless you are able to install the
+ <filename>bmap-tools</filename> package as mentioned in the note
+ in the second bullet of step 3 further down, you will need to build
+ <filename>bmaptool</filename> before using it.
+ Build the tool using the following command:
+ <literallayout class='monospaced'>
+ $ bitbake bmap-tools-native
+ </literallayout>
+ </note>
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Update the <filename>local.conf</filename> File:</emphasis>
+ Add the following to your <filename>local.conf</filename>
+ file:
+ <literallayout class='monospaced'>
+ IMAGE_FSTYPES += "wic wic.bmap"
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Get Your Image:</emphasis>
+ Either have your image ready (pre-built) or take the step
+ build the image:
+ <literallayout class='monospaced'>
+ $ bitbake <replaceable>image</replaceable>
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Flash the Device:</emphasis>
+ Flash the device with the image by using
+ <filename>bmaptool</filename> depending on your particular
+ setup:
+ <itemizedlist>
+ <listitem><para>
+ If you have write access to the media,
+ use this command form:
+ <literallayout class='monospaced'>
+ $ oe-run-native bmap-tools-native bmaptool copy ./tmp/deploy/images/qemux86-64-core-image-minimal-<replaceable>machine</replaceable>.wic /dev/sd<replaceable>X</replaceable>
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ If you do not have write access to
+ the media, use the following
+ commands:
+ <literallayout class='monospaced'>
+ $ sudo chmod 666 /dev/sd<replaceable>X</replaceable>
+ $ oe-run-native bmap-tools-native bmaptool copy ./tmp/deploy/images/qemux86-64-core-image-minimal-<replaceable>machine</replaceable>.wic /dev/sd<replaceable>X</replaceable>
+ </literallayout>
+ <note>
+ If you are using Ubuntu or Debian distributions,
+ you can install the
+ <filename>bmap-tools</filename> package using
+ the following command and then use the tool
+ without specifying
+ <filename>PATH</filename> even from the
+ root account:
+ <literallayout class='monospaced'>
+ $ sudo apt-get install bmap-tools
+ </literallayout>
+ </note>
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ </orderedlist>
+ </para>
+
+ <para>
+ For help on the <filename>bmaptool</filename> command, use the
+ following command:
<literallayout class='monospaced'>
- INITRAMFS_IMAGE_BUNDLE = "1"
- INITRAMFS_IMAGE = "<replaceable>image_recipe_name</replaceable>"
+ $ bmaptool --help
</literallayout>
- Setting the <filename>INITRAMFS_IMAGE_BUNDLE</filename>
- flag causes the initramfs created by the recipe and defined by
- <filename>INITRAMFS_IMAGE</filename> to be unpacked into the
- <filename>${B}/usr/</filename> directory.
- The unpacked initramfs is then passed to the kernel's
- <filename>Makefile</filename> using the
- <ulink url='&YOCTO_DOCS_REF_URL;#var-CONFIG_INITRAMFS_SOURCE'><filename>CONFIG_INITRAMFS_SOURCE</filename></ulink>
- variable, allowing initramfs to be built in to the kernel
- normally.
- <note>
- The preferred method is to use the
- <filename>INITRAMFS_IMAGE</filename> variable rather than the
- <filename>INITRAMFS_TASK</filename> variable.
- Setting <filename>INITRAMFS_TASK</filename> is supported for
- backward compatibility.
- However, use of this variable has circular dependency
- problems.
- See the
- <ulink url='&YOCTO_DOCS_REF_URL;#var-INITRAMFS_IMAGE_BUNDLE'><filename>INITRAMFS_IMAGE_BUNDLE</filename></ulink>
- variable for additional information on these dependency
- problems.
- </note>
</para>
-
- <para>
- The recipe that <filename>INITRAMFS_IMAGE</filename>
- points to must produce a <filename>.cpio.gz</filename>,
- <filename>.cpio.tar</filename>, <filename>.cpio.lz4</filename>,
- <filename>.cpio.lzma</filename>, or
- <filename>.cpio.xz</filename> file.
- You can ensure you produce one of these <filename>.cpio.*</filename>
- files by setting the
- <ulink url='&YOCTO_DOCS_REF_URL;#var-INITRAMFS_FSTYPES'><filename>INITRAMFS_FSTYPES</filename></ulink>
- variable in your configuration file to one or more of the above
- file types.
- <note>
- If you add items to the initramfs image by way of its recipe,
- you should use
- <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_INSTALL'><filename>PACKAGE_INSTALL</filename></ulink>
- rather than
- <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_INSTALL'><filename>IMAGE_INSTALL</filename></ulink>.
- <filename>PACKAGE_INSTALL</filename> gives more direct control
- of what is added to the image as compared to the defaults you
- might not necessarily want that are set by the
- <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-image'><filename>image</filename></ulink>
- or
- <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-core-image'><filename>core-image</filename></ulink>
- classes.
- </note>
- </para>
- </section>
-
- <section id='configuring-the-kernel'>
- <title>Configuring the Kernel</title>
-
- <para>
- Configuring the Yocto Project kernel consists of making sure the
- <filename>.config</filename> file has all the right information
- in it for the image you are building.
- You can use the <filename>menuconfig</filename> tool and
- configuration fragments to make sure your
- <filename>.config</filename> file is just how you need it.
- You can also save known configurations in a
- <filename>defconfig</filename> file that the build system can use
- for kernel configuration.
- </para>
-
- <para>
- This section describes how to use <filename>menuconfig</filename>,
- create and use configuration fragments, and how to interactively
- modify your <filename>.config</filename> file to create the
- leanest kernel configuration file possible.
- </para>
-
- <para>
- For more information on kernel configuration, see the
- "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#changing-the-configuration'>Changing the Configuration</ulink>"
- section in the Yocto Project Linux Kernel Development Manual.
- </para>
-
- <section id='using-menuconfig'>
- <title>Using <filename>menuconfig</filename></title>
-
- <para>
- The easiest way to define kernel configurations is to set them through the
- <filename>menuconfig</filename> tool.
- This tool provides an interactive method with which
- to set kernel configurations.
- For general information on <filename>menuconfig</filename>, see
- <ulink url='http://en.wikipedia.org/wiki/Menuconfig'></ulink>.
- </para>
-
- <para>
- To use the <filename>menuconfig</filename> tool in the Yocto Project development
- environment, you must launch it using BitBake.
- Thus, the environment must be set up using the
- <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>
- or
- <ulink url='&YOCTO_DOCS_REF_URL;#structure-memres-core-script'><filename>oe-init-build-env-memres</filename></ulink>
- script found in the
- <link linkend='build-directory'>Build Directory</link>.
- You must also be sure of the state of your build in the
- <link linkend='source-directory'>Source Directory</link>.
- The following commands run <filename>menuconfig</filename>
- assuming the Source Directory's top-level folder is
- <filename>~/poky</filename>:
- <literallayout class='monospaced'>
- $ cd poky
- $ source oe-init-build-env
- $ bitbake linux-yocto -c kernel_configme -f
- $ bitbake linux-yocto -c menuconfig
- </literallayout>
- Once <filename>menuconfig</filename> comes up, its standard
- interface allows you to interactively examine and configure
- all the kernel configuration parameters.
- After making your changes, simply exit the tool and save your
- changes to create an updated version of the
- <filename>.config</filename> configuration file.
- </para>
-
- <para>
- Consider an example that configures the <filename>linux-yocto-3.14</filename>
- kernel.
- The OpenEmbedded build system recognizes this kernel as
- <filename>linux-yocto</filename>.
- Thus, the following commands from the shell in which you previously sourced the
- environment initialization script cleans the shared state cache and the
- <ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink>
- directory and then runs <filename>menuconfig</filename>:
- <literallayout class='monospaced'>
- $ bitbake linux-yocto -c menuconfig
- </literallayout>
- </para>
-
- <para>
- Once <filename>menuconfig</filename> launches, use the interface
- to navigate through the selections to find the configuration settings in
- which you are interested.
- For example, consider the <filename>CONFIG_SMP</filename> configuration setting.
- You can find it at <filename>Processor Type and Features</filename> under
- the configuration selection <filename>Symmetric Multi-processing Support</filename>.
- After highlighting the selection, use the arrow keys to select or deselect
- the setting.
- When you are finished with all your selections, exit out and save them.
- </para>
-
- <para>
- Saving the selections updates the <filename>.config</filename> configuration file.
- This is the file that the OpenEmbedded build system uses to configure the
- kernel during the build.
- You can find and examine this file in the Build Directory in
- <filename>tmp/work/</filename>.
- The actual <filename>.config</filename> is located in the area where the
- specific kernel is built.
- For example, if you were building a Linux Yocto kernel based on the
- Linux 3.14 kernel and you were building a QEMU image targeted for
- <filename>x86</filename> architecture, the
- <filename>.config</filename> file would be located here:
- <literallayout class='monospaced'>
- poky/build/tmp/work/qemux86-poky-linux/linux-yocto-3.14.11+git1+84f...
- ...656ed30-r1/linux-qemux86-standard-build
- </literallayout>
- <note>
- The previous example directory is artificially split and many of the characters
- in the actual filename are omitted in order to make it more readable.
- Also, depending on the kernel you are using, the exact pathname
- for <filename>linux-yocto-3.14...</filename> might differ.
- </note>
- </para>
-
- <para>
- Within the <filename>.config</filename> file, you can see the kernel settings.
- For example, the following entry shows that symmetric multi-processor support
- is not set:
- <literallayout class='monospaced'>
- # CONFIG_SMP is not set
- </literallayout>
- </para>
-
- <para>
- A good method to isolate changed configurations is to use a combination of the
- <filename>menuconfig</filename> tool and simple shell commands.
- Before changing configurations with <filename>menuconfig</filename>, copy the
- existing <filename>.config</filename> and rename it to something else,
- use <filename>menuconfig</filename> to make
- as many changes as you want and save them, then compare the renamed configuration
- file against the newly created file.
- You can use the resulting differences as your base to create configuration fragments
- to permanently save in your kernel layer.
- <note>
- Be sure to make a copy of the <filename>.config</filename> and don't just
- rename it.
- The build system needs an existing <filename>.config</filename>
- from which to work.
- </note>
- </para>
- </section>
-
- <section id='creating-a-defconfig-file'>
- <title>Creating a <filename>defconfig</filename> File</title>
-
- <para>
- A <filename>defconfig</filename> file is simply a
- <filename>.config</filename> renamed to "defconfig".
- You can use a <filename>defconfig</filename> file
- to retain a known set of kernel configurations from which the
- OpenEmbedded build system can draw to create the final
- <filename>.config</filename> file.
- <note>
- Out-of-the-box, the Yocto Project never ships a
- <filename>defconfig</filename> or
- <filename>.config</filename> file.
- The OpenEmbedded build system creates the final
- <filename>.config</filename> file used to configure the
- kernel.
- </note>
- </para>
-
- <para>
- To create a <filename>defconfig</filename>, start with a
- complete, working Linux kernel <filename>.config</filename>
- file.
- Copy that file to the appropriate
- <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PN'><filename>PN</filename></ulink><filename>}</filename>
- directory in your layer's
- <filename>recipes-kernel/linux</filename> directory, and rename
- the copied file to "defconfig".
- Then, add the following lines to the linux-yocto
- <filename>.bbappend</filename> file in your layer:
- <literallayout class='monospaced'>
- FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
- SRC_URI += "file://defconfig"
- </literallayout>
- The
- <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
- tells the build system how to search for the file, while the
- <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></ulink>
- extends the
- <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESPATH'><filename>FILESPATH</filename></ulink>
- variable (search directories) to include the
- <filename>${PN}</filename> directory you created to hold the
- configuration changes.
- <note>
- The build system applies the configurations from the
- <filename>defconfig</filename> file before applying any
- subsequent configuration fragments.
- The final kernel configuration is a combination of the
- configurations in the <filename>defconfig</filename>
- file and any configuration fragments you provide.
- You need to realize that if you have any configuration
- fragments, the build system applies these on top of and
- after applying the existing defconfig file configurations.
- </note>
- For more information on configuring the kernel, see the
- "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#changing-the-configuration'>Changing the Configuration</ulink>"
- and
- "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#generating-configuration-files'>Generating Configuration Files</ulink>"
- sections, both in the Yocto Project Linux Kernel Development
- Manual.
- </para>
- </section>
-
- <section id='creating-config-fragments'>
- <title>Creating Configuration Fragments</title>
-
- <para>
- Configuration fragments are simply kernel options that appear in a file
- placed where the OpenEmbedded build system can find and apply them.
- Syntactically, the configuration statement is identical to what would appear
- in the <filename>.config</filename> file, which is in the
- <link linkend='build-directory'>Build Directory</link>:
- <literallayout class='monospaced'>
- tmp/work/<replaceable>arch</replaceable>-poky-linux/linux-yocto-<replaceable>release_specific_string</replaceable>/linux-<replaceable>arch</replaceable>-<replaceable>build_type</replaceable>
- </literallayout>
- </para>
-
- <para>
- It is simple to create a configuration fragment.
- For example, issuing the following from the shell creates a configuration fragment
- file named <filename>my_smp.cfg</filename> that enables multi-processor support
- within the kernel:
- <literallayout class='monospaced'>
- $ echo "CONFIG_SMP=y" >> my_smp.cfg
- </literallayout>
- <note>
- All configuration fragment files must use the
- <filename>.cfg</filename> extension in order for the
- OpenEmbedded build system to recognize them as a
- configuration fragment.
- </note>
- </para>
-
- <para>
- Where do you put your configuration fragment files?
- You can place these files in the same area pointed to by
- <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>.
- The OpenEmbedded build system picks up the configuration and
- adds it to the kernel's configuration.
- For example, suppose you had a set of configuration options
- in a file called <filename>myconfig.cfg</filename>.
- If you put that file inside a directory named
- <filename>linux-yocto</filename> that resides in the same
- directory as the kernel's append file and then add a
- <filename>SRC_URI</filename> statement such as the following
- to the kernel's append file, those configuration options
- will be picked up and applied when the kernel is built.
- <literallayout class='monospaced'>
- SRC_URI += "file://myconfig.cfg"
- </literallayout>
- </para>
-
- <para>
- As mentioned earlier, you can group related configurations into multiple files and
- name them all in the <filename>SRC_URI</filename> statement as well.
- For example, you could group separate configurations specifically for Ethernet and graphics
- into their own files and add those by using a <filename>SRC_URI</filename> statement like the
- following in your append file:
- <literallayout class='monospaced'>
- SRC_URI += "file://myconfig.cfg \
- file://eth.cfg \
- file://gfx.cfg"
- </literallayout>
- </para>
- </section>
-
- <section id='fine-tuning-the-kernel-configuration-file'>
- <title>Fine-Tuning the Kernel Configuration File</title>
-
- <para>
- You can make sure the <filename>.config</filename> file is as lean or efficient as
- possible by reading the output of the kernel configuration fragment audit,
- noting any issues, making changes to correct the issues, and then repeating.
- </para>
-
- <para>
- As part of the kernel build process, the
- <filename>do_kernel_configcheck</filename> task runs.
- This task validates the kernel configuration by checking the final
- <filename>.config</filename> file against the input files.
- During the check, the task produces warning messages for the following
- issues:
- <itemizedlist>
- <listitem><para>Requested options that did not make the final
- <filename>.config</filename> file.</para></listitem>
- <listitem><para>Configuration items that appear twice in the same
- configuration fragment.</para></listitem>
- <listitem><para>Configuration items tagged as "required" that were overridden.
- </para></listitem>
- <listitem><para>A board overrides a non-board specific option.</para></listitem>
- <listitem><para>Listed options not valid for the kernel being processed.
- In other words, the option does not appear anywhere.</para></listitem>
- </itemizedlist>
- <note>
- The <filename>do_kernel_configcheck</filename> task can
- also optionally report if an option is overridden during
- processing.
- </note>
- </para>
-
- <para>
- For each output warning, a message points to the file
- that contains a list of the options and a pointer to the
- configuration fragment that defines them.
- Collectively, the files are the key to streamlining the
- configuration.
- </para>
-
- <para>
- To streamline the configuration, do the following:
- <orderedlist>
- <listitem><para>Start with a full configuration that you
- know works - it builds and boots successfully.
- This configuration file will be your baseline.
- </para></listitem>
- <listitem><para>Separately run the
- <filename>do_kernel_configme</filename> and
- <filename>do_kernel_configcheck</filename> tasks.
- </para></listitem>
- <listitem><para>Take the resulting list of files from the
- <filename>do_kernel_configcheck</filename> task
- warnings and do the following:
- <itemizedlist>
- <listitem><para>
- Drop values that are redefined in the fragment
- but do not change the final
- <filename>.config</filename> file.
- </para></listitem>
- <listitem><para>
- Analyze and potentially drop values from the
- <filename>.config</filename> file that override
- required configurations.
- </para></listitem>
- <listitem><para>
- Analyze and potentially remove non-board
- specific options.
- </para></listitem>
- <listitem><para>
- Remove repeated and invalid options.
- </para></listitem>
- </itemizedlist></para></listitem>
- <listitem><para>
- After you have worked through the output of the kernel
- configuration audit, you can re-run the
- <filename>do_kernel_configme</filename> and
- <filename>do_kernel_configcheck</filename> tasks to
- see the results of your changes.
- If you have more issues, you can deal with them as
- described in the previous step.
- </para></listitem>
- </orderedlist>
- </para>
-
- <para>
- Iteratively working through steps two through four eventually yields
- a minimal, streamlined configuration file.
- Once you have the best <filename>.config</filename>, you can build the Linux
- Yocto kernel.
- </para>
- </section>
-
- <section id='determining-hardware-and-non-hardware-features-for-the-kernel-configuration-audit-phase'>
- <title>Determining Hardware and Non-Hardware Features for the Kernel Configuration Audit Phase</title>
-
- <para>
- This section describes part of the kernel configuration audit
- phase that most developers can ignore.
- During this part of the audit phase, the contents of the final
- <filename>.config</filename> file are compared against the
- fragments specified by the system.
- These fragments can be system fragments, distro fragments,
- or user specified configuration elements.
- Regardless of their origin, the OpenEmbedded build system
- warns the user if a specific option is not included in the
- final kernel configuration.
- </para>
-
- <para>
- In order to not overwhelm the user with configuration warnings,
- by default the system only reports on missing "hardware"
- options because a missing hardware option could mean a boot
- failure or that important hardware is not available.
- </para>
-
- <para>
- To determine whether or not a given option is "hardware" or
- "non-hardware", the kernel Metadata contains files that
- classify individual or groups of options as either hardware
- or non-hardware.
- To better show this, consider a situation where the
- Yocto Project kernel cache contains the following files:
- <literallayout class='monospaced'>
- kernel-cache/features/drm-psb/hardware.cfg
- kernel-cache/features/kgdb/hardware.cfg
- kernel-cache/ktypes/base/hardware.cfg
- kernel-cache/bsp/mti-malta32/hardware.cfg
- kernel-cache/bsp/fsl-mpc8315e-rdb/hardware.cfg
- kernel-cache/bsp/qemu-ppc32/hardware.cfg
- kernel-cache/bsp/qemuarma9/hardware.cfg
- kernel-cache/bsp/mti-malta64/hardware.cfg
- kernel-cache/bsp/arm-versatile-926ejs/hardware.cfg
- kernel-cache/bsp/common-pc/hardware.cfg
- kernel-cache/bsp/common-pc-64/hardware.cfg
- kernel-cache/features/rfkill/non-hardware.cfg
- kernel-cache/ktypes/base/non-hardware.cfg
- kernel-cache/features/aufs/non-hardware.kcf
- kernel-cache/features/ocf/non-hardware.kcf
- kernel-cache/ktypes/base/non-hardware.kcf
- kernel-cache/ktypes/base/hardware.kcf
- kernel-cache/bsp/qemu-ppc32/hardware.kcf
- </literallayout>
- The following list provides explanations for the various
- files:
- <itemizedlist>
- <listitem><para><filename>hardware.kcf</filename>:
- Specifies a list of kernel Kconfig files that contain
- hardware options only.
- </para></listitem>
- <listitem><para><filename>non-hardware.kcf</filename>:
- Specifies a list of kernel Kconfig files that contain
- non-hardware options only.
- </para></listitem>
- <listitem><para><filename>hardware.cfg</filename>:
- Specifies a list of kernel
- <filename>CONFIG_</filename> options that are hardware,
- regardless of whether or not they are within a Kconfig
- file specified by a hardware or non-hardware
- Kconfig file (i.e. <filename>hardware.kcf</filename> or
- <filename>non-hardware.kcf</filename>).
- </para></listitem>
- <listitem><para><filename>non-hardware.cfg</filename>:
- Specifies a list of kernel
- <filename>CONFIG_</filename> options that are
- not hardware, regardless of whether or not they are
- within a Kconfig file specified by a hardware or
- non-hardware Kconfig file (i.e.
- <filename>hardware.kcf</filename> or
- <filename>non-hardware.kcf</filename>).
- </para></listitem>
- </itemizedlist>
- Here is a specific example using the
- <filename>kernel-cache/bsp/mti-malta32/hardware.cfg</filename>:
- <literallayout class='monospaced'>
- CONFIG_SERIAL_8250
- CONFIG_SERIAL_8250_CONSOLE
- CONFIG_SERIAL_8250_NR_UARTS
- CONFIG_SERIAL_8250_PCI
- CONFIG_SERIAL_CORE
- CONFIG_SERIAL_CORE_CONSOLE
- CONFIG_VGA_ARB
- </literallayout>
- The kernel configuration audit automatically detects these
- files (hence the names must be exactly the ones discussed here),
- and uses them as inputs when generating warnings about the
- final <filename>.config</filename> file.
- </para>
-
- <para>
- A user-specified kernel Metadata repository, or recipe space
- feature, can use these same files to classify options that are
- found within its <filename>.cfg</filename> files as hardware
- or non-hardware, to prevent the OpenEmbedded build system from
- producing an error or warning when an option is not in the
- final <filename>.config</filename> file.
- </para>
- </section>
- </section>
-
- <section id="patching-the-kernel">
- <title>Patching the Kernel</title>
-
- <para>
- Patching the kernel involves changing or adding configurations to an existing kernel,
- changing or adding recipes to the kernel that are needed to support specific hardware features,
- or even altering the source code itself.
- <note>
- You can use the <filename>yocto-kernel</filename> script
- found in the <link linkend='source-directory'>Source Directory</link>
- under <filename>scripts</filename> to manage kernel patches and configuration.
- See the "<ulink url='&YOCTO_DOCS_BSP_URL;#managing-kernel-patches-and-config-items-with-yocto-kernel'>Managing kernel Patches and Config Items with yocto-kernel</ulink>"
- section in the Yocto Project Board Support Packages (BSP) Developer's Guide for
- more information.</note>
- </para>
-
- <para>
- This example creates a simple patch by adding some QEMU emulator console
- output at boot time through <filename>printk</filename> statements in the kernel's
- <filename>calibrate.c</filename> source code file.
- Applying the patch and booting the modified image causes the added
- messages to appear on the emulator's console.
- </para>
-
- <para>
- The example assumes a clean build exists for the <filename>qemux86</filename>
- machine in a
- <link linkend='source-directory'>Source Directory</link>
- named <filename>poky</filename>.
- Furthermore, the <link linkend='build-directory'>Build Directory</link> is
- <filename>build</filename> and is located in <filename>poky</filename> and
- the kernel is based on the Linux 3.4 kernel.
- </para>
-
- <para>
- Also, for more information on patching the kernel, see the
- "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#applying-patches'>Applying Patches</ulink>"
- section in the Yocto Project Linux Kernel Development Manual.
- </para>
-
- <section id='create-a-layer-for-your-changes'>
- <title>Create a Layer for your Changes</title>
-
- <para>
- The first step is to create a layer so you can isolate your
- changes.
- Rather than use the <filename>yocto-layer</filename> script
- to create the layer, this example steps through the process
- by hand.
- If you want information on the script that creates a general
- layer, see the
- "<link linkend='creating-a-general-layer-using-the-yocto-layer-script'>Creating a General Layer Using the yocto-layer Script</link>"
- section.
- </para>
-
- <para>
- These two commands create a directory you can use for your
- layer:
- <literallayout class='monospaced'>
- $ cd ~/poky
- $ mkdir meta-mylayer
- </literallayout>
- Creating a directory that follows the Yocto Project layer naming
- conventions sets up the layer for your changes.
- The layer is where you place your configuration files, append
- files, and patch files.
- To learn more about creating a layer and filling it with the
- files you need, see the "<link linkend='understanding-and-creating-layers'>Understanding
- and Creating Layers</link>" section.
- </para>
- </section>
-
- <section id='finding-the-kernel-source-code'>
- <title>Finding the Kernel Source Code</title>
-
- <para>
- Each time you build a kernel image, the kernel source code is fetched
- and unpacked into the following directory:
- <literallayout class='monospaced'>
- ${S}/linux
- </literallayout>
- See the "<link linkend='finding-the-temporary-source-code'>Finding Temporary Source Code</link>"
- section and the
- <ulink url='&YOCTO_DOCS_REF_URL;#var-S'><filename>S</filename></ulink> variable
- for more information about where source is kept during a build.
- </para>
-
- <para>
- For this example, we are going to patch the
- <filename>init/calibrate.c</filename> file
- by adding some simple console <filename>printk</filename> statements that we can
- see when we boot the image using QEMU.
- </para>
- </section>
-
- <section id='creating-the-patch'>
- <title>Creating the Patch</title>
-
- <para>
- Two methods exist by which you can create the patch:
- <link linkend='using-devtool-in-your-workflow'><filename>devtool</filename></link> and
- <link linkend='using-a-quilt-workflow'>Quilt</link>.
- For kernel patches, the Git workflow is more appropriate.
- This section assumes the Git workflow and shows the steps specific to
- this example.
- <orderedlist>
- <listitem><para><emphasis>Change the working directory</emphasis>:
- Change to where the kernel source code is before making
- your edits to the <filename>calibrate.c</filename> file:
- <literallayout class='monospaced'>
- $ cd ~/poky/build/tmp/work/qemux86-poky-linux/linux-yocto-${PV}-${PR}/linux
- </literallayout>
- Because you are working in an established Git repository,
- you must be in this directory in order to commit your changes
- and create the patch file.
- <note>The <ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink> and
- <ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink> variables
- represent the version and revision for the
- <filename>linux-yocto</filename> recipe.
- The <filename>PV</filename> variable includes the Git meta and machine
- hashes, which make the directory name longer than you might
- expect.
- </note></para></listitem>
- <listitem><para><emphasis>Edit the source file</emphasis>:
- Edit the <filename>init/calibrate.c</filename> file to have the
- following changes:
- <literallayout class='monospaced'>
- void calibrate_delay(void)
- {
- unsigned long lpj;
- static bool printed;
- int this_cpu = smp_processor_id();
-
- printk("*************************************\n");
- printk("* *\n");
- printk("* HELLO YOCTO KERNEL *\n");
- printk("* *\n");
- printk("*************************************\n");
-
- if (per_cpu(cpu_loops_per_jiffy, this_cpu)) {
- .
- .
- .
- </literallayout></para></listitem>
- <listitem><para><emphasis>Stage and commit your changes</emphasis>:
- These Git commands display the modified file, stage it, and then
- commit the file:
- <literallayout class='monospaced'>
- $ git status
- $ git add init/calibrate.c
- $ git commit -m "calibrate: Add printk example"
- </literallayout></para></listitem>
- <listitem><para><emphasis>Generate the patch file</emphasis>:
- This Git command creates the a patch file named
- <filename>0001-calibrate-Add-printk-example.patch</filename>
- in the current directory.
- <literallayout class='monospaced'>
- $ git format-patch -1
- </literallayout>
- </para></listitem>
- </orderedlist>
- </para>
- </section>
-
- <section id='set-up-your-layer-for-the-build'>
- <title>Set Up Your Layer for the Build</title>
-
- <para>These steps get your layer set up for the build:
- <orderedlist>
- <listitem><para><emphasis>Create additional structure</emphasis>:
- Create the additional layer structure:
- <literallayout class='monospaced'>
- $ cd ~/poky/meta-mylayer
- $ mkdir conf
- $ mkdir recipes-kernel
- $ mkdir recipes-kernel/linux
- $ mkdir recipes-kernel/linux/linux-yocto
- </literallayout>
- The <filename>conf</filename> directory holds your configuration files, while the
- <filename>recipes-kernel</filename> directory holds your append file and
- your patch file.</para></listitem>
- <listitem><para><emphasis>Create the layer configuration file</emphasis>:
- Move to the <filename>meta-mylayer/conf</filename> directory and create
- the <filename>layer.conf</filename> file as follows:
- <literallayout class='monospaced'>
- # We have a conf and classes directory, add to BBPATH
- BBPATH .= ":${LAYERDIR}"
-
- # We have recipes-* directories, add to BBFILES
- BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
- ${LAYERDIR}/recipes-*/*/*.bbappend"
-
- BBFILE_COLLECTIONS += "mylayer"
- BBFILE_PATTERN_mylayer = "^${LAYERDIR}/"
- BBFILE_PRIORITY_mylayer = "5"
- </literallayout>
- Notice <filename>mylayer</filename> as part of the last three
- statements.</para></listitem>
- <listitem><para><emphasis>Create the kernel recipe append file</emphasis>:
- Move to the <filename>meta-mylayer/recipes-kernel/linux</filename> directory and create
- the <filename>linux-yocto_3.4.bbappend</filename> file as follows:
- <literallayout class='monospaced'>
- FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-
- SRC_URI += "file://0001-calibrate-Add-printk-example.patch"
- </literallayout>
- The <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></ulink>
- and <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
- statements enable the OpenEmbedded build system to find the patch file.
- For more information on using append files, see the
- "<link linkend='using-bbappend-files'>Using .bbappend Files in Your Layer</link>"
- section.
- </para></listitem>
- <listitem><para><emphasis>Put the patch file in your layer</emphasis>:
- Move the <filename>0001-calibrate-Add-printk-example.patch</filename> file to
- the <filename>meta-mylayer/recipes-kernel/linux/linux-yocto</filename>
- directory.</para></listitem>
- </orderedlist>
- </para>
- </section>
-
- <section id='set-up-for-the-build'>
- <title>Set Up for the Build</title>
-
- <para>
- Do the following to make sure the build parameters are set up for the example.
- Once you set up these build parameters, they do not have to change unless you
- change the target architecture of the machine you are building:
- <itemizedlist>
- <listitem><para><emphasis>Build for the correct target architecture:</emphasis> Your
- selected <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
- definition within the <filename>local.conf</filename> file in the
- <link linkend='build-directory'>Build Directory</link>
- specifies the target architecture used when building the Linux kernel.
- By default, <filename>MACHINE</filename> is set to
- <filename>qemux86</filename>, which specifies a 32-bit
- <trademark class='registered'>Intel</trademark> Architecture
- target machine suitable for the QEMU emulator.</para></listitem>
- <listitem><para><emphasis>Identify your <filename>meta-mylayer</filename>
- layer:</emphasis> The
- <ulink url='&YOCTO_DOCS_REF_URL;#var-BBLAYERS'><filename>BBLAYERS</filename></ulink>
- variable in the
- <filename>bblayers.conf</filename> file found in the
- <filename>poky/build/conf</filename> directory needs to have the path to your local
- <filename>meta-mylayer</filename> layer.
- By default, the <filename>BBLAYERS</filename> variable contains paths to
- <filename>meta</filename>, <filename>meta-poky</filename>, and
- <filename>meta-yocto-bsp</filename> in the
- <filename>poky</filename> Git repository.
- Add the path to your <filename>meta-mylayer</filename> location:
- <literallayout class='monospaced'>
- BBLAYERS ?= " \
- $HOME/poky/meta \
- $HOME/poky/meta-poky \
- $HOME/poky/meta-yocto-bsp \
- $HOME/poky/meta-mylayer \
- "
- </literallayout></para></listitem>
- </itemizedlist>
- </para>
- </section>
-
- <section id='build-the-modified-qemu-kernel-image'>
- <title>Build the Modified QEMU Kernel Image</title>
-
- <para>
- The following steps build your modified kernel image:
- <orderedlist>
- <listitem><para><emphasis>Be sure your build environment is initialized</emphasis>:
- Your environment should be set up since you previously sourced
- the
- <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>
- script.
- If it is not, source the script again from <filename>poky</filename>.
- <literallayout class='monospaced'>
- $ cd ~/poky
- $ source &OE_INIT_FILE;
- </literallayout>
- </para></listitem>
- <listitem><para><emphasis>Clean up</emphasis>:
- Be sure to clean the shared state out by using BitBake
- to run from within the Build Directory the
- <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-cleansstate'><filename>do_cleansstate</filename></ulink>
- task as follows:
- <literallayout class='monospaced'>
- $ bitbake -c cleansstate linux-yocto
- </literallayout></para>
- <para>
- <note>
- Never remove any files by hand from the
- <filename>tmp/deploy</filename>
- directory inside the
- <link linkend='build-directory'>Build Directory</link>.
- Always use the various BitBake clean tasks to
- clear out previous build artifacts.
- For information on the clean tasks, see the
- "<ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-clean'><filename>do_clean</filename></ulink>",
- "<ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-cleanall'><filename>do_cleanall</filename></ulink>",
- and
- "<ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-cleansstate'><filename>do_cleansstate</filename></ulink>"
- sections all in the Yocto Project Reference
- Manual.
- </note>
- </para></listitem>
- <listitem><para><emphasis>Build the image</emphasis>:
- Next, build the kernel image using this command:
- <literallayout class='monospaced'>
- $ bitbake -k linux-yocto
- </literallayout></para></listitem>
- </orderedlist>
- </para>
- </section>
-
- <section id='boot-the-image-and-verify-your-changes'>
- <title>Boot the Image and Verify Your Changes</title>
-
- <para>
- These steps boot the image and allow you to see the changes
- <orderedlist>
- <listitem><para><emphasis>Boot the image</emphasis>:
- Boot the modified image in the QEMU emulator
- using this command:
- <literallayout class='monospaced'>
- $ runqemu qemux86
- </literallayout></para></listitem>
- <listitem><para><emphasis>Verify the changes</emphasis>:
- Log into the machine using <filename>root</filename> with no password and then
- use the following shell command to scroll through the console's boot output.
- <literallayout class='monospaced'>
- # dmesg | less
- </literallayout>
- You should see the results of your <filename>printk</filename> statements
- as part of the output.</para></listitem>
- </orderedlist>
- </para>
- </section>
</section>
<section id='making-images-more-secure'>
@@ -6812,7 +5951,7 @@
The security flags are in the
<filename>meta/conf/distro/include/security_flags.inc</filename>
file in your
- <link linkend='source-directory'>Source Directory</link>
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
(e.g. <filename>poky</filename>).
<note>
Depending on the recipe, certain security flags are enabled
@@ -6932,8 +6071,8 @@
<para>
When you build an image using the Yocto Project and
do not alter any distribution
- <link linkend='metadata'>Metadata</link>, you are creating a
- Poky distribution.
+ <ulink url='&YOCTO_DOCS_REF_URL;#metadata'>Metadata</ulink>,
+ you are creating a Poky distribution.
If you wish to gain more control over package alternative
selections, compile-time options, and other low-level
configurations, you can create your own distribution.
@@ -6956,7 +6095,7 @@
configuration file makes it easier to reproduce the same
build configuration when using multiple build machines.
See the
- "<link linkend='creating-a-general-layer-using-the-yocto-layer-script'>Creating a General Layer Using the yocto-layer Script</link>"
+ "<link linkend='creating-a-general-layer-using-the-bitbake-layers-script'>Creating a General Layer Using the <filename>bitbake-layers</filename> Script</link>"
section for information on how to quickly set up a layer.
</para></listitem>
<listitem><para><emphasis>Create the distribution configuration file:</emphasis>
@@ -7019,7 +6158,7 @@
previous bulleted item.</para></listitem>
<listitem><para><emphasis>Point to Your distribution configuration file:</emphasis>
In your <filename>local.conf</filename> file in the
- <link linkend='build-directory'>Build Directory</link>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>,
set your
<ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO'><filename>DISTRO</filename></ulink>
variable to point to your distribution's configuration file.
@@ -7044,7 +6183,7 @@
on how to add recipes to your layer, see the
"<link linkend='creating-your-own-layer'>Creating Your Own Layer</link>"
and
- "<link linkend='best-practices-to-follow-when-creating-layers'>Best Practices to Follow When Creating Layers</link>"
+ "<link linkend='best-practices-to-follow-when-creating-layers'>Following Best Practices When Creating Layers</link>"
sections.</para></listitem>
<listitem><para>Add any image recipes that are specific
to your distribution.</para></listitem>
@@ -7079,7 +6218,7 @@
<filename>TEMPLATECONF</filename> to locate the directory
from which it gathers configuration information that ultimately
ends up in the
- <link linkend='build-directory'>Build Directory's</link>
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
<filename>conf</filename> directory.
By default, <filename>TEMPLATECONF</filename> is set as
follows in the <filename>poky</filename> repository:
@@ -7106,7 +6245,7 @@
The <filename>TEMPLATECONF</filename> variable is set in the
<filename>.templateconf</filename> file, which is in the
top-level
- <link linkend='source-directory'>Source Directory</link>
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
folder (e.g. <filename>poky</filename>).
Edit the <filename>.templateconf</filename> so that it can locate
your directory.
@@ -7137,12 +6276,10 @@
Aside from the <filename>*.sample</filename> configuration files,
the <filename>conf-notes.txt</filename> also resides in the
default <filename>meta-poky/conf</filename> directory.
- The scripts that set up the build environment
+ The script that sets up the build environment
(i.e.
- <ulink url="&YOCTO_DOCS_REF_URL;#structure-core-script"><filename>&OE_INIT_FILE;</filename></ulink>
- and
- <ulink url="&YOCTO_DOCS_REF_URL;#structure-memres-core-script"><filename>oe-init-build-env-memres</filename></ulink>)
- use this file to display BitBake targets as part of the script
+ <ulink url="&YOCTO_DOCS_REF_URL;#structure-core-script"><filename>&OE_INIT_FILE;</filename></ulink>)
+ uses this file to display BitBake targets as part of the script
output.
Customizing this <filename>conf-notes.txt</filename> file is a
good way to make sure your list of custom targets appears
@@ -7296,7 +6433,7 @@
<para>
To help you see where you currently are with kernel and root
filesystem sizes, you can use two tools found in the
- <link linkend='source-directory'>Source Directory</link> in
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink> in
the <filename>scripts/tiny/</filename> directory:
<itemizedlist>
<listitem><para><filename>ksize.py</filename>: Reports
@@ -7328,10 +6465,10 @@
<filename>scripts/kconfig</filename> directory.</para>
<para>For more information on configuration fragments,
see the
- "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#generating-configuration-files'>Generating Configuration Files</ulink>"
- section of the Yocto Project Linux Kernel Development
- Manual and the "<link linkend='creating-config-fragments'>Creating Configuration Fragments</link>"
- section, which is in this manual.</para></listitem>
+ "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#creating-config-fragments'>Creating Configuration Fragments</ulink>"
+ section in the Yocto Project Linux Kernel Development
+ Manual.
+ </para></listitem>
<listitem><para><filename>bitbake -u taskexp -g <replaceable>bitbake_target</replaceable></filename>:
Using the BitBake command with these options brings up
a Dependency Explorer from which you can view file
@@ -7957,7 +7094,7 @@
<para>
As mentioned, attempting to maintain revision numbers in the
- <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink>
+ <ulink url='&YOCTO_DOCS_REF_URL;#metadata'>Metadata</ulink>
is error prone, inaccurate, and causes problems for people
submitting recipes.
Conversely, the PR Service automatically generates
@@ -8032,7 +7169,7 @@
setting
<ulink url='&YOCTO_DOCS_REF_URL;#var-PRSERV_HOST'><filename>PRSERV_HOST</filename></ulink>
in your <filename>local.conf</filename> file in the
- <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>:
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>:
<literallayout class='monospaced'>
PRSERV_HOST = "localhost:0"
</literallayout>
@@ -8333,7 +7470,7 @@
<filename>connman.inc</filename> file in the
<filename>meta/recipes-connectivity/connman/</filename>
directory of the <filename>poky</filename>
- <link linkend='yocto-project-repositories'>source repository</link>.
+ <ulink url='&YOCTO_DOCS_REF_URL;#yocto-project-repositories'>source repository</ulink>.
You can also find examples in
<filename>meta/classes/kernel.bbclass</filename>.
</para>
@@ -8568,7 +7705,7 @@
<listitem><para>
Open the <filename>local.conf</filename> file
inside your
- <link linkend='build-directory'>Build Directory</link>
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
(e.g. <filename>~/poky/build/conf/local.conf</filename>).
</para></listitem>
<listitem><para>
@@ -8738,7 +7875,7 @@
file with the following content:
<literallayout class='monospaced'>
[oe-packages]
- baseurl="http://my.server/rpm/i586 http://my.server/rpm/qemux86 http://my.server/rpm/all"
+ baseurl=http://my.server/rpm/i586 http://my.server/rpm/qemux86 http://my.server/rpm/all
</literallayout>
From the target machine, fetch the repository:
<literallayout class='monospaced'>
@@ -8920,13 +8057,10 @@
<para>
In addition to being able to sign RPM packages, you can
- also enable the OpenEmbedded build system to be able to
- handle previously signed package feeds for IPK
- packages.
- <note>
- The OpenEmbedded build system does not currently
- support signed DPKG or RPM package feeds.
- </note>
+ also enable signed package feeds for IPK and RPM packages.
+ </para>
+
+ <para>
The steps you need to take to enable signed package feed
use are similar to the steps used to sign RPM packages.
You must define the following in your
@@ -9026,7 +8160,7 @@
and <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_IMAGE_FEATURES'><filename>EXTRA_IMAGE_FEATURES</filename></ulink>
variables to your <filename>local.conf</filename> file,
which is found in the
- <link linkend='build-directory'>Build Directory</link>:
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>:
<literallayout class='monospaced'>
DISTRO_FEATURES_append = " ptest"
EXTRA_IMAGE_FEATURES += "ptest-pkgs"
@@ -9262,8 +8396,8 @@
<para>
By default, the OpenEmbedded build system uses the
- <link linkend='build-directory'>Build Directory</link> when
- building source code.
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
+ when building source code.
The build process involves fetching the source files, unpacking
them, and then patching them if necessary before the build takes
place.
@@ -9627,7 +8761,7 @@
Using either of the following statements in your
image recipe or from within the
<filename>local.conf</filename> file found in the
- <link linkend='build-directory'>Build Directory</link>
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
causes the build system to create a read-only root filesystem:
<literallayout class='monospaced'>
IMAGE_FEATURES = "read-only-rootfs"
@@ -10221,7 +9355,7 @@
<ulink url='&YOCTO_DOCS_REF_URL;#var-TEST_IMAGE'><filename>TEST_IMAGE</filename></ulink>
variable to "1" in your <filename>local.conf</filename>
file in the
- <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>:
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>:
<literallayout class='monospaced'>
TEST_IMAGE = "1"
</literallayout>
@@ -10249,7 +9383,7 @@
<para>
All test files reside in
<filename>meta/lib/oeqa/runtime</filename> in the
- <link linkend='source-directory'>Source Directory</link>.
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>.
A test name maps directly to a Python module.
Each test module may contain a number of individual tests.
Tests are usually grouped together by the area
@@ -10353,7 +9487,8 @@
$ bitbake <replaceable>image</replaceable> -c testexport
</literallayout>
Exporting the tests places them in the
- <link linkend='build-directory'>Build Directory</link> in
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
+ in
<filename>tmp/testexport/</filename><replaceable>image</replaceable>,
which is controlled by the
<filename>TEST_EXPORT_DIR</filename> variable.
@@ -10893,182 +10028,6 @@
</para>
</section>
-<!--
- <section id='platdev-gdb-remotedebug-setup'>
- <title>Set Up the Cross-Development Debugging Environment</title>
-
- <para>
- Before you can initiate a remote debugging session, you need
- to be sure you have set up the cross-development environment,
- toolchain, and sysroot.
- The <ulink url='&YOCTO_DOCS_SDK_URL;#sdk-intro'>Yocto Project Software Development Kit (SDK) Developer's Guide</ulink>
- describes this process.
- </para>
- </section>
-
- <section id="platdev-gdb-remotedebug-launch-gdbserver">
- <title>Launch gdbserver on the Target</title>
-
- <para>
- Make sure gdbserver is installed on the target.
- If it is not, install the package
- <filename>gdbserver</filename>, which needs the
- <filename>libthread-db1</filename> package.
- </para>
-
- <para>
- Here is an example, that when entered from the host,
- connects to the target and launches gdbserver in order to
- "debug" a binary named <filename>helloworld</filename>:
- <literallayout class='monospaced'>
- $ gdbserver localhost:2345 /usr/bin/helloworld
- </literallayout>
- gdbserver should now be listening on port 2345 for debugging
- commands coming from a remote GDB process that is running on
- the host computer.
- Communication between gdbserver and the host GDB are done
- using TCP.
- To use other communication protocols, please refer to the
- <ulink url='http://www.gnu.org/software/gdb/'>Gdbserver documentation</ulink>.
- </para>
- </section>
-
- <section id="platdev-gdb-remotedebug-launch-gdb">
- <title>Launch GDB on the Host Computer</title>
-
- <para>
- Running GDB on the host computer takes a number of stages, which
- this section describes.
- </para>
-
- <section id="platdev-gdb-remotedebug-launch-gdb-buildcross">
- <title>Build the Cross-GDB Package</title>
- <para>
- A suitable GDB cross-binary is required that runs on your
- host computer but also knows about the the ABI of the
- remote target.
- You can get this binary from the
- <link linkend='cross-development-toolchain'>Cross-Development Toolchain</link>.
- Here is an example where the toolchain has been installed
- in the default directory
- <filename>/opt/poky/&DISTRO;</filename>:
- <literallayout class='monospaced'>
- /opt/poky/&DISTRO;/sysroots/i686-pokysdk-linux/usr/bin/armv7a-vfp-neon-poky-linux-gnueabi/arm-poky-linux-gnueabi-gdb
- </literallayout>
- where <filename>arm</filename> is the target architecture
- and <filename>linux-gnueabi</filename> is the target ABI.
- </para>
-
- <para>
- Alternatively, you can use BitBake to build the
- <filename>gdb-cross</filename> binary.
- Here is an example:
- <literallayout class='monospaced'>
- $ bitbake gdb-cross
- </literallayout>
- Once the binary is built, you can find it here:
- <literallayout class='monospaced'>
- tmp/sysroots/<replaceable>host-arch</replaceable>/usr/bin/<replaceable>target-platform</replaceable>/<replaceable>target-abi</replaceable>-gdb
- </literallayout>
- </para>
- </section>
-
- <section id='create-the-gdb-initialization-file'>
- <title>Create the GDB Initialization File and Point to Your Root Filesystem</title>
-
- <para>
- Aside from the GDB cross-binary, you also need a GDB
- initialization file in the same top directory in which
- your binary resides.
- When you start GDB on your host development system, GDB
- finds this initialization file and executes all the
- commands within.
- For information on the <filename>.gdbinit</filename>, see
- "<ulink url='http://sourceware.org/gdb/onlinedocs/gdb/'>Debugging with GDB</ulink>",
- which is maintained by
- <ulink url='http://www.sourceware.org'>sourceware.org</ulink>.
- </para>
-
- <para>
- You need to add a statement in the
- <filename>~/.gdbinit</filename> file that points to your
- root filesystem.
- Here is an example that points to the root filesystem for
- an ARM-based target device:
- <literallayout class='monospaced'>
- set sysroot ~/sysroot_arm
- </literallayout>
- </para>
- </section>
-
- <section id="platdev-gdb-remotedebug-launch-gdb-launchhost">
- <title>Launch the Host GDB</title>
-
- <para>
- Before launching the host GDB, you need to be sure
- you have sourced the cross-debugging environment script,
- which if you installed the root filesystem in the default
- location is at <filename>/opt/poky/&DISTRO;</filename>
- and begins with the string "environment-setup".
- For more information, see the
- <ulink url='&YOCTO_DOCS_SDK_URL;#sdk-manual'>Yocto Project Software Development Kit (SDK) Developer's
- Guide</ulink>.
- </para>
-
- <para>
- Finally, switch to the directory where the binary resides
- and run the <filename>cross-gdb</filename> binary.
- Provide the binary file you are going to debug.
- For example, the following command continues with the
- example used in the previous section by loading
- the <filename>helloworld</filename> binary as well as the
- debugging information:
- <literallayout class='monospaced'>
- $ arm-poky-linux-gnuabi-gdb helloworld
- </literallayout>
- The commands in your <filename>.gdbinit</filename> execute
- and the GDB prompt appears.
- </para>
- </section>
- </section>
-
- <section id='platdev-gdb-connect-to-the-remote-gdb-server'>
- <title>Connect to the Remote GDB Server</title>
-
- <para>
- From the target, you need to connect to the remote GDB
- server that is running on the host.
- You need to specify the remote host and port.
- Here is the command continuing with the example:
- <literallayout class='monospaced'>
- target remote 192.168.7.2:2345
- </literallayout>
- </para>
- </section>
-
- <section id="platdev-gdb-remotedebug-launch-gdb-using">
- <title>Use the Debugger</title>
-
- <para>
- You can now proceed with debugging as normal - as if you were debugging
- on the local machine.
- For example, to instruct GDB to break in the "main" function and then
- continue with execution of the inferior binary use the following commands
- from within GDB:
- <literallayout class='monospaced'>
- (gdb) break main
- (gdb) continue
- </literallayout>
- </para>
-
- <para>
- For more information about using GDB, see the project's online documentation at
- <ulink url="http://sourceware.org/gdb/download/onlinedocs/"/>.
- </para>
- </section>
- </section>
--->
-
<section id='debugging-with-the-gnu-project-debugger-gdb-on-the-target'>
<title>Debugging with the GNU Project Debugger (GDB) on the Target</title>
@@ -11347,7 +10306,7 @@
Once the patch file exists, you need to add it back to the
originating recipe folder.
Here is an example assuming a top-level
- <link linkend='source-directory'>Source Directory</link>
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
named <filename>poky</filename>:
<literallayout class='monospaced'>
$ cp patches/parallelmake.patch poky/meta/recipes-connectivity/neard/neard
@@ -11407,7 +10366,7 @@
need to submit the fix for the recipe in OE-Core and upstream
so that the problem is taken care of at its source.
See the
- "<link linkend='how-to-submit-a-change'>How to Submit a Change</link>"
+ "<link linkend='how-to-submit-a-change'>Submitting a Change to the Yocto Project</link>"
section for more information.
</para>
</section>
@@ -11510,7 +10469,7 @@
release just the source as a tarball.
You can do this by adding the following to the
<filename>local.conf</filename> file found in the
- <link linkend='build-directory'>Build Directory</link>:
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>:
<literallayout class='monospaced'>
INHERIT += "archiver"
ARCHIVER_MODE[src] = "original"
@@ -11678,8 +10637,8 @@
"
</literallayout>
Creating and providing an archive of the
- <link linkend='metadata'>Metadata</link> layers
- (recipes, configuration files, and so forth)
+ <ulink url='&YOCTO_DOCS_REF_URL;#metadata'>Metadata</ulink>
+ layers (recipes, configuration files, and so forth)
enables you to meet your
requirements to include the scripts to control compilation
as well as any modifications to the original source.
@@ -11697,7 +10656,7 @@
browse errors, view statistics, and query for errors.
The tool works using a client-server system where the client
portion is integrated with the installed Yocto Project
- <link linkend='source-directory'>Source Directory</link>
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
(e.g. <filename>poky</filename>).
The server receives the information collected and saves it in a
database.
@@ -11725,7 +10684,7 @@
<ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-report-error'><filename>report-error</filename></ulink>
class by adding the following statement to the end of
your <filename>local.conf</filename> file in your
- <link linkend='build-directory'>Build Directory</link>.
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>.
<literallayout class='monospaced'>
INHERIT += "report-error"
</literallayout>
@@ -11784,7 +10743,7 @@
To disable the error reporting feature, simply remove or comment
out the following statement from the end of your
<filename>local.conf</filename> file in your
- <link linkend='build-directory'>Build Directory</link>.
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>.
<literallayout class='monospaced'>
INHERIT += "report-error"
</literallayout>
diff --git a/import-layers/yocto-poky/documentation/dev-manual/dev-manual-intro.xml b/import-layers/yocto-poky/documentation/dev-manual/dev-manual-intro.xml
index 49148ab..47c8006 100644
--- a/import-layers/yocto-poky/documentation/dev-manual/dev-manual-intro.xml
+++ b/import-layers/yocto-poky/documentation/dev-manual/dev-manual-intro.xml
@@ -4,102 +4,73 @@
<chapter id='dev-manual-intro'>
-<title>The Yocto Project Development Manual</title>
- <section id='dev-intro'>
- <title>Introduction</title>
+<title>The Yocto Project Development Tasks Manual</title>
+ <section id='dev-welcome'>
+ <title>Welcome</title>
<para>
- Welcome to the Yocto Project Development Manual!
- This manual provides information on how to use the Yocto Project to
- develop embedded Linux images and user-space applications that
- run on targeted devices.
- The manual provides an overview of image, kernel, and
- user-space application development using the Yocto Project.
- Because much of the information in this manual is general, it
- contains many references to other sources where you can find more
- detail.
- For example, you can find detailed information on Git, repositories,
- and open source in general in many places on the Internet.
- Another example specific to the Yocto Project is how to quickly
- set up your host development system and build an image, which you
- find in the
- <ulink url='&YOCTO_DOCS_QS_URL;'>Yocto Project Quick Start</ulink>.
+ Welcome to the Yocto Project Development Tasks Manual!
+ This manual provides relevant procedures necessary for developing
+ in the Yocto Project environment (i.e. developing embedded Linux
+ images and user-space applications that run on targeted devices).
+ The manual groups related procedures into higher-level sections.
+ Procedures can consist of high-level steps or low-level steps
+ depending on the topic.
+ You can find conceptual information related to a procedure by
+ following appropriate links to the Yocto Project Reference
+ Manual.
</para>
<para>
- The Yocto Project Development Manual does, however, provide
- guidance and examples on how to change the kernel source code,
- reconfigure the kernel, and develop an application using
- <filename>devtool</filename>.
- </para>
-
- <note>
- By default, using the Yocto Project creates a Poky distribution.
- However, you can create your own distribution by providing key
- <link linkend='metadata'>Metadata</link>.
- A good example is Angstrom, which has had a distribution
- based on the Yocto Project since its inception.
- Other examples include commercial distributions like
- <ulink url='https://www.yoctoproject.org/organization/wind-river-systems'>Wind River Linux</ulink>,
- <ulink url='https://www.yoctoproject.org/organization/mentor-graphics'>Mentor Embedded Linux</ulink>,
- <ulink url='https://www.yoctoproject.org/organization/enea-ab'>ENEA Linux</ulink>
- and <ulink url='https://www.yoctoproject.org/ecosystem/member-organizations'>others</ulink>.
- See the "<link linkend='creating-your-own-distribution'>Creating Your Own Distribution</link>"
- section for more information.
- </note>
- </section>
-
- <section id='what-this-manual-provides'>
- <title>What This Manual Provides</title>
-
- <para>
The following list describes what you can get from this manual:
<itemizedlist>
- <listitem><para>Information that lets you get set
- up to develop using the Yocto Project.</para></listitem>
- <listitem><para>Information to help developers who are new to
- the open source environment and to the distributed revision
- control system Git, which the Yocto Project uses.
+ <listitem><para>
+ <emphasis>Setup Procedures:</emphasis>
+ Procedures that show you how to set
+ up a Yocto Project Development environment and how
+ to accomplish the change workflow through logging
+ defects and submitting changes.
</para></listitem>
- <listitem><para>An understanding of common end-to-end
- development models and tasks.</para></listitem>
- <listitem><para>Information about common development tasks
- generally used during image development for
- embedded devices.
+ <listitem><para>
+ <emphasis>Emulation Procedures:</emphasis>
+ Procedures that show you how to use the
+ Yocto Project integrated QuickEMUlator (QEMU), which lets
+ you simulate running on hardware an image you have built
+ using the OpenEmbedded build system.
</para></listitem>
- <listitem><para>Information on using the Yocto Project
- integration of the QuickEMUlator (QEMU), which lets you
- simulate running on hardware an image you have built using
- the OpenEmbedded build system.
+ <listitem><para>
+ <emphasis>Common Procedures:</emphasis>
+ Procedures related to "everyday" tasks you perform while
+ developing images and applications using the Yocto
+ Project.
</para></listitem>
- <listitem><para>Many references to other sources of related
- information.</para></listitem>
</itemizedlist>
</para>
- </section>
-
- <section id='what-this-manual-does-not-provide'>
- <title>What this Manual Does Not Provide</title>
<para>
This manual will not give you the following:
<itemizedlist>
- <listitem><para><emphasis>Step-by-step instructions when those instructions exist in other Yocto
- Project documentation:</emphasis>
+ <listitem><para>
+ <emphasis>Redundant Step-by-step Instructions:</emphasis>
For example, the
- <ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Software Development Kit (SDK) Developer's Guide</ulink>
+ <ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Application Development and the Extensible Software Development Kit (eSDK)</ulink>
manual contains detailed instructions on how to install an
SDK, which is used to develop applications for target
hardware.
</para></listitem>
- <listitem><para><emphasis>Reference material:</emphasis>
+ <listitem><para>
+ <emphasis>Reference or Conceptual Material:</emphasis>
This type of material resides in an appropriate reference manual.
For example, system variables are documented in the
<ulink url='&YOCTO_DOCS_REF_URL;'>Yocto Project Reference Manual</ulink>.
</para></listitem>
- <listitem><para><emphasis>Detailed public information that is not specific to the Yocto Project:</emphasis>
- For example, exhaustive information on how to use Git is covered better through the
- Internet than in this manual.
+ <listitem><para>
+ <emphasis>Detailed Public Information Not Specific to the
+ Yocto Project:</emphasis>
+ For example, exhaustive information on how to use the
+ Source Control Manager Git is better covered with Internet
+ searches and official Git Documentation than through the
+ Yocto Project documentation.
</para></listitem>
</itemizedlist>
</para>
@@ -109,144 +80,23 @@
<title>Other Information</title>
<para>
- Because this manual presents overview information for many different
+ Because this manual presents information for many different
topics, supplemental information is recommended for full
comprehension.
- The following list presents other sources of information you might find helpful:
- <itemizedlist>
- <listitem><para><emphasis><ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink>:
- </emphasis> The home page for the Yocto Project provides lots of information on the project
- as well as links to software and documentation.
- </para></listitem>
- <listitem><para><emphasis>
- <ulink url='&YOCTO_DOCS_QS_URL;'>Yocto Project Quick Start</ulink>:</emphasis>
- This short document lets you get started
- with the Yocto Project and quickly begin building an image.
- </para></listitem>
- <listitem><para><emphasis>
- <ulink url='&YOCTO_DOCS_REF_URL;'>Yocto Project Reference Manual</ulink>:</emphasis>
- This manual is a reference
- guide to the OpenEmbedded build system, which is based on BitBake.
- The build system is sometimes referred to as "Poky".
- </para></listitem>
- <listitem><para><emphasis>
- <ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Software Development Kit (SDK) Developer's Guide</ulink>:</emphasis>
- This guide provides information that lets you get going
- with the standard or extensible SDK.
- An SDK, with its cross-development toolchains, allows you
- to develop projects inside or outside of the Yocto Project
- environment.
- </para></listitem>
- <listitem><para><emphasis>
- <ulink url='&YOCTO_DOCS_BSP_URL;'>Yocto Project Board Support Package (BSP) Developer's Guide</ulink>:</emphasis>
- This guide defines the structure for BSP components.
- Having a commonly understood structure encourages standardization.
- </para></listitem>
- <listitem><para><emphasis>
- <ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;'>Yocto Project Linux Kernel Development Manual</ulink>:</emphasis>
- This manual describes how to work with Linux Yocto kernels as well as provides a bit
- of conceptual information on the construction of the Yocto Linux kernel tree.
- </para></listitem>
- <listitem><para><emphasis>
- <ulink url='&YOCTO_DOCS_PROF_URL;'>Yocto Project Profiling and Tracing Manual</ulink>:</emphasis>
- This manual presents a set of common and generally useful tracing and
- profiling schemes along with their applications (as appropriate) to each tool.
- </para></listitem>
- <listitem><para><emphasis>
- <ulink url='&YOCTO_DOCS_TOAST_URL;'>Toaster User Manual</ulink>:</emphasis>
- This manual introduces and describes how to set up and use
- Toaster, which is a web interface to the Yocto Project's
- <link linkend='build-system-term'>OpenEmbedded Build System</link>.
- </para></listitem>
-<!--
- <listitem><para><emphasis>
- <ulink url='http://www.youtube.com/watch?v=3ZlOu-gLsh0'>
- Eclipse IDE Yocto Plug-in</ulink>:</emphasis>
- A step-by-step instructional video that
- demonstrates how an application developer uses Yocto Plug-in features within
- the Eclipse IDE.
- </para></listitem>
--->
- <listitem><para><emphasis>
- <ulink url='&YOCTO_DOCS_SDK_URL;#sdk-appendix-latest-yp-eclipse-plug-in'>Eclipse IDE Yocto Plug-in</ulink>:</emphasis>
- Instructions that demonstrate how an application developer
- uses the Eclipse Yocto Project Plug-in feature within
- the Eclipse IDE.
- </para></listitem>
- <listitem><para><emphasis>
- <ulink url='&YOCTO_WIKI_URL;/wiki/FAQ'>FAQ</ulink>:</emphasis>
- A list of commonly asked questions and their answers.
- </para></listitem>
- <listitem><para><emphasis>
- <ulink url='&YOCTO_RELEASE_NOTES;'>Release Notes</ulink>:</emphasis>
- Features, updates and known issues for the current
- release of the Yocto Project.
- </para></listitem>
- <listitem><para><emphasis>
- <ulink url='&YOCTO_HOME_URL;/tools-resources/projects/toaster'>Toaster</ulink>:</emphasis>
- An Application Programming Interface (API) and web-based
- interface to the OpenEmbedded build system, which uses
- BitBake, that reports build information.
- </para></listitem>
- <listitem><para><emphasis>
- <ulink url='&YOCTO_HOME_URL;/tools-resources/projects/build-appliance'>Build Appliance</ulink>:</emphasis>
- A virtual machine that
- enables you to build and boot a custom embedded Linux image
- with the Yocto Project using a non-Linux development system.
- </para></listitem>
- <listitem><para><emphasis>
- <ulink url='&YOCTO_BUGZILLA_URL;'>Bugzilla</ulink>:</emphasis>
- The bug tracking application the Yocto Project uses.
- If you find problems with the Yocto Project, you should report them using this
- application.
- </para></listitem>
- <listitem><para><emphasis>Yocto Project Mailing Lists:</emphasis>
- To subscribe to the Yocto Project mailing
- lists, click on the following URLs and follow the instructions:
- <itemizedlist>
- <listitem><para><ulink url='&YOCTO_LISTS_URL;/listinfo/yocto'></ulink>
- for a Yocto Project Discussions mailing list.
- </para></listitem>
- <listitem><para><ulink url='&YOCTO_LISTS_URL;/listinfo/poky'></ulink>
- for a Yocto Project Discussions mailing list about the
- OpenEmbedded build system (Poky).
- </para></listitem>
- <listitem><para><ulink url='&YOCTO_LISTS_URL;/listinfo/yocto-announce'></ulink>
- for a mailing list to receive official Yocto Project announcements
- as well as Yocto Project milestones.
- </para></listitem>
- <listitem><para><ulink url='&YOCTO_LISTS_URL;/listinfo'></ulink>
- for a listing of all public mailing lists on
- <filename>lists.yoctoproject.org</filename>.
- </para></listitem>
- </itemizedlist></para></listitem>
- <listitem><para><emphasis>Internet Relay Chat (IRC):</emphasis>
- Two IRC channels on freenode are available
- for Yocto Project and Poky discussions: <filename>#yocto</filename> and
- <filename>#poky</filename>, respectively.
- </para></listitem>
- <listitem><para><emphasis>
- <ulink url='&OE_HOME_URL;'>OpenEmbedded</ulink>:</emphasis>
- The build system used by the Yocto Project.
- This project is the upstream, generic, embedded distribution
- from which the Yocto Project derives its build system (Poky)
- and to which it contributes.
- </para></listitem>
- <listitem><para><emphasis>
- <ulink url='http://www.openembedded.org/wiki/BitBake'>BitBake</ulink>:</emphasis>
- The tool used by the OpenEmbedded build system
- to process project metadata.
- </para></listitem>
- <listitem><para><emphasis>
- <ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual:</ulink></emphasis>
- A comprehensive guide to the BitBake tool.
- If you want information on BitBake, see this manual.
- </para></listitem>
- <listitem><para><emphasis>
- <ulink url='http://wiki.qemu.org/Index.html'>Quick EMUlator (QEMU)</ulink>:</emphasis>
- An open-source machine emulator and virtualizer.
- </para></listitem>
- </itemizedlist>
+ For introductory information on the Yocto Project, see the
+ <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink>.
+ You can find an introductory to using the Yocto Project by working
+ through the
+ <ulink url='&YOCTO_DOCS_QS_URL;'>Yocto Project Quick Start</ulink>.
+ </para>
+
+ <para>
+ For a comprehensive list of links and other documentation, see the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#resources-links-and-related-documentation'>Links and Related Documentation</ulink>"
+ section in the Yocto Project Reference Manual.
+ </para>
+
+ <para>
</para>
</section>
</chapter>
diff --git a/import-layers/yocto-poky/documentation/dev-manual/dev-manual-model.xml b/import-layers/yocto-poky/documentation/dev-manual/dev-manual-model.xml
deleted file mode 100644
index 1008e11..0000000
--- a/import-layers/yocto-poky/documentation/dev-manual/dev-manual-model.xml
+++ /dev/null
@@ -1,1654 +0,0 @@
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
-"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
-[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
-
-<chapter id='dev-manual-model'>
-
-<title>Common Development Models</title>
-
-<para>
- Many development models exist for which you can use the Yocto Project.
- This chapter overviews simple methods that use tools provided by the
- Yocto Project:
- <itemizedlist>
- <listitem><para><emphasis>System Development:</emphasis>
- System Development covers Board Support Package (BSP) development
- and kernel modification or configuration.
- For an example on how to create a BSP, see the
- "<ulink url='&YOCTO_DOCS_BSP_URL;#creating-a-new-bsp-layer-using-the-yocto-bsp-script'>Creating a New BSP Layer Using the yocto-bsp Script</ulink>"
- section in the Yocto Project Board Support Package (BSP)
- Developer's Guide.
- For more complete information on how to work with the kernel,
- see the
- <ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;'>Yocto Project Linux Kernel Development Manual</ulink>.
- </para></listitem>
- <listitem><para><emphasis>User Application Development:</emphasis>
- User Application Development covers development of applications
- that you intend to run on target hardware.
- For information on how to set up your host development system for
- user-space application development, see the
- <ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Software Development Kit (SDK) Developer's Guide</ulink>.
- For a simple example of user-space application development using
- the <trademark class='trade'>Eclipse</trademark> IDE, see the
- "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-developing-applications-using-eclipse'>Developing Applications Using <trademark class='trade'>Eclipse</trademark></ulink>" section.
- </para></listitem>
- <listitem><para><emphasis>Temporary Source Code Modification:</emphasis>
- Direct modification of temporary source code is a convenient
- development model to quickly iterate and develop towards a
- solution.
- Once you implement the solution, you should of course take
- steps to get the changes upstream and applied in the affected
- recipes.
- </para></listitem>
- <listitem><para><emphasis>Image Development using Toaster:</emphasis>
- You can use <ulink url='&YOCTO_HOME_URL;/Tools-resources/projects/toaster'>Toaster</ulink>
- to build custom operating system images within the build
- environment.
- Toaster provides an efficient interface to the OpenEmbedded build
- that allows you to start builds and examine build statistics.
- </para></listitem>
- <listitem><para><emphasis>Using a Development Shell:</emphasis>
- You can use a
- <link linkend='platdev-appdev-devshell'><filename>devshell</filename></link>
- to efficiently debug
- commands or simply edit packages.
- Working inside a development shell is a quick way to set up the
- OpenEmbedded build environment to work on parts of a project.
- </para></listitem>
- </itemizedlist>
-</para>
-
-<section id='system-development-model'>
- <title>System Development Workflow</title>
-
- <para>
- System development involves modification or creation of an image that you want to run on
- a specific hardware target.
- Usually, when you want to create an image that runs on embedded hardware, the image does
- not require the same number of features that a full-fledged Linux distribution provides.
- Thus, you can create a much smaller image that is designed to use only the
- features for your particular hardware.
- </para>
-
- <para>
- To help you understand how system development works in the Yocto Project, this section
- covers two types of image development: BSP creation and kernel modification or
- configuration.
- </para>
-
- <section id='developing-a-board-support-package-bsp'>
- <title>Developing a Board Support Package (BSP)</title>
-
- <para>
- A BSP is a collection of recipes that, when applied during a build, results in
- an image that you can run on a particular board.
- Thus, the package when compiled into the new image, supports the operation of the board.
- </para>
-
- <note>
- For a brief list of terms used when describing the development process in the Yocto Project,
- see the "<link linkend='yocto-project-terms'>Yocto Project Terms</link>" section.
- </note>
-
- <para>
- The remainder of this section presents the basic
- steps used to create a BSP using the Yocto Project's
- <ulink url='&YOCTO_DOCS_BSP_URL;#using-the-yocto-projects-bsp-tools'>BSP Tools</ulink>.
- Although not required for BSP creation, the
- <filename>meta-intel</filename> repository, which contains
- many BSPs supported by the Yocto Project, is part of the example.
- </para>
-
- <para>
- For an example that shows how to create a new layer using the tools, see the
- "<ulink url='&YOCTO_DOCS_BSP_URL;#creating-a-new-bsp-layer-using-the-yocto-bsp-script'>Creating a New BSP Layer Using the yocto-bsp Script</ulink>"
- section in the Yocto Project Board Support Package (BSP) Developer's Guide.
- </para>
-
- <para>
- The following illustration and list summarize the BSP creation general workflow.
- </para>
-
- <para>
- <imagedata fileref="figures/bsp-dev-flow.png" width="6in" depth="7in" align="center" scalefit="1" />
- </para>
-
- <para>
- <orderedlist>
- <listitem><para><emphasis>Set up your host development system to support
- development using the Yocto Project</emphasis>: See the
- "<ulink url='&YOCTO_DOCS_QS_URL;#the-linux-distro'>The Linux Distribution</ulink>"
- and the
- "<ulink url='&YOCTO_DOCS_QS_URL;#packages'>The Build Host Packages</ulink>" sections both
- in the Yocto Project Quick Start for requirements.</para></listitem>
- <listitem><para><emphasis>Establish a local copy of the project files on your
- system</emphasis>: You need this <link linkend='source-directory'>Source
- Directory</link> available on your host system.
- Having these files on your system gives you access to the build
- process and to the tools you need.
- For information on how to set up the Source Directory,
- see the
- "<link linkend='getting-setup'>Getting Set Up</link>" section.</para></listitem>
- <listitem><para><emphasis>Establish the <filename>meta-intel</filename>
- repository on your system</emphasis>: Having local copies
- of these supported BSP layers on your system gives you
- access to layers you might be able to build on or modify
- to create your BSP.
- For information on how to get these files, see the
- "<link linkend='getting-setup'>Getting Set Up</link>" section.</para></listitem>
- <listitem><para><emphasis>Create your own BSP layer using the
- <ulink url='&YOCTO_DOCS_BSP_URL;#creating-a-new-bsp-layer-using-the-yocto-bsp-script'><filename>yocto-bsp</filename></ulink> script</emphasis>:
- Layers are ideal for
- isolating and storing work for a given piece of hardware.
- A layer is really just a location or area in which you place
- the recipes and configurations for your BSP.
- In fact, a BSP is, in itself, a special type of layer.
- The simplest way to create a new BSP layer that is compliant with the
- Yocto Project is to use the <filename>yocto-bsp</filename> script.
- For information about that script, see the
- "<ulink url='&YOCTO_DOCS_BSP_URL;#creating-a-new-bsp-layer-using-the-yocto-bsp-script'>Creating a New BSP Layer Using the yocto-bsp Script</ulink>"
- section in the Yocto Project Board Support (BSP) Developer's Guide.
- </para>
-
- <para>
- Another example that illustrates a layer
- is an application.
- Suppose you are creating an application that has
- library or other dependencies in order for it to
- compile and run.
- The layer, in this case, would be where all the
- recipes that define those dependencies are kept.
- The key point for a layer is that it is an isolated
- area that contains all the relevant information for
- the project that the OpenEmbedded build system knows
- about.
- For more information on layers, see the
- "<link linkend='understanding-and-creating-layers'>Understanding and Creating Layers</link>"
- section.
- For more information on BSP layers, see the
- "<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-layers'>BSP Layers</ulink>"
- section in the Yocto Project Board Support Package (BSP)
- Developer's Guide.
- <note>
- <para>
- Five BSPs exist that are part of the Yocto Project release:
- <filename>beaglebone</filename> (ARM),
- <filename>mpc8315e</filename> (PowerPC),
- and <filename>edgerouter</filename> (MIPS).
- The recipes and configurations for these five BSPs
- are located and dispersed within the
- <link linkend='source-directory'>Source Directory</link>.
- </para>
-
- <para>
- Three core Intel BSPs exist as part of the Yocto
- Project release in the
- <filename>meta-intel</filename> layer:
- <itemizedlist>
- <listitem><para><filename>intel-core2-32</filename>,
- which is a BSP optimized for the Core2 family of CPUs
- as well as all CPUs prior to the Silvermont core.
- </para></listitem>
- <listitem><para><filename>intel-corei7-64</filename>,
- which is a BSP optimized for Nehalem and later
- Core and Xeon CPUs as well as Silvermont and later
- Atom CPUs, such as the Baytrail SoCs.
- </para></listitem>
- <listitem><para><filename>intel-quark</filename>,
- which is a BSP optimized for the Intel Galileo
- gen1 & gen2 development boards.
- </para></listitem>
- </itemizedlist>
- </para>
- </note>
- </para>
-
- <para>When you set up a layer for a new BSP, you should follow a standard layout.
- This layout is described in the
- "<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-filelayout'>Example Filesystem Layout</ulink>"
- section of the Board Support Package (BSP) Development Guide.
- In the standard layout, you will notice a suggested structure for recipes and
- configuration information.
- You can see the standard layout for a BSP by examining
- any supported BSP found in the <filename>meta-intel</filename> layer inside
- the Source Directory.</para></listitem>
- <listitem><para><emphasis>Make configuration changes to your new BSP
- layer</emphasis>: The standard BSP layer structure organizes the files you need
- to edit in <filename>conf</filename> and several <filename>recipes-*</filename>
- directories within the BSP layer.
- Configuration changes identify where your new layer is on the local system
- and identify which kernel you are going to use.
- When you run the <filename>yocto-bsp</filename> script, you are able to interactively
- configure many things for the BSP (e.g. keyboard, touchscreen, and so forth).
- </para></listitem>
- <listitem><para><emphasis>Make recipe changes to your new BSP layer</emphasis>: Recipe
- changes include altering recipes (<filename>.bb</filename> files), removing
- recipes you do not use, and adding new recipes or append files
- (<filename>.bbappend</filename>) that you need to support your hardware.
- </para></listitem>
- <listitem><para><emphasis>Prepare for the build</emphasis>: Once you have made all the
- changes to your BSP layer, there remains a few things
- you need to do for the OpenEmbedded build system in order for it to create your image.
- You need to get the build environment ready by sourcing an environment setup script
- (i.e. <filename>oe-init-build-env</filename> or
- <filename>oe-init-build-env-memres</filename>)
- and you need to be sure two key configuration files are configured appropriately:
- the <filename>conf/local.conf</filename> and the
- <filename>conf/bblayers.conf</filename> file.
- You must make the OpenEmbedded build system aware of your new layer.
- See the
- "<link linkend='enabling-your-layer'>Enabling Your Layer</link>" section
- for information on how to let the build system know about your new layer.</para>
- <para>The entire process for building an image is overviewed in the section
- "<ulink url='&YOCTO_DOCS_QS_URL;#qs-building-images'>Building Images</ulink>" section
- of the Yocto Project Quick Start.
- You might want to reference this information.</para></listitem>
- <listitem><para><emphasis>Build the image</emphasis>: The OpenEmbedded build system
- uses the BitBake tool to build images based on the type of image you want to create.
- You can find more information about BitBake in the
- <ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual</ulink>.
- </para>
- <para>The build process supports several types of images to satisfy different needs.
- See the
- "<ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Images</ulink>" chapter
- in the Yocto Project Reference Manual for information on
- supported images.</para></listitem>
- </orderedlist>
- </para>
-
- <para>
- You can view a video presentation on "Building Custom Embedded Images with Yocto"
- at <ulink url='http://free-electrons.com/blog/elc-2011-videos'>Free Electrons</ulink>.
- After going to the page, just search for "Embedded".
- You can also find supplemental information in the
- <ulink url='&YOCTO_DOCS_BSP_URL;'>
- Yocto Project Board Support Package (BSP) Developer's Guide</ulink>.
- Finally, there is helpful material and links on this
- <ulink url='&YOCTO_WIKI_URL;/wiki/Transcript:_creating_one_generic_Atom_BSP_from_another'>wiki page</ulink>.
- Although a bit dated, you might find the information on the wiki
- helpful.
- </para>
- </section>
-
- <section id='modifying-the-kernel'>
- <title><anchor id='kernel-spot' />Modifying the Kernel</title>
-
- <para>
- Kernel modification involves changing the Yocto Project kernel, which could involve changing
- configuration options as well as adding new kernel recipes.
- Configuration changes can be added in the form of configuration fragments, while recipe
- modification comes through the kernel's <filename>recipes-kernel</filename> area
- in a kernel layer you create.
- </para>
-
- <para>
- The remainder of this section presents a high-level overview of the Yocto Project
- kernel architecture and the steps to modify the kernel.
- You can reference the
- "<link linkend='patching-the-kernel'>Patching the Kernel</link>" section
- for an example that changes the source code of the kernel.
- For information on how to configure the kernel, see the
- "<link linkend='configuring-the-kernel'>Configuring the Kernel</link>" section.
- For more information on the kernel and on modifying the kernel, see the
- <ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;'>Yocto Project Linux Kernel Development Manual</ulink>.
- </para>
-
- <section id='kernel-overview'>
- <title>Kernel Overview</title>
-
- <para>
- Traditionally, when one thinks of a patched kernel, they think of a base kernel
- source tree and a fixed structure that contains kernel patches.
- The Yocto Project, however, employs mechanisms that, in a sense, result in a kernel source
- generator.
- By the end of this section, this analogy will become clearer.
- </para>
-
- <para>
- You can find a web interface to the Yocto Project kernel source repositories at
- <ulink url='&YOCTO_GIT_URL;'></ulink>.
- If you look at the interface, you will see to the left a grouping of
- Git repositories titled "Yocto Linux Kernel."
- Within this group, you will find several kernels supported by
- the Yocto Project:
- <itemizedlist>
- <listitem><para><emphasis>
- <filename>linux-yocto-3.14</filename></emphasis> - The
- stable Yocto Project kernel to use with the Yocto
- Project Releases 1.6 and 1.7.
- This kernel is based on the Linux 3.14 released kernel.
- </para></listitem>
- <listitem><para><emphasis>
- <filename>linux-yocto-3.17</filename></emphasis> - An
- additional, unsupported Yocto Project kernel used with
- the Yocto Project Release 1.7.
- This kernel is based on the Linux 3.17 released kernel.
- </para></listitem>
- <listitem><para><emphasis>
- <filename>linux-yocto-3.19</filename></emphasis> - The
- stable Yocto Project kernel to use with the Yocto
- Project Release 1.8.
- This kernel is based on the Linux 3.19 released kernel.
- </para></listitem>
- <listitem><para><emphasis>
- <filename>linux-yocto-4.1</filename></emphasis> - The
- stable Yocto Project kernel to use with the Yocto
- Project Release 2.0.
- This kernel is based on the Linux 4.1 released kernel.
- </para></listitem>
- <listitem><para><emphasis>
- <filename>linux-yocto-4.4</filename></emphasis> - The
- stable Yocto Project kernel to use with the Yocto
- Project Release 2.1.
- This kernel is based on the Linux 4.4 released kernel.
- </para></listitem>
- <listitem><para><emphasis>
- <filename>linux-yocto-dev</filename></emphasis> - A
- development kernel based on the latest upstream release
- candidate available.
- </para></listitem>
- </itemizedlist>
- <note>
- Long Term Support Initiative (LTSI) for Yocto Project kernels
- is as follows:
- <itemizedlist>
- <listitem><para>For Yocto Project releases 1.7, 1.8, and 2.0,
- the LTSI kernel is <filename>linux-yocto-3.14</filename>.
- </para></listitem>
- <listitem><para>For Yocto Project release 2.1, the
- LTSI kernel is <filename>linux-yocto-4.1</filename>.
- </para></listitem>
- </itemizedlist>
- </note>
- </para>
-
- <para>
- The kernels are maintained using the Git revision control system
- that structures them using the familiar "tree", "branch", and "leaf" scheme.
- Branches represent diversions from general code to more specific code, while leaves
- represent the end-points for a complete and unique kernel whose source files,
- when gathered from the root of the tree to the leaf, accumulate to create the files
- necessary for a specific piece of hardware and its features.
- The following figure displays this concept:
- <para>
- <imagedata fileref="figures/kernel-overview-1.png"
- width="6in" depth="6in" align="center" scale="100" />
- </para>
-
- <para>
- Within the figure, the "Kernel.org Branch Point" represents the point in the tree
- where a supported base kernel is modified from the Linux kernel.
- For example, this could be the branch point for the <filename>linux-yocto-3.19</filename>
- kernel.
- Thus, everything further to the right in the structure is based on the
- <filename>linux-yocto-3.19</filename> kernel.
- Branch points to the right in the figure represent where the
- <filename>linux-yocto-3.19</filename> kernel is modified for specific hardware
- or types of kernels, such as real-time kernels.
- Each leaf thus represents the end-point for a kernel designed to run on a specific
- targeted device.
- </para>
-
- <para>
- The overall result is a Git-maintained repository from which all the supported
- kernel types can be derived for all the supported devices.
- A big advantage to this scheme is the sharing of common features by keeping them in
- "larger" branches within the tree.
- This practice eliminates redundant storage of similar features shared among kernels.
- </para>
-
- <note>
- Keep in mind the figure does not take into account all the supported Yocto
- Project kernel types, but rather shows a single generic kernel just for conceptual purposes.
- Also keep in mind that this structure represents the Yocto Project source repositories
- that are either pulled from during the build or established on the host development system
- prior to the build by either cloning a particular kernel's Git repository or by
- downloading and unpacking a tarball.
- </note>
-
- <para>
- Upstream storage of all the available kernel source code is one thing, while
- representing and using the code on your host development system is another.
- Conceptually, you can think of the kernel source repositories as all the
- source files necessary for all the supported kernels.
- As a developer, you are just interested in the source files for the kernel on
- which you are working.
- And, furthermore, you need them available on your host system.
- </para>
-
- <para>
- Kernel source code is available on your host system a couple of different
- ways.
- If you are working in the kernel all the time, you probably would want
- to set up your own local Git repository of the kernel tree.
- If you just need to make some patches to the kernel, you can access
- temporary kernel source files that were extracted and used
- during a build.
- We will just talk about working with the temporary source code.
- For more information on how to get kernel source code onto your
- host system, see the
- "<link linkend='local-kernel-files'>Yocto Project Kernel</link>"
- bulleted item earlier in the manual.
- </para>
-
- <para>
- What happens during the build?
- When you build the kernel on your development system, all files needed for the build
- are taken from the source repositories pointed to by the
- <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink> variable
- and gathered in a temporary work area
- where they are subsequently used to create the unique kernel.
- Thus, in a sense, the process constructs a local source tree specific to your
- kernel to generate the new kernel image - a source generator if you will.
- </para>
- The following figure shows the temporary file structure
- created on your host system when the build occurs.
- This
- <link linkend='build-directory'>Build Directory</link> contains all the
- source files used during the build.
- </para>
-
- <para>
- <imagedata fileref="figures/kernel-overview-2-generic.png"
- width="6in" depth="5in" align="center" scale="100" />
- </para>
-
- <para>
- Again, for additional information on the Yocto Project kernel's
- architecture and its branching strategy, see the
- <ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;'>Yocto Project Linux Kernel Development Manual</ulink>.
- You can also reference the
- "<link linkend='patching-the-kernel'>Patching the Kernel</link>"
- section for a detailed example that modifies the kernel.
- </para>
- </section>
-
- <section id='kernel-modification-workflow'>
- <title>Kernel Modification Workflow</title>
-
- <para>
- This illustration and the following list summarizes the kernel modification general workflow.
- </para>
-
- <para>
- <imagedata fileref="figures/kernel-dev-flow.png"
- width="6in" depth="5in" align="center" scalefit="1" />
- </para>
-
- <para>
- <orderedlist>
- <listitem><para><emphasis>Set up your host development system to support
- development using the Yocto Project</emphasis>: See
- "<ulink url='&YOCTO_DOCS_QS_URL;#the-linux-distro'>The Linux Distribution</ulink>" and
- "<ulink url='&YOCTO_DOCS_QS_URL;#packages'>The Build Host Packages</ulink>" sections both
- in the Yocto Project Quick Start for requirements.</para></listitem>
- <listitem><para><emphasis>Establish a local copy of project files on your
- system</emphasis>: Having the <link linkend='source-directory'>Source
- Directory</link> on your system gives you access to the build process and tools
- you need.
- For information on how to get these files, see the bulleted item
- "<link linkend='local-yp-release'>Yocto Project Release</link>" earlier in this manual.
- </para></listitem>
- <listitem><para><emphasis>Establish the temporary kernel source files</emphasis>:
- Temporary kernel source files are kept in the
- <link linkend='build-directory'>Build Directory</link>
- created by the
- OpenEmbedded build system when you run BitBake.
- If you have never built the kernel in which you are
- interested, you need to run an initial build to
- establish local kernel source files.</para>
- <para>If you are building an image for the first time, you need to get the build
- environment ready by sourcing an environment setup script
- (i.e. <filename>oe-init-build-env</filename> or
- <filename>oe-init-build-env-memres</filename>).
- You also need to be sure two key configuration files
- (<filename>local.conf</filename> and <filename>bblayers.conf</filename>)
- are configured appropriately.</para>
- <para>The entire process for building an image is overviewed in the
- "<ulink url='&YOCTO_DOCS_QS_URL;#qs-building-images'>Building Images</ulink>"
- section of the Yocto Project Quick Start.
- You might want to reference this information.
- You can find more information on BitBake in the
- <ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual</ulink>.
- </para>
- <para>The build process supports several types of images to satisfy different needs.
- See the "<ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Images</ulink>" chapter in
- the Yocto Project Reference Manual for information on supported images.
- </para></listitem>
- <listitem><para><emphasis>Make changes to the kernel source code if
- applicable</emphasis>: Modifying the kernel does not always mean directly
- changing source files.
- However, if you have to do this, you make the changes to the files in the
- Build Directory.</para></listitem>
- <listitem><para><emphasis>Make kernel configuration changes if applicable</emphasis>:
- If your situation calls for changing the kernel's
- configuration, you can use
- <ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#generating-configuration-files'><filename>menuconfig</filename></ulink>,
- which allows you to interactively develop and test the
- configuration changes you are making to the kernel.
- Saving changes you make with
- <filename>menuconfig</filename> updates
- the kernel's <filename>.config</filename> file.
- <note><title>Warning</title>
- Try to resist the temptation to directly edit an
- existing <filename>.config</filename> file, which is
- found in the Build Directory at
- <filename>tmp/sysroots/<replaceable>machine-name</replaceable>/kernel</filename>.
- Doing so, can produce unexpected results when the
- OpenEmbedded build system regenerates the configuration
- file.
- </note>
- Once you are satisfied with the configuration
- changes made using <filename>menuconfig</filename>
- and you have saved them, you can directly compare the
- resulting <filename>.config</filename> file against an
- existing original and gather those changes into a
- <link linkend='creating-config-fragments'>configuration fragment file</link>
- to be referenced from within the kernel's
- <filename>.bbappend</filename> file.</para>
-
- <para>Additionally, if you are working in a BSP layer
- and need to modify the BSP's kernel's configuration,
- you can use the
- <ulink url='&YOCTO_DOCS_BSP_URL;#managing-kernel-patches-and-config-items-with-yocto-kernel'><filename>yocto-kernel</filename></ulink>
- script as well as <filename>menuconfig</filename>.
- The <filename>yocto-kernel</filename> script lets
- you interactively set up kernel configurations.
- </para></listitem>
- <listitem><para><emphasis>Rebuild the kernel image with your changes</emphasis>:
- Rebuilding the kernel image applies your changes.
- </para></listitem>
- </orderedlist>
- </para>
- </section>
- </section>
-</section>
-
-<section id='application-development-workflow-using-an-sdk'>
- <title>Application Development Workflow Using an SDK</title>
-
- <para>
- Standard and extensible Software Development Kits (SDK) make it easy
- to develop applications inside or outside of the Yocto Project
- development environment.
- Tools exist to help the application developer during any phase
- of development.
- For information on how to install and use an SDK, see the
- <ulink url='&YOCTO_DOCS_SDK_URL;#sdk-intro'>Yocto Project Software Development Kit (SDK) Developer's Guide</ulink>.
- </para>
-</section>
-
-<section id="dev-modifying-source-code">
- <title>Modifying Source Code</title>
-
- <para>
- A common development workflow consists of modifying project source
- files that are external to the Yocto Project and then integrating
- that project's build output into an image built using the
- OpenEmbedded build system.
- Given this scenario, development engineers typically want to stick
- to their familiar project development tools and methods, which allows
- them to just focus on the project.
- </para>
-
- <para>
- Several workflows exist that allow you to develop, build, and test
- code that is going to be integrated into an image built using the
- OpenEmbedded build system.
- This section describes two:
- <itemizedlist>
- <listitem><para><emphasis><filename>devtool</filename>:</emphasis>
- A set of tools to aid in working on the source code built by
- the OpenEmbedded build system.
- Section
- "<link linkend='using-devtool-in-your-workflow'>Using <filename>devtool</filename> in Your Workflow</link>"
- describes this workflow.
- If you want more information that showcases the workflow, click
- <ulink url='https://drive.google.com/a/linaro.org/file/d/0B3KGzY5fW7laTDVxUXo3UDRvd2s/view'>here</ulink>
- for a presentation by Trevor Woerner that, while somewhat dated,
- provides detailed background information and a complete
- working tutorial.
- </para></listitem>
- <listitem><para><emphasis><ulink url='http://savannah.nongnu.org/projects/quilt'>Quilt</ulink>:</emphasis>
- A powerful tool that allows you to capture source
- code changes without having a clean source tree.
- While Quilt is not the preferred workflow of the two, this
- section includes it for users that are committed to using
- the tool.
- See the
- "<link linkend='using-a-quilt-workflow'>Using Quilt in Your Workflow</link>"
- section for more information.
- </para></listitem>
- </itemizedlist>
- </para>
-
- <section id='using-devtool-in-your-workflow'>
- <title>Using <filename>devtool</filename> in Your Workflow</title>
-
- <para>
- As mentioned earlier, <filename>devtool</filename> helps
- you easily develop projects whose build output must be part of
- an image built using the OpenEmbedded build system.
- </para>
-
- <para>
- Three entry points exist that allow you to develop using
- <filename>devtool</filename>:
- <itemizedlist>
- <listitem><para><emphasis><filename>devtool add</filename></emphasis>
- </para></listitem>
- <listitem><para><emphasis><filename>devtool modify</filename></emphasis>
- </para></listitem>
- <listitem><para><emphasis><filename>devtool upgrade</filename></emphasis>
- </para></listitem>
- </itemizedlist>
- </para>
-
- <para>
- The remainder of this section presents these workflows.
- See the
- "<ulink url='&YOCTO_DOCS_REF_URL;#ref-devtool-reference'><filename>devtool</filename> Quick Reference</ulink>"
- in the Yocto Project Reference Manual for a
- <filename>devtool</filename> quick reference.
- </para>
-
- <section id='use-devtool-to-integrate-new-code'>
- <title>Use <filename>devtool add</filename> to Add an Application</title>
-
- <para>
- The <filename>devtool add</filename> command generates
- a new recipe based on existing source code.
- This command takes advantage of the
- <ulink url='&YOCTO_DOCS_DEV_URL;#devtool-the-workspace-layer-structure'>workspace</ulink>
- layer that many <filename>devtool</filename> commands
- use.
- The command is flexible enough to allow you to extract source
- code into both the workspace or a separate local Git repository
- and to use existing code that does not need to be extracted.
- </para>
-
- <para>
- Depending on your particular scenario, the arguments and options
- you use with <filename>devtool add</filename> form different
- combinations.
- The following diagram shows common development flows
- you would use with the <filename>devtool add</filename>
- command:
- </para>
-
- <para>
- <imagedata fileref="figures/devtool-add-flow.png" align="center" />
- </para>
-
- <para>
- <orderedlist>
- <listitem><para><emphasis>Generating the New Recipe</emphasis>:
- The top part of the flow shows three scenarios by which
- you could use <filename>devtool add</filename> to
- generate a recipe based on existing source code.</para>
-
- <para>In a shared development environment, it is
- typical where other developers are responsible for
- various areas of source code.
- As a developer, you are probably interested in using
- that source code as part of your development using
- the Yocto Project.
- All you need is access to the code, a recipe, and a
- controlled area in which to do your work.</para>
-
- <para>Within the diagram, three possible scenarios
- feed into the <filename>devtool add</filename> workflow:
- <itemizedlist>
- <listitem><para><emphasis>Left</emphasis>:
- The left scenario represents a common situation
- where the source code does not exist locally
- and needs to be extracted.
- In this situation, you just let it get
- extracted to the default workspace - you do not
- want it in some specific location outside of the
- workspace.
- Thus, everything you need will be located in the
- workspace:
- <literallayout class='monospaced'>
- $ devtool add <replaceable>recipe fetchuri</replaceable>
- </literallayout>
- With this command, <filename>devtool</filename>
- creates a recipe and an append file in the
- workspace as well as extracts the upstream
- source files into a local Git repository also
- within the <filename>sources</filename> folder.
- </para></listitem>
- <listitem><para><emphasis>Middle</emphasis>:
- The middle scenario also represents a situation where
- the source code does not exist locally.
- In this case, the code is again upstream
- and needs to be extracted to some
- local area - this time outside of the default
- workspace.
- If required, <filename>devtool</filename>
- always creates
- a Git repository locally during the extraction.
- Furthermore, the first positional argument
- <replaceable>srctree</replaceable> in this case
- identifies where the
- <filename>devtool add</filename> command
- will locate the extracted code outside of the
- workspace:
- <literallayout class='monospaced'>
- $ devtool add <replaceable>recipe srctree fetchuri</replaceable>
- </literallayout>
- In summary, the source code is pulled from
- <replaceable>fetchuri</replaceable> and extracted
- into the location defined by
- <replaceable>srctree</replaceable> as a local
- Git repository.</para>
-
- <para>Within workspace, <filename>devtool</filename>
- creates both the recipe and an append file
- for the recipe.
- </para></listitem>
- <listitem><para><emphasis>Right</emphasis>:
- The right scenario represents a situation
- where the source tree (srctree) has been
- previously prepared outside of the
- <filename>devtool</filename> workspace.
- </para>
-
- <para>The following command names the recipe
- and identifies where the existing source tree
- is located:
- <literallayout class='monospaced'>
- $ devtool add <replaceable>recipe srctree</replaceable>
- </literallayout>
- The command examines the source code and creates
- a recipe for it placing the recipe into the
- workspace.</para>
-
- <para>Because the extracted source code already exists,
- <filename>devtool</filename> does not try to
- relocate it into the workspace - just the new
- the recipe is placed in the workspace.</para>
-
- <para>Aside from a recipe folder, the command
- also creates an append folder and places an initial
- <filename>*.bbappend</filename> within.
- </para></listitem>
- </itemizedlist>
- </para></listitem>
- <listitem><para><emphasis>Edit the Recipe</emphasis>:
- At this point, you can use <filename>devtool edit-recipe</filename>
- to open up the editor as defined by the
- <filename>$EDITOR</filename> environment variable
- and modify the file:
- <literallayout class='monospaced'>
- $ devtool edit-recipe <replaceable>recipe</replaceable>
- </literallayout>
- From within the editor, you can make modifications to the
- recipe that take affect when you build it later.
- </para></listitem>
- <listitem><para><emphasis>Build the Recipe or Rebuild the Image</emphasis>:
- At this point in the flow, the next step you
- take depends on what you are going to do with
- the new code.</para>
- <para>If you need to take the build output and eventually
- move it to the target hardware, you would use
- <filename>devtool build</filename>:
- <literallayout class='monospaced'>
- $ devtool build <replaceable>recipe</replaceable>
- </literallayout></para>
- <para>On the other hand, if you want an image to
- contain the recipe's packages for immediate deployment
- onto a device (e.g. for testing purposes), you can use
- the <filename>devtool build-image</filename> command:
- <literallayout class='monospaced'>
- $ devtool build-image <replaceable>image</replaceable>
- </literallayout>
- </para></listitem>
- <listitem><para><emphasis>Deploy the Build Output</emphasis>:
- When you use the <filename>devtool build</filename>
- command to build out your recipe, you probably want to
- see if the resulting build output works as expected on target
- hardware.
- <note>
- This step assumes you have a previously built
- image that is already either running in QEMU or
- running on actual hardware.
- Also, it is assumed that for deployment of the image
- to the target, SSH is installed in the image and if
- the image is running on real hardware that you have
- network access to and from your development machine.
- </note>
- You can deploy your build output to that target hardware by
- using the <filename>devtool deploy-target</filename> command:
- <literallayout class='monospaced'>
- $ devtool deploy-target <replaceable>recipe target</replaceable>
- </literallayout>
- The <replaceable>target</replaceable> is a live target machine
- running as an SSH server.</para>
-
- <para>You can, of course, also deploy the image you build
- using the <filename>devtool build-image</filename> command
- to actual hardware.
- However, <filename>devtool</filename> does not provide a
- specific command that allows you to do this.
- </para></listitem>
- <listitem><para>
- <emphasis>Finish Your Work With the Recipe</emphasis>:
- The <filename>devtool finish</filename> command creates
- any patches corresponding to commits in the local
- Git repository, moves the new recipe to a more permanent
- layer, and then resets the recipe so that the recipe is
- built normally rather than from the workspace.
- <literallayout class='monospaced'>
- $ devtool finish <replaceable>recipe layer</replaceable>
- </literallayout>
- <note>
- Any changes you want to turn into patches must be
- committed to the Git repository in the source tree.
- </note></para>
-
- <para>As mentioned, the <filename>devtool finish</filename>
- command moves the final recipe to its permanent layer.
- </para>
-
- <para>As a final process of the
- <filename>devtool finish</filename> command, the state
- of the standard layers and the upstream source is
- restored so that you can build the recipe from those
- areas rather than the workspace.
- <note>
- You can use the <filename>devtool reset</filename>
- command to put things back should you decide you
- do not want to proceed with your work.
- If you do use this command, realize that the source
- tree is preserved.
- </note>
- </para></listitem>
- </orderedlist>
- </para>
- </section>
-
- <section id='devtool-use-devtool-modify-to-enable-work-on-code-associated-with-an-existing-recipe'>
- <title>Use <filename>devtool modify</filename> to Modify the Source of an Existing Component</title>
-
- <para>
- The <filename>devtool modify</filename> command prepares the
- way to work on existing code that already has a recipe in
- place.
- The command is flexible enough to allow you to extract code,
- specify the existing recipe, and keep track of and gather any
- patch files from other developers that are
- associated with the code.
- </para>
-
- <para>
- Depending on your particular scenario, the arguments and options
- you use with <filename>devtool modify</filename> form different
- combinations.
- The following diagram shows common development flows
- you would use with the <filename>devtool modify</filename>
- command:
- </para>
-
- <para>
- <imagedata fileref="figures/devtool-modify-flow.png" align="center" />
- </para>
-
- <para>
- <orderedlist>
- <listitem><para><emphasis>Preparing to Modify the Code</emphasis>:
- The top part of the flow shows three scenarios by which
- you could use <filename>devtool modify</filename> to
- prepare to work on source files.
- Each scenario assumes the following:
- <itemizedlist>
- <listitem><para>The recipe exists in some layer external
- to the <filename>devtool</filename> workspace.
- </para></listitem>
- <listitem><para>The source files exist upstream in an
- un-extracted state or locally in a previously
- extracted state.
- </para></listitem>
- </itemizedlist>
- The typical situation is where another developer has
- created some layer for use with the Yocto Project and
- their recipe already resides in that layer.
- Furthermore, their source code is readily available
- either upstream or locally.
- <itemizedlist>
- <listitem><para><emphasis>Left</emphasis>:
- The left scenario represents a common situation
- where the source code does not exist locally
- and needs to be extracted.
- In this situation, the source is extracted
- into the default workspace location.
- The recipe, in this scenario, is in its own
- layer outside the workspace
- (i.e.
- <filename>meta-</filename><replaceable>layername</replaceable>).
- </para>
-
- <para>The following command identifies the recipe
- and by default extracts the source files:
- <literallayout class='monospaced'>
- $ devtool modify <replaceable>recipe</replaceable>
- </literallayout>
- Once <filename>devtool</filename>locates the recipe,
- it uses the
- <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
- variable to locate the source code and
- any local patch files from other developers are
- located.
- <note>
- You cannot provide an URL for
- <replaceable>srctree</replaceable> when using the
- <filename>devtool modify</filename> command.
- </note>
- With this scenario, however, since no
- <replaceable>srctree</replaceable> argument exists, the
- <filename>devtool modify</filename> command by default
- extracts the source files to a Git structure.
- Furthermore, the location for the extracted source is the
- default area within the workspace.
- The result is that the command sets up both the source
- code and an append file within the workspace with the
- recipe remaining in its original location.
- </para></listitem>
- <listitem><para><emphasis>Middle</emphasis>:
- The middle scenario represents a situation where
- the source code also does not exist locally.
- In this case, the code is again upstream
- and needs to be extracted to some
- local area as a Git repository.
- The recipe, in this scenario, is again in its own
- layer outside the workspace.</para>
-
- <para>The following command tells
- <filename>devtool</filename> what recipe with
- which to work and, in this case, identifies a local
- area for the extracted source files that is outside
- of the default workspace:
- <literallayout class='monospaced'>
- $ devtool modify <replaceable>recipe srctree</replaceable>
- </literallayout>
- As with all extractions, the command uses
- the recipe's <filename>SRC_URI</filename> to locate the
- source files.
- Once the files are located, the command by default
- extracts them.
- Providing the <replaceable>srctree</replaceable>
- argument instructs <filename>devtool</filename> where
- place the extracted source.</para>
-
- <para>Within workspace, <filename>devtool</filename>
- creates an append file for the recipe.
- The recipe remains in its original location but
- the source files are extracted to the location you
- provided with <replaceable>srctree</replaceable>.
- </para></listitem>
- <listitem><para><emphasis>Right</emphasis>:
- The right scenario represents a situation
- where the source tree
- (<replaceable>srctree</replaceable>) exists as a
- previously extracted Git structure outside of
- the <filename>devtool</filename> workspace.
- In this example, the recipe also exists
- elsewhere in its own layer.
- </para>
-
- <para>The following command tells
- <filename>devtool</filename> the recipe
- with which to work, uses the "-n" option to indicate
- source does not need to be extracted, and uses
- <replaceable>srctree</replaceable> to point to the
- previously extracted source files:
- <literallayout class='monospaced'>
- $ devtool modify -n <replaceable>recipe srctree</replaceable>
- </literallayout>
- </para>
-
- <para>Once the command finishes, it creates only
- an append file for the recipe in the workspace.
- The recipe and the source code remain in their
- original locations.
- </para></listitem>
- </itemizedlist>
- </para></listitem>
- <listitem><para><emphasis>Edit the Source</emphasis>:
- Once you have used the <filename>devtool modify</filename>
- command, you are free to make changes to the source
- files.
- You can use any editor you like to make and save
- your source code modifications.
- </para></listitem>
- <listitem><para><emphasis>Build the Recipe</emphasis>:
- Once you have updated the source files, you can build
- the recipe.
- </para></listitem>
- <listitem><para><emphasis>Deploy the Build Output</emphasis>:
- When you use the <filename>devtool build</filename>
- command to build out your recipe, you probably want to see
- if the resulting build output works as expected on target
- hardware.
- <note>
- This step assumes you have a previously built
- image that is already either running in QEMU or
- running on actual hardware.
- Also, it is assumed that for deployment of the image
- to the target, SSH is installed in the image and if
- the image is running on real hardware that you have
- network access to and from your development machine.
- </note>
- You can deploy your build output to that target hardware by
- using the <filename>devtool deploy-target</filename> command:
- <literallayout class='monospaced'>
- $ devtool deploy-target <replaceable>recipe target</replaceable>
- </literallayout>
- The <replaceable>target</replaceable> is a live target machine
- running as an SSH server.</para>
-
- <para>You can, of course, also deploy the image you build
- using the <filename>devtool build-image</filename> command
- to actual hardware.
- However, <filename>devtool</filename> does not provide a
- specific command that allows you to do this.
- </para></listitem>
- <listitem><para>
- <emphasis>Finish Your Work With the Recipe</emphasis>:
- The <filename>devtool finish</filename> command creates
- any patches corresponding to commits in the local
- Git repository, updates the recipe to point to them
- (or creates a <filename>.bbappend</filename> file to do
- so, depending on the specified destination layer), and
- then resets the recipe so that the recipe is built normally
- rather than from the workspace.
- <literallayout class='monospaced'>
- $ devtool finish <replaceable>recipe layer</replaceable>
- </literallayout>
- <note>
- Any changes you want to turn into patches must be
- committed to the Git repository in the source tree.
- </note></para>
-
- <para>Because there is no need to move the recipe,
- <filename>devtool finish</filename> either updates the
- original recipe in the original layer or the command
- creates a <filename>.bbappend</filename> in a different
- layer as provided by <replaceable>layer</replaceable>.
- </para>
-
- <para>As a final process of the
- <filename>devtool finish</filename> command, the state
- of the standard layers and the upstream source is
- restored so that you can build the recipe from those
- areas rather than the workspace.
- <note>
- You can use the <filename>devtool reset</filename>
- command to put things back should you decide you
- do not want to proceed with your work.
- If you do use this command, realize that the source
- tree is preserved.
- </note>
- </para></listitem>
- </orderedlist>
- </para>
- </section>
-
- <section id='devtool-use-devtool-upgrade-to-create-a-version-of-the-recipe-that-supports-a-newer-version-of-the-software'>
- <title>Use <filename>devtool upgrade</filename> to Create a Version of the Recipe that Supports a Newer Version of the Software</title>
-
- <para>
- The <filename>devtool upgrade</filename> command updates
- an existing recipe so that you can build it for an updated
- set of source files.
- The command is flexible enough to allow you to specify
- source code revision and versioning schemes, extract code into
- or out of the <filename>devtool</filename> workspace, and
- work with any source file forms that the fetchers support.
- </para>
-
- <para>
- Depending on your particular scenario, the arguments and options
- you use with <filename>devtool upgrade</filename> form different
- combinations.
- The following diagram shows a common development flow
- you would use with the <filename>devtool modify</filename>
- command:
- </para>
-
- <para>
- <imagedata fileref="figures/devtool-upgrade-flow.png" align="center" />
- </para>
-
- <para>
- <orderedlist>
- <listitem><para><emphasis>Initiate the Upgrade</emphasis>:
- The top part of the flow shows a typical scenario by which
- you could use <filename>devtool upgrade</filename>.
- The following conditions exist:
- <itemizedlist>
- <listitem><para>The recipe exists in some layer external
- to the <filename>devtool</filename> workspace.
- </para></listitem>
- <listitem><para>The source files for the new release
- exist adjacent to the same location pointed to by
- <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
- in the recipe (e.g. a tarball with the new version
- number in the name, or as a different revision in
- the upstream Git repository).
- </para></listitem>
- </itemizedlist>
- A common situation is where third-party software has
- undergone a revision so that it has been upgraded.
- The recipe you have access to is likely in your own layer.
- Thus, you need to upgrade the recipe to use the
- newer version of the software:
- <literallayout class='monospaced'>
- $ devtool upgrade -V <replaceable>version recipe</replaceable>
- </literallayout>
- By default, the <filename>devtool upgrade</filename> command
- extracts source code into the <filename>sources</filename>
- directory in the workspace.
- If you want the code extracted to any other location, you
- need to provide the <replaceable>srctree</replaceable>
- positional argument with the command as follows:
- <literallayout class='monospaced'>
- $ devtool upgrade -V <replaceable>version recipe srctree</replaceable>
- </literallayout>
- Also, in this example, the "-V" option is used to specify
- the new version.
- If the source files pointed to by the
- <filename>SRC_URI</filename> statement in the recipe are
- in a Git repository, you must provide the "-S" option and
- specify a revision for the software.</para>
-
- <para>Once <filename>devtool</filename> locates the recipe,
- it uses the <filename>SRC_URI</filename> variable to locate
- the source code and any local patch files from other
- developers are located.
- The result is that the command sets up the source
- code, the new version of the recipe, and an append file
- all within the workspace.
- </para></listitem>
- <listitem><para><emphasis>Resolve any Conflicts created by the Upgrade</emphasis>:
- At this point, there could be some conflicts due to the
- software being upgraded to a new version.
- This would occur if your recipe specifies some patch files in
- <filename>SRC_URI</filename> that conflict with changes
- made in the new version of the software.
- If this is the case, you need to resolve the conflicts
- by editing the source and following the normal
- <filename>git rebase</filename> conflict resolution
- process.</para>
-
- <para>Before moving onto the next step, be sure to resolve any
- such conflicts created through use of a newer or different
- version of the software.
- </para></listitem>
- <listitem><para><emphasis>Build the Recipe</emphasis>:
- Once you have your recipe in order, you can build it.
- You can either use <filename>devtool build</filename> or
- <filename>bitbake</filename>.
- Either method produces build output that is stored
- in
- <ulink url='&YOCTO_DOCS_REF_URL;#var-TMPDIR'><filename>TMPDIR</filename></ulink>.
- </para></listitem>
- <listitem><para><emphasis>Deploy the Build Output</emphasis>:
- When you use the <filename>devtool build</filename>
- command or <filename>bitbake</filename> to build out your
- recipe, you probably want to see if the resulting build
- output works as expected on target hardware.
- <note>
- This step assumes you have a previously built
- image that is already either running in QEMU or
- running on actual hardware.
- Also, it is assumed that for deployment of the image
- to the target, SSH is installed in the image and if
- the image is running on real hardware that you have
- network access to and from your development machine.
- </note>
- You can deploy your build output to that target hardware by
- using the <filename>devtool deploy-target</filename> command:
- <literallayout class='monospaced'>
- $ devtool deploy-target <replaceable>recipe target</replaceable>
- </literallayout>
- The <replaceable>target</replaceable> is a live target machine
- running as an SSH server.</para>
-
- <para>You can, of course, also deploy the image you build
- using the <filename>devtool build-image</filename> command
- to actual hardware.
- However, <filename>devtool</filename> does not provide a
- specific command that allows you to do this.
- </para></listitem>
- <listitem><para>
- <emphasis>Finish Your Work With the Recipe</emphasis>:
- The <filename>devtool finish</filename> command creates
- any patches corresponding to commits in the local
- Git repository, moves the new recipe to a more permanent
- layer, and then resets the recipe so that the recipe is
- built normally rather than from the workspace.
- If you specify a destination layer that is the same as
- the original source, then the old version of the
- recipe and associated files will be removed prior to
- adding the new version.
- <literallayout class='monospaced'>
- $ devtool finish <replaceable>recipe layer</replaceable>
- </literallayout>
- <note>
- Any changes you want to turn into patches must be
- committed to the Git repository in the source tree.
- </note></para>
- <para>As a final process of the
- <filename>devtool finish</filename> command, the state
- of the standard layers and the upstream source is
- restored so that you can build the recipe from those
- areas rather than the workspace.
- <note>
- You can use the <filename>devtool reset</filename>
- command to put things back should you decide you
- do not want to proceed with your work.
- If you do use this command, realize that the source
- tree is preserved.
- </note>
- </para></listitem>
- </orderedlist>
- </para>
- </section>
- </section>
-
- <section id="using-a-quilt-workflow">
- <title>Using Quilt in Your Workflow</title>
-
- <para>
- <ulink url='http://savannah.nongnu.org/projects/quilt'>Quilt</ulink>
- is a powerful tool that allows you to capture source code changes
- without having a clean source tree.
- This section outlines the typical workflow you can use to modify
- source code, test changes, and then preserve the changes in the
- form of a patch all using Quilt.
- <note><title>Tip</title>
- With regard to preserving changes to source files if you
- clean a recipe or have <filename>rm_work</filename> enabled,
- the workflow described in the
- "<link linkend='using-devtool-in-your-workflow'>Using <filename>devtool</filename> in Your Workflow</link>"
- section is a safer development flow than than the flow that
- uses Quilt.
- </note>
- </para>
-
- <para>
- Follow these general steps:
- <orderedlist>
- <listitem><para><emphasis>Find the Source Code:</emphasis>
- Temporary source code used by the OpenEmbedded build system
- is kept in the
- <link linkend='build-directory'>Build Directory</link>.
- See the
- "<link linkend='finding-the-temporary-source-code'>Finding Temporary Source Code</link>"
- section to learn how to locate the directory that has the
- temporary source code for a particular package.
- </para></listitem>
- <listitem><para><emphasis>Change Your Working Directory:</emphasis>
- You need to be in the directory that has the temporary source code.
- That directory is defined by the
- <ulink url='&YOCTO_DOCS_REF_URL;#var-S'><filename>S</filename></ulink>
- variable.</para></listitem>
- <listitem><para><emphasis>Create a New Patch:</emphasis>
- Before modifying source code, you need to create a new patch.
- To create a new patch file, use <filename>quilt new</filename> as below:
- <literallayout class='monospaced'>
- $ quilt new my_changes.patch
- </literallayout></para></listitem>
- <listitem><para><emphasis>Notify Quilt and Add Files:</emphasis>
- After creating the patch, you need to notify Quilt about the files
- you plan to edit.
- You notify Quilt by adding the files to the patch you just created:
- <literallayout class='monospaced'>
- $ quilt add file1.c file2.c file3.c
- </literallayout>
- </para></listitem>
- <listitem><para><emphasis>Edit the Files:</emphasis>
- Make your changes in the source code to the files you added
- to the patch.
- </para></listitem>
- <listitem><para><emphasis>Test Your Changes:</emphasis>
- Once you have modified the source code, the easiest way to
- your changes is by calling the
- <filename>do_compile</filename> task as shown in the
- following example:
- <literallayout class='monospaced'>
- $ bitbake -c compile -f <replaceable>package</replaceable>
- </literallayout>
- The <filename>-f</filename> or <filename>--force</filename>
- option forces the specified task to execute.
- If you find problems with your code, you can just keep editing and
- re-testing iteratively until things work as expected.
- <note>All the modifications you make to the temporary source code
- disappear once you run the
- <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-clean'><filename>do_clean</filename></ulink>
- or
- <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-cleanall'><filename>do_cleanall</filename></ulink>
- tasks using BitBake (i.e.
- <filename>bitbake -c clean <replaceable>package</replaceable></filename>
- and
- <filename>bitbake -c cleanall <replaceable>package</replaceable></filename>).
- Modifications will also disappear if you use the <filename>rm_work</filename>
- feature as described in the
- "<ulink url='&YOCTO_DOCS_QS_URL;#qs-building-images'>Building Images</ulink>"
- section of the Yocto Project Quick Start.
- </note></para></listitem>
- <listitem><para><emphasis>Generate the Patch:</emphasis>
- Once your changes work as expected, you need to use Quilt to generate the final patch that
- contains all your modifications.
- <literallayout class='monospaced'>
- $ quilt refresh
- </literallayout>
- At this point, the <filename>my_changes.patch</filename> file has all your edits made
- to the <filename>file1.c</filename>, <filename>file2.c</filename>, and
- <filename>file3.c</filename> files.</para>
- <para>You can find the resulting patch file in the <filename>patches/</filename>
- subdirectory of the source (<filename>S</filename>) directory.</para></listitem>
- <listitem><para><emphasis>Copy the Patch File:</emphasis>
- For simplicity, copy the patch file into a directory named <filename>files</filename>,
- which you can create in the same directory that holds the recipe
- (<filename>.bb</filename>) file or the
- append (<filename>.bbappend</filename>) file.
- Placing the patch here guarantees that the OpenEmbedded build system will find
- the patch.
- Next, add the patch into the
- <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'>SRC_URI</ulink></filename>
- of the recipe.
- Here is an example:
- <literallayout class='monospaced'>
- SRC_URI += "file://my_changes.patch"
- </literallayout></para></listitem>
- </orderedlist>
- </para>
- </section>
-
- <section id='finding-the-temporary-source-code'>
- <title>Finding Temporary Source Code</title>
-
- <para>
- You might find it helpful during development to modify the
- temporary source code used by recipes to build packages.
- For example, suppose you are developing a patch and you need to
- experiment a bit to figure out your solution.
- After you have initially built the package, you can iteratively
- tweak the source code, which is located in the
- <link linkend='build-directory'>Build Directory</link>, and then
- you can force a re-compile and quickly test your altered code.
- Once you settle on a solution, you can then preserve your changes
- in the form of patches.
- If you are using Quilt for development, see the
- "<link linkend='using-a-quilt-workflow'>Using Quilt in Your Workflow</link>"
- section for more information.
- </para>
-
- <para>
- During a build, the unpacked temporary source code used by recipes
- to build packages is available in the Build Directory as
- defined by the
- <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-S'>S</ulink></filename> variable.
- Below is the default value for the <filename>S</filename> variable as defined in the
- <filename>meta/conf/bitbake.conf</filename> configuration file in the
- <link linkend='source-directory'>Source Directory</link>:
- <literallayout class='monospaced'>
- S = "${WORKDIR}/${BP}"
- </literallayout>
- You should be aware that many recipes override the <filename>S</filename> variable.
- For example, recipes that fetch their source from Git usually set
- <filename>S</filename> to <filename>${WORKDIR}/git</filename>.
- <note>
- The
- <ulink url='&YOCTO_DOCS_REF_URL;#var-BP'><filename>BP</filename></ulink>
- represents the base recipe name, which consists of the name and version:
- <literallayout class='monospaced'>
- BP = "${BPN}-${PV}"
- </literallayout>
- </note>
- </para>
-
- <para>
- The path to the work directory for the recipe
- (<ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink>)
- is defined as follows:
- <literallayout class='monospaced'>
- ${TMPDIR}/work/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR}
- </literallayout>
- The actual directory depends on several things:
- <itemizedlist>
- <listitem><ulink url='&YOCTO_DOCS_REF_URL;#var-TMPDIR'><filename>TMPDIR</filename></ulink>:
- The top-level build output directory</listitem>
- <listitem><ulink url='&YOCTO_DOCS_REF_URL;#var-MULTIMACH_TARGET_SYS'><filename>MULTIMACH_TARGET_SYS</filename></ulink>:
- The target system identifier</listitem>
- <listitem><ulink url='&YOCTO_DOCS_REF_URL;#var-PN'><filename>PN</filename></ulink>:
- The recipe name</listitem>
- <listitem><ulink url='&YOCTO_DOCS_REF_URL;#var-EXTENDPE'><filename>EXTENDPE</filename></ulink>:
- The epoch - (if
- <ulink url='&YOCTO_DOCS_REF_URL;#var-PE'><filename>PE</filename></ulink>
- is not specified, which is usually the case for most
- recipes, then <filename>EXTENDPE</filename> is blank)</listitem>
- <listitem><ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink>:
- The recipe version</listitem>
- <listitem><ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink>:
- The recipe revision</listitem>
- </itemizedlist>
- </para>
-
- <para>
- As an example, assume a Source Directory top-level folder
- named <filename>poky</filename>, a default Build Directory at
- <filename>poky/build</filename>, and a
- <filename>qemux86-poky-linux</filename> machine target
- system.
- Furthermore, suppose your recipe is named
- <filename>foo_1.3.0.bb</filename>.
- In this case, the work directory the build system uses to
- build the package would be as follows:
- <literallayout class='monospaced'>
- poky/build/tmp/work/qemux86-poky-linux/foo/1.3.0-r0
- </literallayout>
- </para>
-
- <para>
- Now that you know where to locate the directory that has the
- temporary source code, you can use a Quilt as described in section
- "<link linkend='using-a-quilt-workflow'>Using Quilt in Your Workflow</link>"
- to make your edits, test the changes, and preserve the changes in
- the form of patches.
- </para>
- </section>
-</section>
-
-<section id='image-development-using-toaster'>
- <title>Image Development Using Toaster</title>
-
- <para>
- Toaster is a web interface to the Yocto Project's OpenEmbedded build
- system.
- You can initiate builds using Toaster as well as examine the results
- and statistics of builds.
- See the
- <ulink url='&YOCTO_DOCS_TOAST_URL;#toaster-manual-intro'>Toaster User Manual</ulink>
- for information on how to set up and use Toaster to build images.
- </para>
-</section>
-
-<section id="platdev-appdev-devshell">
- <title>Using a Development Shell</title>
-
- <para>
- When debugging certain commands or even when just editing packages,
- <filename>devshell</filename> can be a useful tool.
- When you invoke <filename>devshell</filename>, all tasks up to and
- including
- <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-patch'><filename>do_patch</filename></ulink>
- are run for the specified target.
- Then, a new terminal is opened and you are placed in
- <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-S'><filename>S</filename></ulink><filename>}</filename>,
- the source directory.
- In the new terminal, all the OpenEmbedded build-related environment variables are
- still defined so you can use commands such as <filename>configure</filename> and
- <filename>make</filename>.
- The commands execute just as if the OpenEmbedded build system were executing them.
- Consequently, working this way can be helpful when debugging a build or preparing
- software to be used with the OpenEmbedded build system.
- </para>
-
- <para>
- Following is an example that uses <filename>devshell</filename> on a target named
- <filename>matchbox-desktop</filename>:
- <literallayout class='monospaced'>
- $ bitbake matchbox-desktop -c devshell
- </literallayout>
- </para>
-
- <para>
- This command spawns a terminal with a shell prompt within the OpenEmbedded build environment.
- The <ulink url='&YOCTO_DOCS_REF_URL;#var-OE_TERMINAL'><filename>OE_TERMINAL</filename></ulink>
- variable controls what type of shell is opened.
- </para>
-
- <para>
- For spawned terminals, the following occurs:
- <itemizedlist>
- <listitem><para>The <filename>PATH</filename> variable includes the
- cross-toolchain.</para></listitem>
- <listitem><para>The <filename>pkgconfig</filename> variables find the correct
- <filename>.pc</filename> files.</para></listitem>
- <listitem><para>The <filename>configure</filename> command finds the
- Yocto Project site files as well as any other necessary files.</para></listitem>
- </itemizedlist>
- </para>
-
- <para>
- Within this environment, you can run configure or compile
- commands as if they were being run by
- the OpenEmbedded build system itself.
- As noted earlier, the working directory also automatically changes to the
- Source Directory (<ulink url='&YOCTO_DOCS_REF_URL;#var-S'><filename>S</filename></ulink>).
- </para>
-
- <para>
- To manually run a specific task using <filename>devshell</filename>,
- run the corresponding <filename>run.*</filename> script in
- the
- <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink><filename>}/temp</filename>
- directory (e.g.,
- <filename>run.do_configure.</filename><replaceable>pid</replaceable>).
- If a task's script does not exist, which would be the case if the task was
- skipped by way of the sstate cache, you can create the task by first running
- it outside of the <filename>devshell</filename>:
- <literallayout class='monospaced'>
- $ bitbake -c <replaceable>task</replaceable>
- </literallayout>
- <note><title>Notes</title>
- <itemizedlist>
- <listitem><para>Execution of a task's <filename>run.*</filename>
- script and BitBake's execution of a task are identical.
- In other words, running the script re-runs the task
- just as it would be run using the
- <filename>bitbake -c</filename> command.
- </para></listitem>
- <listitem><para>Any <filename>run.*</filename> file that does not
- have a <filename>.pid</filename> extension is a
- symbolic link (symlink) to the most recent version of that
- file.
- </para></listitem>
- </itemizedlist>
- </note>
- </para>
-
- <para>
- Remember, that the <filename>devshell</filename> is a mechanism that allows
- you to get into the BitBake task execution environment.
- And as such, all commands must be called just as BitBake would call them.
- That means you need to provide the appropriate options for
- cross-compilation and so forth as applicable.
- </para>
-
- <para>
- When you are finished using <filename>devshell</filename>, exit the shell
- or close the terminal window.
- </para>
-
- <note><title>Notes</title>
- <itemizedlist>
- <listitem><para>
- It is worth remembering that when using <filename>devshell</filename>
- you need to use the full compiler name such as <filename>arm-poky-linux-gnueabi-gcc</filename>
- instead of just using <filename>gcc</filename>.
- The same applies to other applications such as <filename>binutils</filename>,
- <filename>libtool</filename> and so forth.
- BitBake sets up environment variables such as <filename>CC</filename>
- to assist applications, such as <filename>make</filename> to find the correct tools.
- </para></listitem>
- <listitem><para>
- It is also worth noting that <filename>devshell</filename> still works over
- X11 forwarding and similar situations.
- </para></listitem>
- </itemizedlist>
- </note>
-</section>
-
-<section id="platdev-appdev-devpyshell">
- <title>Using a Development Python Shell</title>
-
- <para>
- Similar to working within a development shell as described in
- the previous section, you can also spawn and work within an
- interactive Python development shell.
- When debugging certain commands or even when just editing packages,
- <filename>devpyshell</filename> can be a useful tool.
- When you invoke <filename>devpyshell</filename>, all tasks up to and
- including
- <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-patch'><filename>do_patch</filename></ulink>
- are run for the specified target.
- Then a new terminal is opened.
- Additionally, key Python objects and code are available in the same
- way they are to BitBake tasks, in particular, the data store 'd'.
- So, commands such as the following are useful when exploring the data
- store and running functions:
- <literallayout class='monospaced'>
- pydevshell> d.getVar("STAGING_DIR", True)
- '/media/build1/poky/build/tmp/sysroots'
- pydevshell> d.getVar("STAGING_DIR", False)
- '${TMPDIR}/sysroots'
- pydevshell> d.setVar("FOO", "bar")
- pydevshell> d.getVar("FOO", True)
- 'bar'
- pydevshell> d.delVar("FOO")
- pydevshell> d.getVar("FOO", True)
- pydevshell> bb.build.exec_func("do_unpack", d)
- pydevshell>
- </literallayout>
- The commands execute just as if the OpenEmbedded build system were executing them.
- Consequently, working this way can be helpful when debugging a build or preparing
- software to be used with the OpenEmbedded build system.
- </para>
-
- <para>
- Following is an example that uses <filename>devpyshell</filename> on a target named
- <filename>matchbox-desktop</filename>:
- <literallayout class='monospaced'>
- $ bitbake matchbox-desktop -c devpyshell
- </literallayout>
- </para>
-
- <para>
- This command spawns a terminal and places you in an interactive
- Python interpreter within the OpenEmbedded build environment.
- The <ulink url='&YOCTO_DOCS_REF_URL;#var-OE_TERMINAL'><filename>OE_TERMINAL</filename></ulink>
- variable controls what type of shell is opened.
- </para>
-
- <para>
- When you are finished using <filename>devpyshell</filename>, you
- can exit the shell either by using Ctrl+d or closing the terminal
- window.
- </para>
-</section>
-
-</chapter>
diff --git a/import-layers/yocto-poky/documentation/dev-manual/dev-manual-newbie.xml b/import-layers/yocto-poky/documentation/dev-manual/dev-manual-newbie.xml
index ad32ac6..a0fbb4b 100644
--- a/import-layers/yocto-poky/documentation/dev-manual/dev-manual-newbie.xml
+++ b/import-layers/yocto-poky/documentation/dev-manual/dev-manual-newbie.xml
@@ -6,63 +6,13 @@
<title>The Yocto Project Open Source Development Environment</title>
-<para>
- This chapter helps you understand the Yocto Project as an open source development project.
- In general, working in an open source environment is very different from working in a
- closed, proprietary environment.
- Additionally, the Yocto Project uses specific tools and constructs as part of its development
- environment.
- This chapter specifically addresses open source philosophy, using the
- Yocto Project in a team environment, source repositories, Yocto Project
- terms, licensing, the open source distributed version control system Git,
- workflows, bug tracking, and how to submit changes.
-</para>
-
-<section id='open-source-philosophy'>
- <title>Open Source Philosophy</title>
-
- <para>
- Open source philosophy is characterized by software development directed by peer production
- and collaboration through an active community of developers.
- Contrast this to the more standard centralized development models used by commercial software
- companies where a finite set of developers produces a product for sale using a defined set
- of procedures that ultimately result in an end product whose architecture and source material
- are closed to the public.
- </para>
-
- <para>
- Open source projects conceptually have differing concurrent agendas, approaches, and production.
- These facets of the development process can come from anyone in the public (community) that has a
- stake in the software project.
- The open source environment contains new copyright, licensing, domain, and consumer issues
- that differ from the more traditional development environment.
- In an open source environment, the end product, source material, and documentation are
- all available to the public at no cost.
- </para>
-
- <para>
- A benchmark example of an open source project is the Linux kernel, which was initially conceived
- and created by Finnish computer science student Linus Torvalds in 1991.
- Conversely, a good example of a non-open source project is the
- <trademark class='registered'>Windows</trademark> family of operating
- systems developed by <trademark class='registered'>Microsoft</trademark> Corporation.
- </para>
-
- <para>
- Wikipedia has a good historical description of the Open Source Philosophy
- <ulink url='http://en.wikipedia.org/wiki/Open_source'>here</ulink>.
- You can also find helpful information on how to participate in the Linux Community
- <ulink url='http://ldn.linuxfoundation.org/book/how-participate-linux-community'>here</ulink>.
- </para>
-</section>
-
<section id="usingpoky-changes-collaborate">
- <title>Using the Yocto Project in a Team Environment</title>
+ <title>Setting Up a Team Yocto Project Development Environment</title>
<para>
It might not be immediately clear how you can use the Yocto
- Project in a team environment, or scale it for a large team of
- developers.
+ Project in a team development environment, or scale it for a large
+ team of developers.
One of the strengths of the Yocto Project is that it is extremely
flexible.
Thus, you can adapt it to many different use cases and scenarios.
@@ -71,1505 +21,615 @@
</para>
<para>
- To help with these types of situations, this section presents
- some of the project's most successful experiences,
- practices, solutions, and available technologies that work well.
- Keep in mind, the information here is a starting point.
+ To help you understand how to set up this type of environment,
+ this section presents a procedure that gives you the information
+ to learn how to get the results you want.
+ The procedure is high-level and presents some of the project's most
+ successful experiences, practices, solutions, and available
+ technologies that work well.
+ Keep in mind, the procedure here is a starting point.
You can build off it and customize it to fit any
particular working environment and set of practices.
- </para>
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Determine Who is Going to be Developing:</emphasis>
+ You need to understand who is going to be doing anything
+ related to the Yocto Project and what their roles would be.
+ Making this determination is essential to completing the
+ steps two and three, which are to get your equipment together
+ and set up your development environment's hardware topology.
+ </para>
- <section id='best-practices-system-configurations'>
- <title>System Configurations</title>
-
- <para>
- Systems across a large team should meet the needs of
- two types of developers: those working on the contents of the
- operating system image itself and those developing applications.
- Regardless of the type of developer, their workstations must
- be both reasonably powerful and run Linux.
- </para>
-
- <section id='best-practices-application-development'>
- <title>Application Development</title>
-
- <para>
- For developers who mainly do application level work
- on top of an existing software stack,
- the following list shows practices that work best.
- For information on using a Software Development Kit (SDK), see
- the
- <ulink url='&YOCTO_DOCS_SDK_URL;#sdk-intro'>Yocto Project Software Development Kit (SDK) Developer's Guide</ulink>:
+ <para>The following roles exist:
<itemizedlist>
- <listitem><para>Use a pre-built toolchain that
+ <listitem><para>
+ <emphasis>Application Development:</emphasis>
+ These types of developers do application level work
+ on top of an existing software stack.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Core System Development:</emphasis>
+ These types of developers work on the contents of the
+ operating system image itself.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Build Engineer:</emphasis>
+ This type of developer manages Autobuilders and
+ releases.
+ Not all environments need a Build Engineer.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Test Engineer:</emphasis>
+ This type of developer creates and manages automated
+ tests needed to ensure all application and core
+ system development meets desired quality standards.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Gather the Hardware:</emphasis>
+ Based on the size and make-up of the team, get the hardware
+ together.
+ Any development, build, or test engineer should be using
+ a system that is running a supported Linux distribution.
+ Systems, in general, should be high performance (e.g. dual,
+ six-core Xeons with 24 Gbytes of RAM and plenty of disk space).
+ You can help ensure efficiency by having any machines used
+ for testing or that run Autobuilders be as high performance
+ as possible.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Understand the Hardware Topology of the Environment:</emphasis>
+ Now that you know how many developers and support engineers
+ are required, you can understand the topology of the
+ hardware environment.
+ The following figure shows a moderately sized Yocto Project
+ development environment.
+
+ <para role="writernotes">
+ Need figure.</para>
+
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Use Git as Your Source Control Manager (SCM):</emphasis>
+ Keeping your
+ <ulink url='&YOCTO_DOCS_REF_URL;#metadata'>Metadata</ulink>
+ and any software you are developing under the
+ control of an SCM system that is compatible
+ with the OpenEmbedded build system is advisable.
+ Of the SCMs BitBake supports, the
+ Yocto Project team strongly recommends using
+ <ulink url='&YOCTO_DOCS_REF_URL;#git'>Git</ulink>.
+ Git is a distributed system that is easy to backup,
+ allows you to work remotely, and then connects back to the
+ infrastructure.
+ <note>
+ For information about BitBake, see the
+ <ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual</ulink>.
+ </note></para>
+
+ <para>It is relatively easy to set up Git services and create
+ infrastructure like
+ <ulink url='&YOCTO_GIT_URL;'>http://git.yoctoproject.org</ulink>,
+ which is based on server software called
+ <filename>gitolite</filename> with <filename>cgit</filename>
+ being used to generate the web interface that lets you view the
+ repositories.
+ The <filename>gitolite</filename> software identifies users
+ using SSH keys and allows branch-based
+ access controls to repositories that you can control as little
+ or as much as necessary.
+
+ <note>
+ The setup of these services is beyond the scope of this
+ manual.
+ However, sites such as these exist that describe how to
+ perform setup:
+ <itemizedlist>
+ <listitem><para>
+ <ulink url='http://git-scm.com/book/ch4-8.html'>Git documentation</ulink>:
+ Describes how to install <filename>gitolite</filename>
+ on the server.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='http://sitaramc.github.com/gitolite/master-toc.html'>The <filename>gitolite</filename> master index</ulink>:
+ All topics for <filename>gitolite</filename>.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='https://git.wiki.kernel.org/index.php/Interfaces,_frontends,_and_tools'>Interfaces, frontends, and tools</ulink>:
+ Documentation on how to create interfaces and frontends
+ for Git.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Set up the Application Development Machines:</emphasis>
+ As mentioned earlier, application developers are creating
+ applications on top of existing software stacks.
+ Following are some best practices for setting up machines
+ that do application development:
+ <itemizedlist>
+ <listitem><para>
+ Use a pre-built toolchain that
contains the software stack itself.
Then, develop the application code on top of the
stack.
This method works well for small numbers of relatively
- isolated applications.</para></listitem>
- <listitem><para>When possible, use the Yocto Project
- plug-in for the <trademark class='trade'>Eclipse</trademark> IDE
+ isolated applications.
+ </para></listitem>
+ <listitem><para>
+ When possible, use the Yocto Project
+ plug-in for the
+ <trademark class='trade'>Eclipse</trademark> IDE
and SDK development practices.
For more information, see the
- "<ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Software Development Kit (SDK) Developer's Guide</ulink>".
+ "<ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Application Development and the Extensible Software Development Kit (eSDK)</ulink>"
+ manual.
</para></listitem>
- <listitem><para>Keep your cross-development toolchains
- updated.
+ <listitem><para>
+ Keep your cross-development toolchains updated.
You can do this through provisioning either as new
toolchain downloads or as updates through a package
update mechanism using <filename>opkg</filename>
to provide updates to an existing toolchain.
The exact mechanics of how and when to do this are a
- question for local policy.</para></listitem>
- <listitem><para>Use multiple toolchains installed locally
+ question for local policy.
+ </para></listitem>
+ <listitem><para>
+ Use multiple toolchains installed locally
into different locations to allow development across
- versions.</para></listitem>
+ versions.
+ </para></listitem>
</itemizedlist>
- </para>
- </section>
-
- <section id='best-practices-core-system-development'>
- <title>Core System Development</title>
-
- <para>
- For core system development, it is often best to have the
- build system itself available on the developer workstations
- so developers can run their own builds and directly
- rebuild the software stack.
- You should keep the core system unchanged as much as
- possible and do your work in layers on top of the core system.
- Doing so gives you a greater level of portability when
- upgrading to new versions of the core system or Board
- Support Packages (BSPs).
- You can share layers amongst the developers of a particular
- project and contain the policy configuration that defines
- the project.
- </para>
-
- <para>
- Aside from the previous best practices, there exists a number
- of tips and tricks that can help speed up core development
- projects:
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Set up the Core Development Machines:</emphasis>
+ As mentioned earlier, these types of developers work on the
+ contents of the operating system itself.
+ Following are some best practices for setting up machines
+ used for developing images:
<itemizedlist>
- <listitem><para>Use a
- <ulink url='&YOCTO_DOCS_REF_URL;#shared-state-cache'>Shared State Cache</ulink>
- (sstate) among groups of developers who are on a
- fast network.
- The best way to share sstate is through a
- Network File System (NFS) share.
- The first user to build a given component for the
- first time contributes that object to the sstate,
- while subsequent builds from other developers then
- reuse the object rather than rebuild it themselves.
- </para>
- <para>Although it is possible to use other protocols for the
- sstate such as HTTP and FTP, you should avoid these.
- Using HTTP limits the sstate to read-only and
- FTP provides poor performance.
+ <listitem><para>
+ Have the Yocto Project build system itself available on
+ the developer workstations so developers can run their own
+ builds and directly rebuild the software stack.
</para></listitem>
- <listitem><para>Have autobuilders contribute to the sstate
- pool similarly to how the developer workstations
- contribute.
- For information, see the
- "<link linkend='best-practices-autobuilders'>Autobuilders</link>"
- section.</para></listitem>
- <listitem><para>Build stand-alone tarballs that contain
- "missing" system requirements if for some reason
- developer workstations do not meet minimum system
- requirements such as latest Python versions,
- <filename>chrpath</filename>, or other tools.
- You can install and relocate the tarball exactly as you
- would the usual cross-development toolchain so that
- all developers can meet minimum version requirements
- on most distributions.</para></listitem>
- <listitem><para>Use a small number of shared,
- high performance systems for testing purposes
- (e.g. dual, six-core Xeons with 24 Gbytes of RAM
- and plenty of disk space).
- Developers can use these systems for wider, more
- extensive testing while they continue to develop
- locally using their primary development system.
+ <listitem><para>
+ Keep the core system unchanged as much as
+ possible and do your work in layers on top of the
+ core system.
+ Doing so gives you a greater level of portability when
+ upgrading to new versions of the core system or Board
+ Support Packages (BSPs).
</para></listitem>
- <listitem><para>Enable the PR Service when package feeds
- need to be incremental with continually increasing
- <ulink url='&YOCTO_DOCS_REF_URL;#var-PR'>PR</ulink>
- values.
- Typically, this situation occurs when you use or
- publish package feeds and use a shared state.
- You should enable the PR Service for all users who
- use the shared state pool.
- For more information on the PR Service, see the
- "<link linkend='working-with-a-pr-service'>Working With a PR Service</link>".
+ <listitem><para>
+ Share layers amongst the developers of a
+ particular project and contain the policy configuration
+ that defines the project.
</para></listitem>
</itemizedlist>
- </para>
- </section>
- </section>
-
- <section id='best-practices-source-control-management'>
- <title>Source Control Management (SCM)</title>
-
- <para>
- Keeping your
- <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink>
- and any software you are developing under the
- control of an SCM system that is compatible
- with the OpenEmbedded build system is advisable.
- Of the SCMs BitBake supports, the
- Yocto Project team strongly recommends using
- <link linkend='git'>Git</link>.
- Git is a distributed system that is easy to backup,
- allows you to work remotely, and then connects back to the
- infrastructure.
- <note>
- For information about BitBake, see the
- <ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual</ulink>.
- </note>
- </para>
-
- <para>
- It is relatively easy to set up Git services and create
- infrastructure like
- <ulink url='&YOCTO_GIT_URL;'>http://git.yoctoproject.org</ulink>,
- which is based on server software called
- <filename>gitolite</filename> with <filename>cgit</filename>
- being used to generate the web interface that lets you view the
- repositories.
- The <filename>gitolite</filename> software identifies users
- using SSH keys and allows branch-based
- access controls to repositories that you can control as little
- or as much as necessary.
- </para>
-
- <note>
- The setup of these services is beyond the scope of this manual.
- However, sites such as these exist that describe how to perform
- setup:
- <itemizedlist>
- <listitem><para><ulink url='http://git-scm.com/book/ch4-8.html'>Git documentation</ulink>:
- Describes how to install <filename>gitolite</filename>
- on the server.</para></listitem>
- <listitem><para><ulink url='http://sitaramc.github.com/gitolite/master-toc.html'>The <filename>gitolite</filename> master index</ulink>:
- All topics for <filename>gitolite</filename>.
- </para></listitem>
- <listitem><para><ulink url='https://git.wiki.kernel.org/index.php/Interfaces,_frontends,_and_tools'>Interfaces, frontends, and tools</ulink>:
- Documentation on how to create interfaces and frontends
- for Git.</para></listitem>
- </itemizedlist>
- </note>
- </section>
-
- <section id='best-practices-autobuilders'>
- <title>Autobuilders</title>
-
- <para>
- Autobuilders are often the core of a development project.
- It is here that changes from individual developers are brought
- together and centrally tested and subsequent decisions about
- releases can be made.
- Autobuilders also allow for "continuous integration" style
- testing of software components and regression identification
- and tracking.
- </para>
-
- <para>
- See "<ulink url='http://autobuilder.yoctoproject.org'>Yocto Project Autobuilder</ulink>"
- for more information and links to buildbot.
- The Yocto Project team has found this implementation
- works well in this role.
- A public example of this is the Yocto Project
- Autobuilders, which we use to test the overall health of the
- project.
- </para>
-
- <para>
- The features of this system are:
- <itemizedlist>
- <listitem><para>Highlights when commits break the build.
- </para></listitem>
- <listitem><para>Populates an sstate cache from which
- developers can pull rather than requiring local
- builds.</para></listitem>
- <listitem><para>Allows commit hook triggers,
- which trigger builds when commits are made.
- </para></listitem>
- <listitem><para>Allows triggering of automated image booting
- and testing under the QuickEMUlator (QEMU).
- </para></listitem>
- <listitem><para>Supports incremental build testing and
- from-scratch builds.</para></listitem>
- <listitem><para>Shares output that allows developer
- testing and historical regression investigation.
- </para></listitem>
- <listitem><para>Creates output that can be used for releases.
- </para></listitem>
- <listitem><para>Allows scheduling of builds so that resources
- can be used efficiently.</para></listitem>
- </itemizedlist>
- </para>
- </section>
-
- <section id='best-practices-policies-and-change-flow'>
- <title>Policies and Change Flow</title>
-
- <para>
- The Yocto Project itself uses a hierarchical structure and a
- pull model.
- Scripts exist to create and send pull requests
- (i.e. <filename>create-pull-request</filename> and
- <filename>send-pull-request</filename>).
- This model is in line with other open source projects where
- maintainers are responsible for specific areas of the project
- and a single maintainer handles the final "top-of-tree" merges.
- </para>
-
- <note>
- You can also use a more collective push model.
- The <filename>gitolite</filename> software supports both the
- push and pull models quite easily.
- </note>
-
- <para>
- As with any development environment, it is important
- to document the policy used as well as any main project
- guidelines so they are understood by everyone.
- It is also a good idea to have well structured
- commit messages, which are usually a part of a project's
- guidelines.
- Good commit messages are essential when looking back in time and
- trying to understand why changes were made.
- </para>
-
- <para>
- If you discover that changes are needed to the core layer of the
- project, it is worth sharing those with the community as soon
- as possible.
- Chances are if you have discovered the need for changes, someone
- else in the community needs them also.
- </para>
- </section>
-
- <section id='best-practices-summary'>
- <title>Summary</title>
-
- <para>
- This section summarizes the key recommendations described in the
- previous sections:
- <itemizedlist>
- <listitem><para>Use <link linkend='git'>Git</link>
- as the source control system.</para></listitem>
- <listitem><para>Maintain your Metadata in layers that make sense
- for your situation.
- See the "<link linkend='understanding-and-creating-layers'>Understanding
- and Creating Layers</link>" section for more information on
- layers.</para></listitem>
- <listitem><para>
- Separate the project's Metadata and code by using
- separate Git repositories.
- See the
- "<link linkend='yocto-project-repositories'>Yocto Project Source Repositories</link>"
- section for information on these repositories.
- See the
- "<link linkend='getting-setup'>Getting Set Up</link>"
- section for information on how to set up local Git
- repositories for related upstream Yocto Project
- Git repositories.
- </para></listitem>
- <listitem><para>Set up the directory for the shared state cache
- (<ulink url='&YOCTO_DOCS_REF_URL;#var-SSTATE_DIR'><filename>SSTATE_DIR</filename></ulink>)
- where it makes sense.
- For example, set up the sstate cache on a system used
- by developers in the same organization and share the
- same source directories on their machines.
- </para></listitem>
- <listitem><para>Set up an Autobuilder and have it populate the
- sstate cache and source directories.</para></listitem>
- <listitem><para>The Yocto Project community encourages you
- to send patches to the project to fix bugs or add features.
- If you do submit patches, follow the project commit
- guidelines for writing good commit messages.
- See the "<link linkend='how-to-submit-a-change'>How to Submit a Change</link>"
- section.</para></listitem>
- <listitem><para>Send changes to the core sooner than later
- as others are likely to run into the same issues.
- For some guidance on mailing lists to use, see the list in the
- "<link linkend='how-to-submit-a-change'>How to Submit a Change</link>"
- section.
- For a description of the available mailing lists, see the
- "<ulink url='&YOCTO_DOCS_REF_URL;#resources-mailinglist'>Mailing Lists</ulink>"
- section in the Yocto Project Reference Manual.
- </para></listitem>
- </itemizedlist>
- </para>
- </section>
-</section>
-
-<section id='yocto-project-repositories'>
- <title>Yocto Project Source Repositories</title>
-
- <para>
- The Yocto Project team maintains complete source repositories for all
- Yocto Project files at
- <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi'></ulink>.
- This web-based source code browser is organized into categories by
- function such as IDE Plugins, Matchbox, Poky, Yocto Linux Kernel, and
- so forth.
- From the interface, you can click on any particular item in the "Name"
- column and see the URL at the bottom of the page that you need to clone
- a Git repository for that particular item.
- Having a local Git repository of the
- <link linkend='source-directory'>Source Directory</link>, which is
- usually named "poky", allows
- you to make changes, contribute to the history, and ultimately enhance
- the Yocto Project's tools, Board Support Packages, and so forth.
- </para>
-
- <para>
- For any supported release of Yocto Project, you can also go to the
- <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink> and
- select the "Downloads" tab and get a released tarball of the
- <filename>poky</filename> repository or any supported BSP tarballs.
- Unpacking these tarballs gives you a snapshot of the released
- files.
- <note><title>Notes</title>
- <itemizedlist>
- <listitem><para>
- The recommended method for setting up the Yocto Project
- <link linkend='source-directory'>Source Directory</link>
- and the files for supported BSPs
- (e.g., <filename>meta-intel</filename>) is to use
- <link linkend='git'>Git</link> to create a local copy of
- the upstream repositories.
- </para></listitem>
- <listitem><para>
- Be sure to always work in matching branches for both
- the selected BSP repository and the
- <link linkend='source-directory'>Source Directory</link>
- (i.e. <filename>poky</filename>) repository.
- For example, if you have checked out the "master" branch
- of <filename>poky</filename> and you are going to use
- <filename>meta-intel</filename>, be sure to checkout the
- "master" branch of <filename>meta-intel</filename>.
- </para></listitem>
- </itemizedlist>
- </note>
- </para>
-
- <para>
- In summary, here is where you can get the project files needed for development:
- <itemizedlist>
- <listitem><para id='source-repositories'><emphasis><ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi'>Source Repositories:</ulink></emphasis>
- This area contains IDE Plugins, Matchbox, Poky, Poky Support, Tools, Yocto Linux Kernel, and Yocto
- Metadata Layers.
- You can create local copies of Git repositories for each of these areas.</para>
- <para>
- <imagedata fileref="figures/source-repos.png" align="center" width="6in" depth="4in" />
</para></listitem>
- <listitem><para><anchor id='index-downloads' /><emphasis><ulink url='&YOCTO_DL_URL;/releases/'>Index of /releases:</ulink></emphasis>
- This is an index of releases such as
- the <trademark class='trade'>Eclipse</trademark>
- Yocto Plug-in, miscellaneous support, Poky, Pseudo, installers for cross-development toolchains,
- and all released versions of Yocto Project in the form of images or tarballs.
- Downloading and extracting these files does not produce a local copy of the
- Git repository but rather a snapshot of a particular release or image.</para>
- <para>
- <imagedata fileref="figures/index-downloads.png" align="center" width="6in" depth="3.5in" />
- </para></listitem>
- <listitem><para><emphasis>"Downloads" page for the
- <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink>:</emphasis>
- Access this page by going to the website and then selecting
- the "Downloads" tab.
- This page allows you to download any Yocto Project
- release or Board Support Package (BSP) in tarball form.
- The tarballs are similar to those found in the
- <ulink url='&YOCTO_DL_URL;/releases/'>Index of /releases:</ulink> area.</para>
- <para>
- <imagedata fileref="figures/yp-download.png" align="center" width="6in" depth="4in" />
- </para></listitem>
- </itemizedlist>
- </para>
-</section>
+ <listitem><para>
+ <emphasis>Set up an Autobuilder:</emphasis>
+ Autobuilders are often the core of the development
+ environment.
+ It is here that changes from individual developers are brought
+ together and centrally tested and subsequent decisions about
+ releases can be made.
+ Autobuilders also allow for "continuous integration" style
+ testing of software components and regression identification
+ and tracking.</para>
-<section id='yocto-project-terms'>
- <title>Yocto Project Terms</title>
+ <para>See "<ulink url='http://autobuilder.yoctoproject.org'>Yocto Project Autobuilder</ulink>"
+ for more information and links to buildbot.
+ The Yocto Project team has found this implementation
+ works well in this role.
+ A public example of this is the Yocto Project
+ Autobuilders, which we use to test the overall health of the
+ project.</para>
- <para>
- Following is a list of terms and definitions users new to the Yocto Project development
- environment might find helpful.
- While some of these terms are universal, the list includes them just in case:
- <itemizedlist>
- <listitem><para><emphasis>Append Files:</emphasis> Files that append build information to
- a recipe file.
- Append files are known as BitBake append files and <filename>.bbappend</filename> files.
- The OpenEmbedded build system expects every append file to have a corresponding
- recipe (<filename>.bb</filename>) file.
- Furthermore, the append file and corresponding recipe file
- must use the same root filename.
- The filenames can differ only in the file type suffix used (e.g.
- <filename>formfactor_0.0.bb</filename> and <filename>formfactor_0.0.bbappend</filename>).
- </para>
- <para>Information in append files extends or overrides the
- information in the similarly-named recipe file.
- For an example of an append file in use, see the
- "<link linkend='using-bbappend-files'>Using .bbappend Files</link>" section.
+ <para>The features of this system are:
+ <itemizedlist>
+ <listitem><para>
+ Highlights when commits break the build.
+ </para></listitem>
+ <listitem><para>
+ Populates an sstate cache from which
+ developers can pull rather than requiring local
+ builds.
+ </para></listitem>
+ <listitem><para>
+ Allows commit hook triggers,
+ which trigger builds when commits are made.
+ </para></listitem>
+ <listitem><para>
+ Allows triggering of automated image booting
+ and testing under the QuickEMUlator (QEMU).
+ </para></listitem>
+ <listitem><para>
+ Supports incremental build testing and
+ from-scratch builds.
+ </para></listitem>
+ <listitem><para>
+ Shares output that allows developer
+ testing and historical regression investigation.
+ </para></listitem>
+ <listitem><para>
+ Creates output that can be used for releases.
+ </para></listitem>
+ <listitem><para>
+ Allows scheduling of builds so that resources
+ can be used efficiently.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Set up Test Machines:</emphasis>
+ Use a small number of shared, high performance systems
+ for testing purposes.
+ Developers can use these systems for wider, more
+ extensive testing while they continue to develop
+ locally using their primary development system.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Document Policies and Change Flow:</emphasis>
+ The Yocto Project itself uses a hierarchical structure and a
+ pull model.
+ Scripts exist to create and send pull requests
+ (i.e. <filename>create-pull-request</filename> and
+ <filename>send-pull-request</filename>).
+ This model is in line with other open source projects where
+ maintainers are responsible for specific areas of the project
+ and a single maintainer handles the final "top-of-tree" merges.
<note>
- Append files can also use wildcard patterns in their version numbers
- so they can be applied to more than one version of the underlying recipe file.
- </note>
- </para></listitem>
- <listitem><para id='bitbake-term'><emphasis>BitBake:</emphasis>
- The task executor and scheduler used by the OpenEmbedded build
- system to build images.
- For more information on BitBake, see the
- <ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual</ulink>.
- </para></listitem>
- <listitem>
- <para id='build-directory'><emphasis>Build Directory:</emphasis>
- This term refers to the area used by the OpenEmbedded build
- system for builds.
- The area is created when you <filename>source</filename> the
- setup environment script that is found in the Source Directory
- (i.e. <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>
- or
- <ulink url='&YOCTO_DOCS_REF_URL;#structure-memres-core-script'><filename>oe-init-build-env-memres</filename></ulink>).
- The <ulink url='&YOCTO_DOCS_REF_URL;#var-TOPDIR'><filename>TOPDIR</filename></ulink>
- variable points to the Build Directory.</para>
-
- <para>
- You have a lot of flexibility when creating the Build
- Directory.
- Following are some examples that show how to create the
- directory.
- The examples assume your
- <link linkend='source-directory'>Source Directory</link> is
- named <filename>poky</filename>:
- <itemizedlist>
- <listitem><para>Create the Build Directory inside your
- Source Directory and let the name of the Build
- Directory default to <filename>build</filename>:
- <literallayout class='monospaced'>
- $ cd $HOME/poky
- $ source &OE_INIT_FILE;
- </literallayout></para></listitem>
- <listitem><para>Create the Build Directory inside your
- home directory and specifically name it
- <filename>test-builds</filename>:
- <literallayout class='monospaced'>
- $ cd $HOME
- $ source poky/&OE_INIT_FILE; test-builds
- </literallayout></para></listitem>
- <listitem><para>
- Provide a directory path and
- specifically name the Build Directory.
- Any intermediate folders in the pathname must
- exist.
- This next example creates a Build Directory named
- <filename>YP-&POKYVERSION;</filename>
- in your home directory within the existing
- directory <filename>mybuilds</filename>:
- <literallayout class='monospaced'>
- $cd $HOME
- $ source $HOME/poky/&OE_INIT_FILE; $HOME/mybuilds/YP-&POKYVERSION;
- </literallayout></para></listitem>
- </itemizedlist>
- <note>
- By default, the Build Directory contains
- <ulink url='&YOCTO_DOCS_REF_URL;#var-TMPDIR'><filename>TMPDIR</filename></ulink>,
- which is a temporary directory the build system uses for
- its work.
- <filename>TMPDIR</filename> cannot be under NFS.
- Thus, by default, the Build Directory cannot be under NFS.
- However, if you need the Build Directory to be under NFS,
- you can set this up by setting <filename>TMPDIR</filename>
- in your <filename>local.conf</filename> file
- to use a local drive.
- Doing so effectively separates <filename>TMPDIR</filename>
- from <filename>TOPDIR</filename>, which is the Build
- Directory.
- </note>
- </para></listitem>
- <listitem><para><emphasis>Classes:</emphasis> Files that provide for logic encapsulation
- and inheritance so that commonly used patterns can be defined once and then easily used
- in multiple recipes.
- For reference information on the Yocto Project classes, see the
- "<ulink url='&YOCTO_DOCS_REF_URL;#ref-classes'>Classes</ulink>" chapter of the
- Yocto Project Reference Manual.
- Class files end with the <filename>.bbclass</filename> filename extension.
- </para></listitem>
- <listitem><para><emphasis>Configuration File:</emphasis>
- Configuration information in various <filename>.conf</filename>
- files provides global definitions of variables.
- The <filename>conf/local.conf</filename> configuration file in
- the
- <link linkend='build-directory'>Build Directory</link>
- contains user-defined variables that affect every build.
- The <filename>meta-poky/conf/distro/poky.conf</filename>
- configuration file defines Yocto "distro" configuration
- variables used only when building with this policy.
- Machine configuration files, which
- are located throughout the
- <link linkend='source-directory'>Source Directory</link>, define
- variables for specific hardware and are only used when building
- for that target (e.g. the
- <filename>machine/beaglebone.conf</filename> configuration
- file defines variables for the Texas Instruments ARM Cortex-A8
- development board).
- Configuration files end with a <filename>.conf</filename>
- filename extension.
- </para></listitem>
- <listitem><para id='cross-development-toolchain'>
- <emphasis>Cross-Development Toolchain:</emphasis>
- In general, a cross-development toolchain is a collection of
- software development tools and utilities that run on one
- architecture and allow you to develop software for a
- different, or targeted, architecture.
- These toolchains contain cross-compilers, linkers, and
- debuggers that are specific to the target architecture.
- </para>
-
- <para>The Yocto Project supports two different cross-development
- toolchains:
- <itemizedlist>
- <listitem><para>A toolchain only used by and within
- BitBake when building an image for a target
- architecture.</para></listitem>
- <listitem><para>A relocatable toolchain used outside of
- BitBake by developers when developing applications
- that will run on a targeted device.
- </para></listitem>
- </itemizedlist>
- </para>
-
- <para>
- Creation of these toolchains is simple and automated.
- For information on toolchain concepts as they apply to the
- Yocto Project, see the
- "<ulink url='&YOCTO_DOCS_REF_URL;#cross-development-toolchain-generation'>Cross-Development Toolchain Generation</ulink>"
- section in the Yocto Project Reference Manual.
- You can also find more information on using the
- relocatable toolchain in the
- <ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Software Development Kit (SDK) Developer's Guide</ulink>.
- </para></listitem>
- <listitem><para><emphasis>Image:</emphasis>
- An image is an artifact of the BitBake build process given
- a collection of recipes and related Metadata.
- Images are the binary output that run on specific hardware or
- QEMU and are used for specific use-cases.
- For a list of the supported image types that the Yocto Project provides, see the
- "<ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Images</ulink>"
- chapter in the Yocto Project Reference Manual.</para></listitem>
- <listitem><para id='layer'><emphasis>Layer:</emphasis> A collection of recipes representing the core,
- a BSP, or an application stack.
- For a discussion specifically on BSP Layers, see the
- "<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-layers'>BSP Layers</ulink>"
- section in the Yocto Project Board Support Packages (BSP)
- Developer's Guide.</para></listitem>
- <listitem><para id='metadata'><emphasis>Metadata:</emphasis>
- The files that BitBake parses when building an image.
- In general, Metadata includes recipes, classes, and
- configuration files.
- In the context of the kernel ("kernel Metadata"),
- it refers to Metadata in the <filename>meta</filename>
- branches of the kernel source Git repositories.
- </para></listitem>
- <listitem><para id='oe-core'><emphasis>OE-Core:</emphasis> A core set of Metadata originating
- with OpenEmbedded (OE) that is shared between OE and the Yocto Project.
- This Metadata is found in the <filename>meta</filename> directory of the
- <link linkend='source-directory'>Source Directory</link>.</para></listitem>
- <listitem><para id='build-system-term'><emphasis>OpenEmbedded Build System:</emphasis>
- The build system specific to the Yocto Project.
- The OpenEmbedded build system is based on another project known
- as "Poky", which uses
- <link linkend='bitbake-term'>BitBake</link> as the task
- executor.
- Throughout the Yocto Project documentation set, the
- OpenEmbedded build system is sometimes referred to simply
- as "the build system".
- If other build systems, such as a host or target build system
- are referenced, the documentation clearly states the
- difference.
- <note>
- For some historical information about Poky, see the
- <link linkend='poky'>Poky</link> term.
- </note>
- </para></listitem>
- <listitem><para><emphasis>Package:</emphasis>
- In the context of the Yocto Project, this term refers to a
- recipe's packaged output produced by BitBake (i.e. a
- "baked recipe").
- A package is generally the compiled binaries produced from the
- recipe's sources.
- You "bake" something by running it through BitBake.</para>
- <para>It is worth noting that the term "package" can, in general, have subtle
- meanings. For example, the packages referred to in the
- "<ulink url='&YOCTO_DOCS_QS_URL;#packages'>The Build Host Packages</ulink>" section are
- compiled binaries that, when installed, add functionality to your Linux
- distribution.</para>
- <para>Another point worth noting is that historically within the Yocto Project,
- recipes were referred to as packages - thus, the existence of several BitBake
- variables that are seemingly mis-named,
- (e.g. <ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink>,
- <ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink>, and
- <ulink url='&YOCTO_DOCS_REF_URL;#var-PE'><filename>PE</filename></ulink>).
- </para></listitem>
- <listitem><para><emphasis>Package Groups:</emphasis>
- Arbitrary groups of software Recipes.
- You use package groups to hold recipes that, when built,
- usually accomplish a single task.
- For example, a package group could contain the recipes for a
- company’s proprietary or value-add software.
- Or, the package group could contain the recipes that enable
- graphics.
- A package group is really just another recipe.
- Because package group files are recipes, they end with the
- <filename>.bb</filename> filename extension.</para></listitem>
- <listitem><para id='poky'><emphasis>Poky:</emphasis>
- The term "poky" can mean several things.
- In its most general sense, it is an open-source
- project that was initially developed by OpenedHand.
- With OpenedHand, poky was developed off of the existing
- OpenEmbedded build system becoming a commercially
- supportable build system for embedded Linux.
- After Intel Corporation acquired OpenedHand, the
- project poky became the basis for the Yocto Project's
- build system.</para>
- <para>Within the Yocto Project source repositories,
- <filename>poky</filename> exists as a separate Git
- repository you can clone to yield a local copy on your
- host system.
- Thus, "poky" can refer to the local copy of the Source
- Directory used for development within the Yocto
- Project.</para>
- <para>Finally, "poky" can refer to the default
- <ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO'><filename>DISTRO</filename></ulink>
- (i.e. distribution) created when you use the Yocto
- Project in conjunction with the
- <filename>poky</filename> repository to build an image.
- </para></listitem>
- <listitem><para><emphasis>Recipe:</emphasis>
- A set of instructions for building packages.
- A recipe describes where you get source code, which patches
- to apply, how to configure the source, how to compile it and so on.
- Recipes also describe dependencies for libraries or for other
- recipes.
- Recipes represent the logical unit of execution, the software
- to build, the images to build, and use the
- <filename>.bb</filename> file extension.
- </para></listitem>
- <listitem>
- <para id='source-directory'><emphasis>Source Directory:</emphasis>
- This term refers to the directory structure created as a result
- of creating a local copy of the <filename>poky</filename> Git
- repository <filename>git://git.yoctoproject.org/poky</filename>
- or expanding a released <filename>poky</filename> tarball.
- <note>
- Creating a local copy of the <filename>poky</filename>
- Git repository is the recommended method for setting up
- your Source Directory.
- </note>
- Sometimes you might hear the term "poky directory" used to refer
- to this directory structure.
- <note>
- The OpenEmbedded build system does not support file or
- directory names that contain spaces.
- Be sure that the Source Directory you use does not contain
- these types of names.
+ You can also use a more collective push model.
+ The <filename>gitolite</filename> software supports both the
+ push and pull models quite easily.
</note></para>
- <para>The Source Directory contains BitBake, Documentation,
- Metadata and other files that all support the Yocto Project.
- Consequently, you must have the Source Directory in place on
- your development system in order to do any development using
- the Yocto Project.</para>
+ <para>As with any development environment, it is important
+ to document the policy used as well as any main project
+ guidelines so they are understood by everyone.
+ It is also a good idea to have well structured
+ commit messages, which are usually a part of a project's
+ guidelines.
+ Good commit messages are essential when looking back in time and
+ trying to understand why changes were made.</para>
- <para>When you create a local copy of the Git repository, you
- can name the repository anything you like.
- Throughout much of the documentation, "poky"
- is used as the name of the top-level folder of the local copy of
- the poky Git repository.
- So, for example, cloning the <filename>poky</filename> Git
- repository results in a local Git repository whose top-level
- folder is also named "poky".</para>
-
- <para>While it is not recommended that you use tarball expansion
- to set up the Source Directory, if you do, the top-level
- directory name of the Source Directory is derived from the
- Yocto Project release tarball.
- For example, downloading and unpacking
- <filename>&YOCTO_POKY_TARBALL;</filename> results in a
- Source Directory whose root folder is named
- <filename>&YOCTO_POKY;</filename>.</para>
-
- <para>It is important to understand the differences between the
- Source Directory created by unpacking a released tarball as
- compared to cloning
- <filename>git://git.yoctoproject.org/poky</filename>.
- When you unpack a tarball, you have an exact copy of the files
- based on the time of release - a fixed release point.
- Any changes you make to your local files in the Source Directory
- are on top of the release and will remain local only.
- On the other hand, when you clone the <filename>poky</filename>
- Git repository, you have an active development repository with
- access to the upstream repository's branches and tags.
- In this case, any local changes you make to the local
- Source Directory can be later applied to active development
- branches of the upstream <filename>poky</filename> Git
- repository.</para>
-
- <para>For more information on concepts related to Git
- repositories, branches, and tags, see the
- "<link linkend='repositories-tags-and-branches'>Repositories, Tags, and Branches</link>"
- section.</para></listitem>
- <listitem><para><emphasis>Task:</emphasis>
- A unit of execution for BitBake (e.g.
- <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-compile'><filename>do_compile</filename></ulink>,
- <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-fetch'><filename>do_fetch</filename></ulink>,
- <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-patch'><filename>do_patch</filename></ulink>,
- and so forth).
+ <para>If you discover that changes are needed to the core
+ layer of the project, it is worth sharing those with the
+ community as soon as possible.
+ Chances are if you have discovered the need for changes,
+ someone else in the community needs them also.
</para></listitem>
- <listitem><para><emphasis>Upstream:</emphasis> A reference to source code or repositories
- that are not local to the development system but located in a master area that is controlled
- by the maintainer of the source code.
- For example, in order for a developer to work on a particular piece of code, they need to
- first get a copy of it from an "upstream" source.</para></listitem>
- </itemizedlist>
- </para>
-</section>
-
-<section id='licensing'>
- <title>Licensing</title>
-
- <para>
- Because open source projects are open to the public, they have different licensing structures in place.
- License evolution for both Open Source and Free Software has an interesting history.
- If you are interested in this history, you can find basic information here:
- <itemizedlist>
- <listitem><para><ulink url='http://en.wikipedia.org/wiki/Open-source_license'>Open source license history</ulink>
- </para></listitem>
- <listitem><para><ulink url='http://en.wikipedia.org/wiki/Free_software_license'>Free software license
- history</ulink></para></listitem>
- </itemizedlist>
- </para>
-
- <para>
- In general, the Yocto Project is broadly licensed under the Massachusetts Institute of Technology
- (MIT) License.
- MIT licensing permits the reuse of software within proprietary software as long as the
- license is distributed with that software.
- MIT is also compatible with the GNU General Public License (GPL).
- Patches to the Yocto Project follow the upstream licensing scheme.
- You can find information on the MIT license
- <ulink url='http://www.opensource.org/licenses/mit-license.php'>here</ulink>.
- You can find information on the GNU GPL <ulink url='http://www.opensource.org/licenses/LGPL-3.0'>
- here</ulink>.
- </para>
-
- <para>
- When you build an image using the Yocto Project, the build process uses a
- known list of licenses to ensure compliance.
- You can find this list in the
- <link linkend='source-directory'>Source Directory</link> at
- <filename>meta/files/common-licenses</filename>.
- Once the build completes, the list of all licenses found and used during that build are
- kept in the
- <link linkend='build-directory'>Build Directory</link> at
- <filename>tmp/deploy/licenses</filename>.
- </para>
-
- <para>
- If a module requires a license that is not in the base list, the build process
- generates a warning during the build.
- These tools make it easier for a developer to be certain of the licenses with which
- their shipped products must comply.
- However, even with these tools it is still up to the developer to resolve potential licensing issues.
- </para>
-
- <para>
- The base list of licenses used by the build process is a combination of the Software Package
- Data Exchange (SPDX) list and the Open Source Initiative (OSI) projects.
- <ulink url='http://spdx.org'>SPDX Group</ulink> is a working group of the Linux Foundation
- that maintains a specification
- for a standard format for communicating the components, licenses, and copyrights
- associated with a software package.
- <ulink url='http://opensource.org'>OSI</ulink> is a corporation dedicated to the Open Source
- Definition and the effort for reviewing and approving licenses that
- conform to the Open Source Definition (OSD).
- </para>
-
- <para>
- You can find a list of the combined SPDX and OSI licenses that the
- Yocto Project uses in the
- <filename>meta/files/common-licenses</filename> directory in your
- <link linkend='source-directory'>Source Directory</link>.
- </para>
-
- <para>
- For information that can help you maintain compliance with various
- open source licensing during the lifecycle of a product created using
- the Yocto Project, see the
- "<link linkend='maintaining-open-source-license-compliance-during-your-products-lifecycle'>Maintaining Open Source License Compliance During Your Product's Lifecycle</link>"
- section.
- </para>
-</section>
-
-<section id='git'>
- <title>Git</title>
-
- <para>
- The Yocto Project makes extensive use of Git,
- which is a free, open source distributed version control system.
- Git supports distributed development, non-linear development, and can handle large projects.
- It is best that you have some fundamental understanding of how Git tracks projects and
- how to work with Git if you are going to use the Yocto Project for development.
- This section provides a quick overview of how Git works and provides you with a summary
- of some essential Git commands.
- </para>
-
- <para>
- For more information on Git, see
- <ulink url='http://git-scm.com/documentation'></ulink>.
- If you need to download Git, go to <ulink url='http://git-scm.com/download'></ulink>.
- </para>
-
- <section id='repositories-tags-and-branches'>
- <title>Repositories, Tags, and Branches</title>
-
- <para>
- As mentioned earlier in the section
- "<link linkend='yocto-project-repositories'>Yocto Project Source Repositories</link>",
- the Yocto Project maintains source repositories at
- <ulink url='&YOCTO_GIT_URL;/cgit.cgi'></ulink>.
- If you look at this web-interface of the repositories, each item is a separate
- Git repository.
- </para>
-
- <para>
- Git repositories use branching techniques that track content change (not files)
- within a project (e.g. a new feature or updated documentation).
- Creating a tree-like structure based on project divergence allows for excellent historical
- information over the life of a project.
- This methodology also allows for an environment from which you can do lots of
- local experimentation on projects as you develop changes or new features.
- </para>
-
- <para>
- A Git repository represents all development efforts for a given project.
- For example, the Git repository <filename>poky</filename> contains all changes
- and developments for Poky over the course of its entire life.
- That means that all changes that make up all releases are captured.
- The repository maintains a complete history of changes.
- </para>
-
- <para>
- You can create a local copy of any repository by "cloning" it with the Git
- <filename>clone</filename> command.
- When you clone a Git repository, you end up with an identical copy of the
- repository on your development system.
- Once you have a local copy of a repository, you can take steps to develop locally.
- For examples on how to clone Git repositories, see the
- "<link linkend='getting-setup'>Getting Set Up</link>" section.
- </para>
-
- <para>
- It is important to understand that Git tracks content change and
- not files.
- Git uses "branches" to organize different development efforts.
- For example, the <filename>poky</filename> repository has
- several branches that include the current
- <filename>&DISTRO_NAME_NO_CAP;</filename> branch, the
- <filename>master</filename> branch, and many branches for past
- Yocto Project releases.
- You can see all the branches by going to
- <ulink url='&YOCTO_GIT_URL;/cgit.cgi/poky/'></ulink> and
- clicking on the
- <filename><ulink url='&YOCTO_GIT_URL;/cgit.cgi/poky/refs/heads'>[...]</ulink></filename>
- link beneath the "Branch" heading.
- </para>
-
- <para>
- Each of these branches represents a specific area of development.
- The <filename>master</filename> branch represents the current or most recent
- development.
- All other branches represent offshoots of the <filename>master</filename>
- branch.
- </para>
-
- <para>
- When you create a local copy of a Git repository, the copy has the same set
- of branches as the original.
- This means you can use Git to create a local working area (also called a branch)
- that tracks a specific development branch from the source Git repository.
- in other words, you can define your local Git environment to work on any development
- branch in the repository.
- To help illustrate, here is a set of commands that creates a local copy of the
- <filename>poky</filename> Git repository and then creates and checks out a local
- Git branch that tracks the Yocto Project &DISTRO; Release (&DISTRO_NAME;) development:
- <literallayout class='monospaced'>
- $ cd ~
- $ git clone git://git.yoctoproject.org/poky
- $ cd poky
- $ git checkout -b &DISTRO_NAME_NO_CAP; origin/&DISTRO_NAME_NO_CAP;
- </literallayout>
- In this example, the name of the top-level directory of your local
- <link linkend='source-directory'>Source Directory</link>
- is "poky" and the name of that local working area (local branch)
- you just created and checked out is "&DISTRO_NAME_NO_CAP;".
- The files in your local repository now reflect the same files that
- are in the "&DISTRO_NAME_NO_CAP;" development branch of the
- Yocto Project's "poky" upstream repository.
- It is important to understand that when you create and checkout a
- local working branch based on a branch name,
- your local environment matches the "tip" of that development branch
- at the time you created your local branch, which could be
- different from the files at the time of a similarly named release.
- In other words, creating and checking out a local branch based on
- the "&DISTRO_NAME_NO_CAP;" branch name is not the same as
- cloning and checking out the "master" branch.
- Keep reading to see how you create a local snapshot of a Yocto
- Project Release.
- </para>
-
- <para>
- Git uses "tags" to mark specific changes in a repository.
- Typically, a tag is used to mark a special point such as the final
- change before a project is released.
- You can see the tags used with the <filename>poky</filename> Git
- repository by going to
- <ulink url='&YOCTO_GIT_URL;/cgit.cgi/poky/'></ulink> and
- clicking on the
- <filename><ulink url='&YOCTO_GIT_URL;/cgit.cgi/poky/refs/tags'>[...]</ulink></filename>
- link beneath the "Tag" heading.
- </para>
-
- <para>
- Some key tags are
- <filename>dizzy-12.0.0</filename>,
- <filename>fido-13.0.0</filename>,
- <filename>jethro-14.0.0</filename>, and
- <filename>&DISTRO_NAME_NO_CAP;-&POKYVERSION;</filename>.
- These tags represent Yocto Project releases.
- </para>
-
- <para>
- When you create a local copy of the Git repository, you also have access to all the
- tags.
- Similar to branches, you can create and checkout a local working Git branch based
- on a tag name.
- When you do this, you get a snapshot of the Git repository that reflects
- the state of the files when the change was made associated with that tag.
- The most common use is to checkout a working branch that matches a specific
- Yocto Project release.
- Here is an example:
- <literallayout class='monospaced'>
- $ cd ~
- $ git clone git://git.yoctoproject.org/poky
- $ cd poky
- $ git checkout -b my-&DISTRO_NAME_NO_CAP;-&POKYVERSION; &DISTRO_NAME_NO_CAP;-&POKYVERSION;
- </literallayout>
- In this example, the name of the top-level directory of your local Yocto Project
- Files Git repository is <filename>poky</filename>.
- And, the name of the local branch you have created and checked out is
- <filename>my-&DISTRO_NAME_NO_CAP;-&POKYVERSION;</filename>.
- The files in your repository now exactly match the Yocto Project &DISTRO;
- Release tag (<filename>&DISTRO_NAME_NO_CAP;-&POKYVERSION;</filename>).
- It is important to understand that when you create and checkout a local
- working branch based on a tag, your environment matches a specific point
- in time and not the entire development branch.
- </para>
- </section>
-
- <section id='basic-commands'>
- <title>Basic Commands</title>
-
- <para>
- Git has an extensive set of commands that lets you manage changes and perform
- collaboration over the life of a project.
- Conveniently though, you can manage with a small set of basic operations and workflows
- once you understand the basic philosophy behind Git.
- You do not have to be an expert in Git to be functional.
- A good place to look for instruction on a minimal set of Git commands is
- <ulink url='http://git-scm.com/documentation'>here</ulink>.
- If you need to download Git, you can do so
- <ulink url='http://git-scm.com/download'>here</ulink>, although
- any reasonably current Linux distribution should already have an
- installable package for Git.
- </para>
-
- <para>
- If you do not know much about Git, you should educate
- yourself by visiting the links previously mentioned.
- </para>
-
- <para>
- The following list briefly describes some basic Git operations as a way to get started.
- As with any set of commands, this list (in most cases) simply shows the base command and
- omits the many arguments they support.
- See the Git documentation for complete descriptions and strategies on how to use these commands:
- <itemizedlist>
- <listitem><para><emphasis><filename>git init</filename>:</emphasis> Initializes an empty Git repository.
- You cannot use Git commands unless you have a <filename>.git</filename> repository.</para></listitem>
- <listitem><para><emphasis><filename>git clone</filename>:</emphasis>
- Creates a local clone of a Git repository.
- During collaboration, this command allows you to create a
- local Git repository that is on equal footing with a fellow
- developer’s Git repository.
- </para></listitem>
- <listitem><para><emphasis><filename>git add</filename>:</emphasis> Stages updated file contents
- to the index that
- Git uses to track changes.
- You must stage all files that have changed before you can commit them.</para></listitem>
- <listitem><para><emphasis><filename>git commit</filename>:</emphasis> Creates a "commit" that documents
- the changes you made.
- Commits are used for historical purposes, for determining if a maintainer of a project
- will allow the change, and for ultimately pushing the change from your local Git repository
- into the project’s upstream (or master) repository.</para></listitem>
- <listitem><para><emphasis><filename>git status</filename>:</emphasis> Reports any modified files that
- possibly need to be staged and committed.</para></listitem>
- <listitem><para><emphasis><filename>git checkout</filename> <replaceable>branch-name</replaceable>:</emphasis> Changes
- your working branch.
- This command is analogous to "cd".</para></listitem>
- <listitem><para><emphasis><filename>git checkout –b</filename> <replaceable>working-branch</replaceable>:</emphasis> Creates
- a working branch on your local machine where you can isolate work.
- It is a good idea to use local branches when adding specific features or changes.
- This way if you do not like what you have done you can easily get rid of the work.</para></listitem>
- <listitem><para><emphasis><filename>git branch</filename>:</emphasis> Reports
- existing local branches and
- tells you the branch in which you are currently working.</para></listitem>
- <listitem><para><emphasis><filename>git branch -D</filename> <replaceable>branch-name</replaceable>:</emphasis>
- Deletes an existing local branch.
- You need to be in a local branch other than the one you are deleting
- in order to delete <replaceable>branch-name</replaceable>.</para></listitem>
- <listitem><para><emphasis><filename>git pull</filename>:</emphasis> Retrieves information
- from an upstream Git
- repository and places it in your local Git repository.
- You use this command to make sure you are synchronized with the repository
- from which you are basing changes (.e.g. the master branch).</para></listitem>
- <listitem><para><emphasis><filename>git push</filename>:</emphasis>
- Sends all your committed local changes to an upstream Git
- repository (e.g. a contribution repository).
- The maintainer of the project draws from these repositories
- when adding changes to the project’s master repository or
- other development branch.
- </para></listitem>
- <listitem><para><emphasis><filename>git merge</filename>:</emphasis> Combines or adds changes from one
- local branch of your repository with another branch.
- When you create a local Git repository, the default branch is named "master".
- A typical workflow is to create a temporary branch for isolated work, make and commit your
- changes, switch to your local master branch, merge the changes from the temporary branch into the
- local master branch, and then delete the temporary branch.</para></listitem>
- <listitem><para><emphasis><filename>git cherry-pick</filename>:</emphasis> Choose and apply specific
- commits from one branch into another branch.
- There are times when you might not be able to merge all the changes in one branch with
- another but need to pick out certain ones.</para></listitem>
- <listitem><para><emphasis><filename>gitk</filename>:</emphasis> Provides a GUI view of the branches
- and changes in your local Git repository.
- This command is a good way to graphically see where things have diverged in your
- local repository.</para></listitem>
- <listitem><para><emphasis><filename>git log</filename>:</emphasis> Reports a history of your changes to the
- repository.</para></listitem>
- <listitem><para><emphasis><filename>git diff</filename>:</emphasis> Displays line-by-line differences
- between your local working files and the same files in the upstream Git repository that your
- branch currently tracks.</para></listitem>
- </itemizedlist>
- </para>
- </section>
-</section>
-
-<section id='workflows'>
- <title>Workflows</title>
-
- <para>
- This section provides some overview on workflows using Git.
- In particular, the information covers basic practices that describe roles and actions in a
- collaborative development environment.
- Again, if you are familiar with this type of development environment, you might want to just
- skip this section.
- </para>
-
- <para>
- The Yocto Project files are maintained using Git in a "master" branch whose Git history
- tracks every change and whose structure provides branches for all diverging functionality.
- Although there is no need to use Git, many open source projects do so.
- For the Yocto Project, a key individual called the "maintainer" is responsible for the "master"
- branch of a given Git repository.
- The "master" branch is the “upstream” repository where the final builds of the project occur.
- The maintainer is responsible for accepting changes from other developers and for
- organizing the underlying branch structure to reflect release strategies and so forth.
- <note>For information on finding out who is responsible for (maintains)
- a particular area of code, see the
- "<link linkend='how-to-submit-a-change'>How to Submit a Change</link>"
- section.
- </note>
- </para>
-
- <para>
- The project also has an upstream contribution Git repository named
- <filename>poky-contrib</filename>.
- You can see all the branches in this repository using the web interface
- of the
- <ulink url='&YOCTO_GIT_URL;'>Source Repositories</ulink> organized
- within the "Poky Support" area.
- These branches temporarily hold changes to the project that have been
- submitted or committed by the Yocto Project development team and by
- community members who contribute to the project.
- The maintainer determines if the changes are qualified to be moved
- from the "contrib" branches into the "master" branch of the Git
- repository.
- </para>
-
- <para>
- Developers (including contributing community members) create and maintain cloned repositories
- of the upstream "master" branch.
- These repositories are local to their development platforms and are used to develop changes.
- When a developer is satisfied with a particular feature or change, they "push" the changes
- to the appropriate "contrib" repository.
- </para>
-
- <para>
- Developers are responsible for keeping their local repository up-to-date with "master".
- They are also responsible for straightening out any conflicts that might arise within files
- that are being worked on simultaneously by more than one person.
- All this work is done locally on the developer’s machines before anything is pushed to a
- "contrib" area and examined at the maintainer’s level.
- </para>
-
- <para>
- A somewhat formal method exists by which developers commit changes and push them into the
- "contrib" area and subsequently request that the maintainer include them into "master"
- This process is called “submitting a patch” or "submitting a change."
- For information on submitting patches and changes, see the
- "<link linkend='how-to-submit-a-change'>How to Submit a Change</link>" section.
- </para>
-
- <para>
- To summarize the environment: a single point of entry exists for
- changes into the project’s "master" branch of the Git repository,
- which is controlled by the project’s maintainer.
- And, a set of developers exist who independently develop, test, and
- submit changes to "contrib" areas for the maintainer to examine.
- The maintainer then chooses which changes are going to become a
- permanent part of the project.
- </para>
-
- <para>
- <imagedata fileref="figures/git-workflow.png" width="6in" depth="3in" align="left" scalefit="1" />
- </para>
-
- <para>
- While each development environment is unique, there are some best practices or methods
- that help development run smoothly.
- The following list describes some of these practices.
- For more information about Git workflows, see the workflow topics in the
- <ulink url='http://book.git-scm.com'>Git Community Book</ulink>.
- <itemizedlist>
- <listitem><para><emphasis>Make Small Changes:</emphasis> It is best to keep the changes you commit
- small as compared to bundling many disparate changes into a single commit.
- This practice not only keeps things manageable but also allows the maintainer
- to more easily include or refuse changes.</para>
- <para>It is also good practice to leave the repository in a state that allows you to
- still successfully build your project. In other words, do not commit half of a feature,
- then add the other half as a separate, later commit.
- Each commit should take you from one buildable project state to another
- buildable state.</para></listitem>
- <listitem><para><emphasis>Use Branches Liberally:</emphasis> It is very easy to create, use, and
- delete local branches in your working Git repository.
- You can name these branches anything you like.
- It is helpful to give them names associated with the particular feature or change
- on which you are working.
- Once you are done with a feature or change and have merged it
- into your local master branch, simply discard the temporary
- branch.</para></listitem>
- <listitem><para><emphasis>Merge Changes:</emphasis> The <filename>git merge</filename>
- command allows you to take the
- changes from one branch and fold them into another branch.
- This process is especially helpful when more than a single developer might be working
- on different parts of the same feature.
- Merging changes also automatically identifies any collisions or "conflicts"
- that might happen as a result of the same lines of code being altered by two different
- developers.</para></listitem>
- <listitem><para><emphasis>Manage Branches:</emphasis> Because branches are easy to use, you should
- use a system where branches indicate varying levels of code readiness.
- For example, you can have a "work" branch to develop in, a "test" branch where the code or
- change is tested, a "stage" branch where changes are ready to be committed, and so forth.
- As your project develops, you can merge code across the branches to reflect ever-increasing
- stable states of the development.</para></listitem>
- <listitem><para><emphasis>Use Push and Pull:</emphasis> The push-pull workflow is based on the
- concept of developers "pushing" local commits to a remote repository, which is
- usually a contribution repository.
- This workflow is also based on developers "pulling" known states of the project down into their
- local development repositories.
- The workflow easily allows you to pull changes submitted by other developers from the
- upstream repository into your work area ensuring that you have the most recent software
- on which to develop.
- The Yocto Project has two scripts named <filename>create-pull-request</filename> and
- <filename>send-pull-request</filename> that ship with the release to facilitate this
- workflow.
- You can find these scripts in the <filename>scripts</filename>
- folder of the
- <link linkend='source-directory'>Source Directory</link>.
- For information on how to use these scripts, see the
- "<link linkend='pushing-a-change-upstream'>Using Scripts to Push a Change Upstream and Request a Pull</link>" section.
+ <listitem><para>
+ <emphasis>Development Environment Summary:</emphasis>
+ Aside from the previous steps, some best practices exist
+ within the Yocto Project development environment.
+ Consider the following:
+ <itemizedlist>
+ <listitem><para>
+ Use <ulink url='&YOCTO_DOCS_REF_URL;#git'>Git</ulink>
+ as the source control system.
+ </para></listitem>
+ <listitem><para>
+ Maintain your Metadata in layers that make sense
+ for your situation.
+ See the "<link linkend='understanding-and-creating-layers'>Understanding
+ and Creating Layers</link>" section for more information on
+ layers.
+ </para></listitem>
+ <listitem><para>
+ Separate the project's Metadata and code by using
+ separate Git repositories.
+ See the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#yocto-project-repositories'>Yocto Project Source Repositories</ulink>"
+ section for information on these repositories.
+ See the
+ "<link linkend='working-with-yocto-project-source-files'>Working With Yocto Project Source Files</link>"
+ section for information on how to set up local Git
+ repositories for related upstream Yocto Project
+ Git repositories.
+ </para></listitem>
+ <listitem><para>
+ Set up the directory for the shared state cache
+ (<ulink url='&YOCTO_DOCS_REF_URL;#var-SSTATE_DIR'><filename>SSTATE_DIR</filename></ulink>)
+ where it makes sense.
+ For example, set up the sstate cache on a system used
+ by developers in the same organization and share the
+ same source directories on their machines.
+ </para></listitem>
+ <listitem><para>
+ Set up an Autobuilder and have it populate the
+ sstate cache and source directories.
+ </para></listitem>
+ <listitem><para>
+ The Yocto Project community encourages you
+ to send patches to the project to fix bugs or add features.
+ If you do submit patches, follow the project commit
+ guidelines for writing good commit messages.
+ See the "<link linkend='how-to-submit-a-change'>Submitting a Change to the Yocto Project</link>"
+ section.
+ </para></listitem>
+ <listitem><para>
+ Send changes to the core sooner than later
+ as others are likely to run into the same issues.
+ For some guidance on mailing lists to use, see the list in the
+ "<link linkend='how-to-submit-a-change'>Submitting a Change to the Yocto Project</link>"
+ section.
+ For a description of the available mailing lists, see the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#resources-mailinglist'>Mailing Lists</ulink>"
+ section in the Yocto Project Reference Manual.
+ </para></listitem>
+ </itemizedlist>
</para></listitem>
- <listitem><para><emphasis>Patch Workflow:</emphasis> This workflow allows you to notify the
- maintainer through an email that you have a change (or patch) you would like considered
- for the "master" branch of the Git repository.
- To send this type of change, you format the patch and then send the email using the Git commands
- <filename>git format-patch</filename> and <filename>git send-email</filename>.
- For information on how to use these scripts, see the
- "<link linkend='how-to-submit-a-change'>How to Submit a Change</link>"
- section.
- </para></listitem>
- </itemizedlist>
- </para>
-</section>
-
-<section id='tracking-bugs'>
- <title>Tracking Bugs</title>
-
- <para>
- The Yocto Project uses its own implementation of
- <ulink url='http://www.bugzilla.org/about/'>Bugzilla</ulink> to track bugs.
- Implementations of Bugzilla work well for group development because they track bugs and code
- changes, can be used to communicate changes and problems with developers, can be used to
- submit and review patches, and can be used to manage quality assurance.
- The home page for the Yocto Project implementation of Bugzilla is
- <ulink url='&YOCTO_BUGZILLA_URL;'>&YOCTO_BUGZILLA_URL;</ulink>.
- </para>
-
- <para>
- Sometimes it is helpful to submit, investigate, or track a bug against the Yocto Project itself
- such as when discovering an issue with some component of the build system that acts contrary
- to the documentation or your expectations.
- Following is the general procedure for submitting a new bug using the Yocto Project
- Bugzilla.
- You can find more information on defect management, bug tracking, and feature request
- processes all accomplished through the Yocto Project Bugzilla on the
- <ulink url='&YOCTO_WIKI_URL;/wiki/Bugzilla_Configuration_and_Bug_Tracking'>wiki page</ulink>.
- <orderedlist>
- <listitem><para>Always use the Yocto Project implementation of Bugzilla to submit
- a bug.</para></listitem>
- <listitem><para>When submitting a new bug, be sure to choose the appropriate
- Classification, Product, and Component for which the issue was found.
- Defects for the Yocto Project fall into one of seven classifications:
- Yocto Project Components, Infrastructure, Build System & Metadata,
- Documentation, QA/Testing, Runtime and Hardware.
- Each of these Classifications break down into multiple Products and, in some
- cases, multiple Components.</para></listitem>
- <listitem><para>Use the bug form to choose the correct Hardware and Architecture
- for which the bug applies.</para></listitem>
- <listitem><para>Indicate the Yocto Project version you were using when the issue
- occurred.</para></listitem>
- <listitem><para>Be sure to indicate the Severity of the bug.
- Severity communicates how the bug impacted your work.</para></listitem>
- <listitem><para>Select the appropriate "Documentation change" item
- for the bug.
- Fixing a bug may or may not affect the Yocto Project
- documentation.</para></listitem>
- <listitem><para>Provide a brief summary of the issue.
- Try to limit your summary to just a line or two and be sure to capture the
- essence of the issue.</para></listitem>
- <listitem><para>Provide a detailed description of the issue.
- You should provide as much detail as you can about the context, behavior, output,
- and so forth that surrounds the issue.
- You can even attach supporting files for output from logs by
- using the "Add an attachment" button.</para></listitem>
- <listitem><para>Be sure to copy the appropriate people in the
- "CC List" for the bug.
- See the "<link linkend='how-to-submit-a-change'>How to Submit a Change</link>"
- section for information about finding out who is responsible
- for code.</para></listitem>
- <listitem><para>Submit the bug by clicking the "Submit Bug" button.</para></listitem>
</orderedlist>
</para>
</section>
+<section id='submitting-a-defect-against-the-yocto-project'>
+ <title>Submitting a Defect Against the Yocto Project</title>
+
+ <para>
+ Use the Yocto Project implementation of
+ <ulink url='http://www.bugzilla.org/about/'>Bugzilla</ulink>
+ to submit a defect (bug) against the Yocto Project.
+ For additional information on this implementation of Bugzilla see the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#resources-bugtracker'>Yocto Project Bugzilla</ulink>"
+ section in the Yocto Project Reference Manual.
+ For more detail on any of the following steps, see the Yocto Project
+ <ulink url='&YOCTO_WIKI_URL;/wiki/Bugzilla_Configuration_and_Bug_Tracking'>Bugzilla wiki page</ulink>.
+ </para>
+
+ <para>
+ Use the following general steps to submit a bug"
+
+ <orderedlist>
+ <listitem><para>
+ Open the Yocto Project implementation of
+ <ulink url='&YOCTO_BUGZILLA_URL;'>Bugzilla</ulink>.
+ </para></listitem>
+ <listitem><para>
+ Click "File a Bug" to enter a new bug.
+ </para></listitem>
+ <listitem><para>
+ Choose the appropriate "Classification", "Product", and
+ "Component" for which the bug was found.
+ Bugs for the Yocto Project fall into one of several
+ classifications, which in turn break down into several
+ products and components.
+ For example, for a bug against the
+ <filename>meta-intel</filename> layer, you would choose
+ "Build System, Metadata & Runtime", "BSPs", and
+ "bsps-meta-intel", respectively.
+ </para></listitem>
+ <listitem><para>
+ Choose the "Version" of the Yocto Project for which you found
+ the bug (e.g. &DISTRO;).
+ </para></listitem>
+ <listitem><para>
+ Determine and select the "Severity" of the bug.
+ The severity indicates how the bug impacted your work.
+ </para></listitem>
+ <listitem><para>
+ Choose the "Hardware" that the bug impacts.
+ </para></listitem>
+ <listitem><para>
+ Choose the "Architecture" that the bug impacts.
+ </para></listitem>
+ <listitem><para>
+ Choose a "Documentation change" item for the bug.
+ Fixing a bug might or might not affect the Yocto Project
+ documentation.
+ If you are unsure of the impact to the documentation, select
+ "Don't Know".
+ </para></listitem>
+ <listitem><para>
+ Provide a brief "Summary" of the bug.
+ Try to limit your summary to just a line or two and be sure
+ to capture the essence of the bug.
+ </para></listitem>
+ <listitem><para>
+ Provide a detailed "Description" of the bug.
+ You should provide as much detail as you can about the context,
+ behavior, output, and so forth that surrounds the bug.
+ You can even attach supporting files for output from logs by
+ using the "Add an attachment" button.
+ </para></listitem>
+ <listitem><para>
+ Click the "Submit Bug" button submit the bug.
+ A new Bugzilla number is assigned to the bug and the defect
+ is logged in the bug tracking system.
+ </para></listitem>
+ </orderedlist>
+ Once you file a bug, the bug is processed by the Yocto Project Bug
+ Triage Team and further details concerning the bug are assigned
+ (e.g. priority and owner).
+ You are the "Submitter" of the bug and any further categorization,
+ progress, or comments on the bug result in Bugzilla sending you an
+ automated email concerning the particular change or progress to the
+ bug.
+ </para>
+</section>
+
<section id='how-to-submit-a-change'>
- <title>How to Submit a Change</title>
+ <title>Submitting a Change to the Yocto Project</title>
<para>
Contributions to the Yocto Project and OpenEmbedded are very welcome.
- Because the system is extremely configurable and flexible, we recognize that developers
- will want to extend, configure or optimize it for their specific uses.
- You should send patches to the appropriate mailing list so that they
- can be reviewed and merged by the appropriate maintainer.
+ Because the system is extremely configurable and flexible, we recognize
+ that developers will want to extend, configure or optimize it for
+ their specific uses.
</para>
- <section id='submit-change-overview'>
- <title>Overview</title>
+ <para>
+ The Yocto Project uses a mailing list and a patch-based workflow
+ that is similar to the Linux kernel but contains important
+ differences.
+ In general, a mailing list exists through which you can submit
+ patches.
+ You should send patches to the appropriate mailing list so that they
+ can be reviewed and merged by the appropriate maintainer.
+ The specific mailing list you need to use depends on the
+ location of the code you are changing.
+ Each component (e.g. layer) should have a
+ <filename>README</filename> file that indicates where to send
+ the changes and which process to follow.
+ </para>
- <para>
- The Yocto Project uses a mailing list and patch-based workflow
- that is similar to the Linux kernel but contains important
- differences.
- In general, a mailing list exists through which you can submit
- patches.
- The specific mailing list you need to use depends on the
- location of the code you are changing.
- Each component (e.g. layer) should have a
- <filename>README</filename> file that indicates where to send
- the changes and which process to follow.
- </para>
+ <para>
+ You can send the patch to the mailing list using whichever approach
+ you feel comfortable with to generate the patch.
+ Once sent, the patch is usually reviewed by the community at large.
+ If somebody has concerns with the patch, they will usually voice
+ their concern over the mailing list.
+ If a patch does not receive any negative reviews, the maintainer of
+ the affected layer typically takes the patch, tests it, and then
+ based on successful testing, merges the patch.
+ </para>
- <para>
- You can send the patch to the mailing list using whichever approach
- you feel comfortable with to generate the patch.
- Once sent, the patch is usually reviewed by the community at large.
- If somebody has concerns with the patch, they will usually voice
- their concern over the mailing list.
- If a patch does not receive any negative reviews, the maintainer of
- the affected layer typically takes the patch, tests it, and then
- based on successful testing, merges the patch.
- </para>
+ <para id='figuring-out-the-mailing-list-to-use'>
+ The "poky" repository, which is the Yocto Project's reference build
+ environment, is a hybrid repository that contains several
+ individual pieces (e.g. BitBake, Metadata, documentation,
+ and so forth) built using the combo-layer tool.
+ The upstream location used for submitting changes varies by
+ component:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Core Metadata:</emphasis>
+ Send your patch to the
+ <ulink url='http://lists.openembedded.org/mailman/listinfo/openembedded-core'>openembedded-core</ulink>
+ mailing list. For example, a change to anything under
+ the <filename>meta</filename> or
+ <filename>scripts</filename> directories should be sent
+ to this mailing list.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>BitBake:</emphasis>
+ For changes to BitBake (i.e. anything under the
+ <filename>bitbake</filename> directory), send your patch
+ to the
+ <ulink url='http://lists.openembedded.org/mailman/listinfo/bitbake-devel'>bitbake-devel</ulink>
+ mailing list.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>"meta-*" trees:</emphasis>
+ These trees contain Metadata.
+ Use the
+ <ulink url='https://lists.yoctoproject.org/listinfo/poky'>poky</ulink>
+ mailing list.
+ </para></listitem>
+ </itemizedlist>
+ </para>
- <para>
- Specific to OpenEmbedded-Core, two commonly used testing trees
- exist:
- <itemizedlist>
- <listitem><para>
- <emphasis>"ross/mut" branch:</emphasis>
- The "mut" (master-under-test) tree
- exists in the <filename>poky-contrib</filename> repository
- in the
- <ulink url='&YOCTO_GIT_URL;'>Yocto Project source repositories</ulink>.
- </para></listitem>
- <listitem><para>
- <emphasis>"master-next" branch:</emphasis>
- This branch is part of the main
- "poky" repository in the Yocto Project source repositories.
- </para></listitem>
- </itemizedlist>
- Maintainers use these branches to test submissions prior to merging
- patches.
- Thus, you can get an idea of the status of a patch based on
- whether the patch has been merged into one of these branches.
- </para>
+ <para>
+ For changes to other layers hosted in the Yocto Project source
+ repositories (i.e. <filename>yoctoproject.org</filename>), tools,
+ and the Yocto Project documentation, use the
+ <ulink url='https://lists.yoctoproject.org/listinfo/yocto'>Yocto Project</ulink>
+ general mailing list.
+ <note>
+ Sometimes a layer's documentation specifies to use a
+ particular mailing list.
+ If so, use that list.
+ </note>
+ For additional recipes that do not fit into the core Metadata, you
+ should determine which layer the recipe should go into and submit
+ the change in the manner recommended by the documentation (e.g.
+ the <filename>README</filename> file) supplied with the layer.
+ If in doubt, please ask on the Yocto general mailing list or on
+ the openembedded-devel mailing list.
+ </para>
- <para>
- This system is imperfect and patches can sometimes get lost in the
+ <para>
+ You can also push a change upstream and request a maintainer to
+ pull the change into the component's upstream repository.
+ You do this by pushing to a contribution repository that is upstream.
+ See the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#workflows'>Workflows</ulink>"
+ section in the Yocto Project Reference Manual for additional
+ concepts on working in the Yocto Project development environment.
+ </para>
+
+ <para>
+ Two commonly used testing repositories exist for
+ OpenEmbedded-Core:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>"ross/mut" branch:</emphasis>
+ The "mut" (master-under-test) tree
+ exists in the <filename>poky-contrib</filename> repository
+ in the
+ <ulink url='&YOCTO_GIT_URL;'>Yocto Project source repositories</ulink>.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>"master-next" branch:</emphasis>
+ This branch is part of the main
+ "poky" repository in the Yocto Project source repositories.
+ </para></listitem>
+ </itemizedlist>
+ Maintainers use these branches to test submissions prior to merging
+ patches.
+ Thus, you can get an idea of the status of a patch based on
+ whether the patch has been merged into one of these branches.
+ <note>
+ This system is imperfect and changes can sometimes get lost in the
flow.
- Asking about the status of a patch is reasonable if the patch
- has been idle for a while with no feedback.
+ Asking about the status of a patch or change is reasonable if the
+ change has been idle for a while with no feedback.
The Yocto Project does have plans to use
<ulink url='https://en.wikipedia.org/wiki/Patchwork_(software)'>Patchwork</ulink>
to track the status of patches and also to automatically preview
patches.
- </para>
+ </note>
+ </para>
+
+ <para>
+ The following sections provide procedures for submitting a change.
+ </para>
+
+ <section id='pushing-a-change-upstream'>
+ <title>Using Scripts to Push a Change Upstream and Request a Pull</title>
<para>
- The following sections provide general instructions for both
- pushing changes upstream and for submitting changes as patches.
- </para>
- </section>
-
- <section id='submit-change-submissions-to-poky'>
- <title>Submissions to Poky</title>
-
- <para>
- The "poky" repository, which is the Yocto Project's reference build
- environment, is a hybrid repository that contains several
- individual pieces (e.g. BitBake, OpenEmbedded-Core, meta-yocto,
- documentation, and so forth) built using the combo-layer tool.
- The upstream location used for submitting changes varies by
- component:
- <itemizedlist>
- <listitem><para>
- <emphasis>Core Metadata:</emphasis>
- Send your patch to the
- <ulink url='http://lists.openembedded.org/mailman/listinfo/openembedded-core'>openembedded-core</ulink>
- mailing list. For example, a change to anything under
- the <filename>meta</filename> or
- <filename>scripts</filename> directories should be sent
- to this mailing list.
- </para></listitem>
- <listitem><para>
- <emphasis>BitBake:</emphasis>
- For changes to BitBake (i.e. anything under the
- <filename>bitbake</filename> directory), send your patch
- to the
- <ulink url='http://lists.openembedded.org/mailman/listinfo/bitbake-devel'>bitbake-devel</ulink>
- mailing list.
- </para></listitem>
- <listitem><para>
- <emphasis>"meta-yocto-bsp" and "meta-poky" trees:</emphasis>
- These trees are
- part of the "meta-yocto" repository in the Yocto Project
- source repositories.
- Use the
- <ulink url='https://lists.yoctoproject.org/listinfo/poky'>poky</ulink>
- mailing list.
- </para></listitem>
- </itemizedlist>
- </para>
- </section>
-
- <section id='submit-change-submissions-to-other-layers'>
- <title>Submissions to Other Layers</title>
-
- <para>
- For changes to other layers hosted in the Yocto Project source
- repositories (i.e. <filename>yoctoproject.org</filename>), tools,
- and the Yocto Project documentation, use the
- <ulink url='https://lists.yoctoproject.org/listinfo/yocto'>Yocto Project</ulink>
- general mailing list.
+ Follow this procedure to push a change to an upstream "contrib"
+ Git repository:
<note>
- Sometimes a layer's documentation specifies to use a
- particular mailing list.
- If so, use that list.
+ You can find general Git information on how to push a change
+ upstream in the
+ <ulink url='http://git-scm.com/book/en/v2/Distributed-Git-Distributed-Workflows'>Git Community Book</ulink>.
</note>
- For additional recipes that do not fit into the core Metadata, you
- should determine which layer the recipe should go into and submit
- the change in the manner recommended by the documentation (e.g.
- the <filename>README</filename> file) supplied with the layer.
- If in doubt, please ask on the Yocto general mailing list or on
- the openembedded-devel mailing list.
- </para>
- </section>
-
- <section id='submit-change-patch-submission-details'>
- <title>Patch Submission Details</title>
-
- <para>
- When submitting any change, you can check who you should be
- notifying.
- Use either of these methods to find out:
- <itemizedlist>
+ <orderedlist>
<listitem><para>
- <emphasis>Maintenance File:</emphasis>
- Examine the <filename>maintainers.inc</filename> file, which is
- located in the
- <link linkend='source-directory'>Source Directory</link>
- at <filename>meta-poky/conf/distro/include</filename>, to
- see who is responsible for code.
+ <emphasis>Make Your Changes Locally:</emphasis>
+ Make your changes in your local Git repository.
+ You should make small, controlled, isolated changes.
+ Keeping changes small and isolated aids review,
+ makes merging/rebasing easier and keeps the change
+ history clean should anyone need to refer to it in
+ future.
</para></listitem>
<listitem><para>
- <emphasis>Search by File:</emphasis>
- Using <link linkend='git'>Git</link>, you can enter the
- following command to bring up a short list of all commits
- against a specific file:
- <literallayout class='monospaced'>
- git shortlog -- <replaceable>filename</replaceable>
- </literallayout>
- Just provide the name of the file for which you are interested.
- The information returned is not ordered by history but does
- include a list of all committers grouped by name.
- From the list, you can see who is responsible for the bulk of
- the changes against the file.
+ <emphasis>Stage Your Changes:</emphasis>
+ Stage your changes by using the <filename>git add</filename>
+ command on each file you changed.
</para></listitem>
- </itemizedlist>
- </para>
-
- <para>
- For a list of the Yocto Project and related mailing lists, see the
- "<ulink url='&YOCTO_DOCS_REF_URL;#resources-mailinglist'>Mailing lists</ulink>"
- section in the Yocto Project Reference Manual.
- </para>
-
- <para>
- When you send a patch, be sure to include a "Signed-off-by:"
- line in the same style as required by the Linux kernel.
- Adding this line signifies that you, the submitter, have agreed
- to the Developer's Certificate of Origin 1.1 as follows:
- <literallayout class='monospaced'>
+ <listitem><para id='making-sure-you-have-correct-commit-information'>
+ <emphasis>Commit Your Changes:</emphasis>
+ Commit the change by using the
+ <filename>git commit</filename> command.
+ Make sure your commit information follows standards by
+ following these accepted conventions:
+ <itemizedlist>
+ <listitem><para>
+ Be sure to include a "Signed-off-by:" line in the
+ same style as required by the Linux kernel.
+ Adding this line signifies that you, the submitter,
+ have agreed to the Developer's Certificate of
+ Origin 1.1 as follows:
+ <literallayout class='monospaced'>
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
@@ -1595,121 +655,183 @@
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
- </literallayout>
- </para>
-
- <para>
- In a collaborative environment, it is necessary to have some sort
- of standard or method through which you submit changes.
- Otherwise, things could get quite chaotic.
- One general practice to follow is to make small, controlled changes.
- Keeping changes small and isolated aids review, makes
- merging/rebasing easier and keeps the change history clean should
- anyone need to refer to it in future.
- </para>
-
- <para>
- When you make a commit, you must follow certain standards
- established by the OpenEmbedded and Yocto Project development teams.
- For each commit, you must provide a single-line summary of the
- change and you should almost always provide a more detailed
- description of what you did (i.e. the body of the commit message).
- The only exceptions for not providing a detailed description would
- be if your change is a simple, self-explanatory change that needs
- no further description beyond the summary.
- Here are the guidelines for composing a commit message:
- <itemizedlist>
- <listitem><para>
- Provide a single-line, short summary of the change.
- This summary is typically viewable in the "shortlist" of
- changes.
- Thus, providing something short and descriptive that
- gives the reader a summary of the change is useful when
- viewing a list of many commits.
- You should prefix this short description with the recipe
- name (if changing a recipe), or else with the short form
- path to the file being changed.
- </para></listitem>
- <listitem><para>
- For the body of the commit message, provide detailed
- information that describes what you changed, why you made
- the change, and the approach you used.
- It might also be helpful if you mention how you tested
- the change.
- Provide as much detail as you can in the body of the
- commit message.
- </para></listitem>
- <listitem><para>
- If the change addresses a specific bug or issue that is
- associated with a bug-tracking ID, include a reference
- to that ID in your detailed description.
- For example, the Yocto Project uses a specific convention
- for bug references - any commit that addresses a specific
- bug should use the following form for the detailed
- description.
- Be sure to use the actual bug-tracking ID from
- Bugzilla for
- <replaceable>bug-id</replaceable>:
- <literallayout class='monospaced'>
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ Provide a single-line summary of the change.
+ and,
+ if more explanation is needed, provide more
+ detail in the body of the commit.
+ This summary is typically viewable in the
+ "shortlist" of changes.
+ Thus, providing something short and descriptive
+ that gives the reader a summary of the change is
+ useful when viewing a list of many commits.
+ You should prefix this short description with the
+ recipe name (if changing a recipe), or else with
+ the short form path to the file being changed.
+ </para></listitem>
+ <listitem><para>
+ For the body of the commit message, provide
+ detailed information that describes what you
+ changed, why you made the change, and the approach
+ you used.
+ It might also be helpful if you mention how you
+ tested the change.
+ Provide as much detail as you can in the body of
+ the commit message.
+ <note>
+ You do not need to provide a more detailed
+ explanation of a change if the change is
+ minor to the point of the single line
+ summary providing all the information.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ If the change addresses a specific bug or issue
+ that is associated with a bug-tracking ID,
+ include a reference to that ID in your detailed
+ description.
+ For example, the Yocto Project uses a specific
+ convention for bug references - any commit that
+ addresses a specific bug should use the following
+ form for the detailed description.
+ Be sure to use the actual bug-tracking ID from
+ Bugzilla for
+ <replaceable>bug-id</replaceable>:
+ <literallayout class='monospaced'>
Fixes [YOCTO #<replaceable>bug-id</replaceable>]
<replaceable>detailed description of change</replaceable>
+ </literallayout>
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Push Your Commits to a "Contrib" Upstream:</emphasis>
+ If you have arranged for permissions to push to an
+ upstream contrib repository, push the change to that
+ repository:
+ <literallayout class='monospaced'>
+ $ git push <replaceable>upstream_remote_repo</replaceable> <replaceable>local_branch_name</replaceable>
+ </literallayout>
+ For example, suppose you have permissions to push into the
+ upstream <filename>meta-intel-contrib</filename>
+ repository and you are working in a local branch named
+ <replaceable>your_name</replaceable><filename>/README</filename>.
+ The following command pushes your local commits to the
+ <filename>meta-intel-contrib</filename> upstream
+ repository and puts the commit in a branch named
+ <replaceable>your_name</replaceable><filename>/README</filename>:
+ <literallayout class='monospaced'>
+ $ git push meta-intel-contrib <replaceable>your_name</replaceable>/README
</literallayout>
</para></listitem>
- </itemizedlist>
- </para>
+ <listitem><para id='push-determine-who-to-notify'>
+ <emphasis>Determine Who to Notify:</emphasis>
+ Determine the maintainer or the mailing list
+ that you need to notify for the change.</para>
- <para>
- You can find more guidance on creating well-formed commit messages
- at this OpenEmbedded wiki page:
- <ulink url='&OE_HOME_URL;/wiki/Commit_Patch_Message_Guidelines'></ulink>.
- </para>
- </section>
-
- <section id='pushing-a-change-upstream'>
- <title>Using Scripts to Push a Change Upstream and Request a Pull</title>
-
- <para>
- The basic flow for pushing a change to an upstream "contrib" Git repository is as follows:
- <itemizedlist>
- <listitem><para>Make your changes in your local Git repository.</para></listitem>
- <listitem><para>Stage your changes by using the <filename>git add</filename>
- command on each file you changed.</para></listitem>
- <listitem><para>
- Commit the change by using the
- <filename>git commit</filename> command.
- Be sure to provide a commit message that follows the
- project’s commit message standards as described earlier.
+ <para>Before submitting any change, you need to be sure
+ who the maintainer is or what mailing list that you need
+ to notify.
+ Use either these methods to find out:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Maintenance File:</emphasis>
+ Examine the <filename>maintainers.inc</filename>
+ file, which is located in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
+ at
+ <filename>meta/conf/distro/include</filename>,
+ to see who is responsible for code.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Search by File:</emphasis>
+ Using <ulink url='&YOCTO_DOCS_REF_URL;#git'>Git</ulink>,
+ you can enter the following command to bring up a
+ short list of all commits against a specific file:
+ <literallayout class='monospaced'>
+ git shortlog -- <replaceable>filename</replaceable>
+ </literallayout>
+ Just provide the name of the file for which you
+ are interested.
+ The information returned is not ordered by history
+ but does include a list of everyone who has
+ committed grouped by name.
+ From the list, you can see who is responsible for
+ the bulk of the changes against the file.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Examine the List of Mailing Lists:</emphasis>
+ For a list of the Yocto Project and related mailing
+ lists, see the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#resources-mailinglist'>Mailing lists</ulink>"
+ section in the Yocto Project Reference Manual.
+ </para></listitem>
+ </itemizedlist>
</para></listitem>
<listitem><para>
- Push the change to the upstream "contrib" repository by
- using the <filename>git push</filename> command.
- </para></listitem>
- <listitem><para>Notify the maintainer that you have pushed a change by making a pull
- request.
- The Yocto Project provides two scripts that conveniently let you generate and send
- pull requests to the Yocto Project.
- These scripts are <filename>create-pull-request</filename> and
- <filename>send-pull-request</filename>.
- You can find these scripts in the <filename>scripts</filename> directory
- within the <link linkend='source-directory'>Source Directory</link>.</para>
- <para>Using these scripts correctly formats the requests without introducing any
- whitespace or HTML formatting.
- The maintainer that receives your patches needs to be able to save and apply them
- directly from your emails.
- Using these scripts is the preferred method for sending patches.</para>
- <para>For help on using these scripts, simply provide the
- <filename>-h</filename> argument as follows:
+ <emphasis>Make a Pull Request:</emphasis>
+ Notify the maintainer or the mailing list that you have
+ pushed a change by making a pull request.</para>
+
+ <para>The Yocto Project provides two scripts that
+ conveniently let you generate and send pull requests to the
+ Yocto Project.
+ These scripts are <filename>create-pull-request</filename>
+ and <filename>send-pull-request</filename>.
+ You can find these scripts in the
+ <filename>scripts</filename> directory within the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
+ (e.g. <filename>~/poky/scripts</filename>).
+ </para>
+
+ <para>Using these scripts correctly formats the requests
+ without introducing any whitespace or HTML formatting.
+ The maintainer that receives your patches either directly
+ or through the mailing list needs to be able to save and
+ apply them directly from your emails.
+ Using these scripts is the preferred method for sending
+ patches.</para>
+
+ <para>First, create the pull request.
+ For example, the following command runs the script,
+ specifies the upstream repository in the contrib directory
+ into which you pushed the change, and provides a subject
+ line in the created patch files:
<literallayout class='monospaced'>
+ $ ~/poky/scripts/create-pull-request -u meta-intel-contrib -s "Updated Manual Section Reference in README"
+ </literallayout>
+ Running this script forms
+ <filename>*.patch</filename> files in a folder named
+ <filename>pull-</filename><replaceable>PID</replaceable>
+ in the current directory.
+ One of the patch files is a cover letter.</para>
+
+ <para>Before running the
+ <filename>send-pull-request</filename> script, you must
+ edit the cover letter patch to insert information about
+ your change.
+ After editing the cover letter, send the pull request.
+ For example, the following command runs the script and
+ specifies the patch directory and email address.
+ In this example, the email address is a mailing list:
+ <literallayout class='monospaced'>
+ $ ~/poky/scripts/send-pull-request -p ~/meta-intel/pull-10565 -t meta-intel@yoctoproject.org
+ </literallayout>
+ You need to follow the prompts as the script is
+ interactive.
+ <note>
+ For help on using these scripts, simply provide the
+ <filename>-h</filename> argument as follows:
+ <literallayout class='monospaced'>
$ poky/scripts/create-pull-request -h
$ poky/scripts/send-pull-request -h
- </literallayout></para></listitem>
- </itemizedlist>
- </para>
-
- <para>
- You can find general Git information on how to push a change upstream in the
- <ulink url='http://git-scm.com/book/en/v2/Distributed-Git-Distributed-Workflows'>Git Community Book</ulink>.
+ </literallayout>
+ </note>
+ </para></listitem>
+ </orderedlist>
</para>
</section>
@@ -1717,43 +839,67 @@
<title>Using Email to Submit a Patch</title>
<para>
- You can submit patches without using the <filename>create-pull-request</filename> and
- <filename>send-pull-request</filename> scripts described in the previous section.
+ You can submit patches without using the
+ <filename>create-pull-request</filename> and
+ <filename>send-pull-request</filename> scripts described in the
+ previous section.
However, keep in mind, the preferred method is to use the scripts.
</para>
<para>
- Depending on the components changed, you need to submit the email to a specific
- mailing list.
- For some guidance on which mailing list to use, see the list in the
- "<link linkend='how-to-submit-a-change'>How to Submit a Change</link>"
- section.
- For a description of the available mailing lists, see the
+ Depending on the components changed, you need to submit the email
+ to a specific mailing list.
+ For some guidance on which mailing list to use, see the
+ <link linkend='figuring-out-the-mailing-list-to-use'>beginning</link>
+ of this section.
+ For a description of all the available mailing lists, see the
"<ulink url='&YOCTO_DOCS_REF_URL;#resources-mailinglist'>Mailing Lists</ulink>"
section in the Yocto Project Reference Manual.
</para>
<para>
- Here is the general procedure on how to submit a patch through email without using the
- scripts:
- <itemizedlist>
- <listitem><para>Make your changes in your local Git repository.</para></listitem>
- <listitem><para>Stage your changes by using the <filename>git add</filename>
- command on each file you changed.</para></listitem>
- <listitem><para>Commit the change by using the
+ Here is the general procedure on how to submit a patch through
+ email without using the scripts:
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Make Your Changes Locally:</emphasis>
+ Make your changes in your local Git repository.
+ You should make small, controlled, isolated changes.
+ Keeping changes small and isolated aids review,
+ makes merging/rebasing easier and keeps the change
+ history clean should anyone need to refer to it in
+ future.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Stage Your Changes:</emphasis>
+ Stage your changes by using the <filename>git add</filename>
+ command on each file you changed.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Commit Your Changes:</emphasis>
+ Commit the change by using the
<filename>git commit --signoff</filename> command.
- Using the <filename>--signoff</filename> option identifies you as the person
- making the change and also satisfies the Developer's Certificate of
- Origin (DCO) shown earlier.</para>
- <para>When you form a commit, you must follow certain standards established by the
- Yocto Project development team.
- See the earlier section
- "<link linkend='how-to-submit-a-change'>How to Submit a Change</link>"
- for Yocto Project commit message standards.</para></listitem>
- <listitem><para>Format the commit into an email message.
- To format commits, use the <filename>git format-patch</filename> command.
- When you provide the command, you must include a revision list or a number of patches
- as part of the command.
+ Using the <filename>--signoff</filename> option identifies
+ you as the person making the change and also satisfies
+ the Developer's Certificate of Origin (DCO) shown earlier.
+ </para>
+
+ <para>When you form a commit, you must follow certain
+ standards established by the Yocto Project development
+ team.
+ See
+ <link linkend='making-sure-you-have-correct-commit-information'>Step 3</link>
+ in the previous section for information on how to
+ provide commit information that meets Yocto Project
+ commit message standards.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Format the Commit:</emphasis>
+ Format the commit into an email message.
+ To format commits, use the
+ <filename>git format-patch</filename> command.
+ When you provide the command, you must include a revision
+ list or a number of patches as part of the command.
For example, either of these two commands takes your most
recent single commit and formats it as an email message in
the current directory:
@@ -1764,50 +910,76 @@
<literallayout class='monospaced'>
$ git format-patch HEAD~
</literallayout></para>
- <para>After the command is run, the current directory contains a
- numbered <filename>.patch</filename> file for the commit.</para>
- <para>If you provide several commits as part of the command,
- the <filename>git format-patch</filename> command produces a
- series of numbered files in the current directory – one for each commit.
+
+ <para>After the command is run, the current directory
+ contains a numbered <filename>.patch</filename> file for
+ the commit.</para>
+
+ <para>If you provide several commits as part of the
+ command, the <filename>git format-patch</filename> command
+ produces a series of numbered files in the current
+ directory – one for each commit.
If you have more than one patch, you should also use the
- <filename>--cover</filename> option with the command, which generates a
- cover letter as the first "patch" in the series.
- You can then edit the cover letter to provide a description for
- the series of patches.
- For information on the <filename>git format-patch</filename> command,
- see <filename>GIT_FORMAT_PATCH(1)</filename> displayed using the
- <filename>man git-format-patch</filename> command.</para>
- <note>If you are or will be a frequent contributor to the Yocto Project
- or to OpenEmbedded, you might consider requesting a contrib area and the
- necessary associated rights.</note></listitem>
- <listitem><para>Import the files into your mail client by using the
+ <filename>--cover</filename> option with the command,
+ which generates a cover letter as the first "patch" in
+ the series.
+ You can then edit the cover letter to provide a
+ description for the series of patches.
+ For information on the
+ <filename>git format-patch</filename> command,
+ see <filename>GIT_FORMAT_PATCH(1)</filename> displayed
+ using the <filename>man git-format-patch</filename>
+ command.
+ <note>
+ If you are or will be a frequent contributor to the
+ Yocto Project or to OpenEmbedded, you might consider
+ requesting a contrib area and the necessary associated
+ rights.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Import the Files Into Your Mail Client:</emphasis>
+ Import the files into your mail client by using the
<filename>git send-email</filename> command.
- <note>In order to use <filename>git send-email</filename>, you must have the
- the proper Git packages installed.
- For Ubuntu, Debian, and Fedora the package is <filename>git-email</filename>.</note></para>
- <para>The <filename>git send-email</filename> command sends email by using a local
- or remote Mail Transport Agent (MTA) such as
- <filename>msmtp</filename>, <filename>sendmail</filename>, or through a direct
- <filename>smtp</filename> configuration in your Git <filename>config</filename>
- file.
- If you are submitting patches through email only, it is very important
- that you submit them without any whitespace or HTML formatting that
- either you or your mailer introduces.
- The maintainer that receives your patches needs to be able to save and
- apply them directly from your emails.
- A good way to verify that what you are sending will be applicable by the
- maintainer is to do a dry run and send them to yourself and then
- save and apply them as the maintainer would.</para>
- <para>The <filename>git send-email</filename> command is the preferred method
- for sending your patches since there is no risk of compromising whitespace
- in the body of the message, which can occur when you use your own mail client.
+ <note>
+ In order to use <filename>git send-email</filename>,
+ you must have the proper Git packages installed on
+ your host.
+ For Ubuntu, Debian, and Fedora the package is
+ <filename>git-email</filename>.
+ </note></para>
+
+ <para>The <filename>git send-email</filename> command
+ sends email by using a local or remote Mail Transport Agent
+ (MTA) such as <filename>msmtp</filename>,
+ <filename>sendmail</filename>, or through a direct
+ <filename>smtp</filename> configuration in your Git
+ <filename>~/.gitconfig</filename> file.
+ If you are submitting patches through email only, it is
+ very important that you submit them without any whitespace
+ or HTML formatting that either you or your mailer
+ introduces.
+ The maintainer that receives your patches needs to be able
+ to save and apply them directly from your emails.
+ A good way to verify that what you are sending will be
+ applicable by the maintainer is to do a dry run and send
+ them to yourself and then save and apply them as the
+ maintainer would.</para>
+
+ <para>The <filename>git send-email</filename> command is
+ the preferred method for sending your patches using
+ email since there is no risk of compromising whitespace
+ in the body of the message, which can occur when you use
+ your own mail client.
The command also has several options that let you
- specify recipients and perform further editing of the email message.
- For information on how to use the <filename>git send-email</filename> command,
+ specify recipients and perform further editing of the
+ email message.
+ For information on how to use the
+ <filename>git send-email</filename> command,
see <filename>GIT-SEND-EMAIL(1)</filename> displayed using
the <filename>man git-send-email</filename> command.
</para></listitem>
- </itemizedlist>
+ </orderedlist>
</para>
</section>
</section>
diff --git a/import-layers/yocto-poky/documentation/dev-manual/dev-manual-qemu.xml b/import-layers/yocto-poky/documentation/dev-manual/dev-manual-qemu.xml
index 41c1829..85e7315 100644
--- a/import-layers/yocto-poky/documentation/dev-manual/dev-manual-qemu.xml
+++ b/import-layers/yocto-poky/documentation/dev-manual/dev-manual-qemu.xml
@@ -6,427 +6,303 @@
<title>Using the Quick EMUlator (QEMU)</title>
-<para>
- Quick EMUlator (QEMU) is an Open Source project the Yocto Project uses
- as part of its development "tool set".
- As such, the information in this chapter is limited to the
- Yocto Project integration of QEMU and not QEMU in general.
- For official information and documentation on QEMU, see the
- following references:
- <itemizedlist>
- <listitem><para><emphasis><ulink url='http://wiki.qemu.org/Main_Page'>QEMU Website</ulink>:</emphasis>
- The official website for the QEMU Open Source project.
- </para></listitem>
- <listitem><para><emphasis><ulink url='http://wiki.qemu.org/Manual'>Documentation</ulink>:</emphasis>
- The QEMU user manual.
- </para></listitem>
- </itemizedlist>
-</para>
-
-<para>
- This chapter provides an overview of the Yocto Project's integration of
- QEMU, a description of how you use QEMU and its various options, running
- under a Network File System (NFS) server, and a few tips and tricks you
- might find helpful when using QEMU.
-</para>
-
-<section id='qemu-overview'>
- <title>Overview</title>
-
<para>
- Within the context of the Yocto Project, QEMU is an
- emulator and virtualization machine that allows you to run a complete
- image you have built using the Yocto Project as just another task
- on your build system.
- QEMU is useful for running and testing images and applications on
- supported Yocto Project architectures without having actual hardware.
- Among other things, the Yocto Project uses QEMU to run automated
- Quality Assurance (QA) tests on final images shipped with each
- release.
+ This chapter provides procedures that show you how to use the
+ Quick EMUlator (QEMU), which is an Open Source project the Yocto
+ Project uses as part of its development "tool set".
+ For reference information on the Yocto Project implementation of QEMU,
+ see the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#ref-quick-emulator-qemu'>Quick EMUlator (QEMU)</ulink>"
+ section in the Yocto Project Reference Manual.
</para>
- <para>
- QEMU is made available with the Yocto Project a number of ways.
- One method is to install a Software Development Kit (SDK).
- For more information on how to make sure you have
- QEMU available, see the
- <ulink url='&YOCTO_DOCS_SDK_URL;#sdk-intro'>Yocto Project Software Development Kit (SDK) Developer's Guide</ulink>.
- </para>
-</section>
-
-<section id='qemu-running-qemu'>
- <title>Running QEMU</title>
-
- <para>
- Running QEMU involves having your build environment set up, having the
- right artifacts available, and understanding how to use the many
- options that are available to you when you start QEMU using the
- <filename>runqemu</filename> command.
- </para>
-
- <section id='qemu-setting-up-the-environment'>
- <title>Setting Up the Environment</title>
+ <section id='qemu-running-qemu'>
+ <title>Running QEMU</title>
<para>
- You run QEMU in the same environment from which you run BitBake.
- This means you need to source a build environment script (i.e.
- <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>
- or
- <ulink url='&YOCTO_DOCS_REF_URL;#structure-memres-core-script'><filename>oe-init-build-env-memres</filename></ulink>).
- </para>
- </section>
+ To use QEMU, you need to have QEMU installed and initialized as
+ well as have the proper artifacts (i.e. image files and root
+ filesystems) available.
+ Follow these general steps to run QEMU:
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Install QEMU:</emphasis>
+ See
+ "<ulink url='&YOCTO_DOCS_SDK_URL;#the-qemu-emulator'>The QEMU Emulator</ulink>"
+ section in the Yocto Project Application Development and
+ the Extensible Software Development Kit (eSDK) manual
+ for information on how to install QEMU.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Setting Up the Environment:</emphasis>
+ How you set up the QEMU environment depends on how you
+ installed QEMU:
+ <itemizedlist>
+ <listitem><para>
+ If you cloned the <filename>poky</filename>
+ repository or you downloaded and unpacked a
+ Yocto Project release tarball, you can source
+ the build environment script (i.e.
+ <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>):
+ <literallayout class='monospaced'>
+ $ cd ~/poky
+ $ source oe-init-build-env
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ If you installed a cross-toolchain, you can
+ run the script that initializes the toolchain.
+ For example, the following commands run the
+ initialization script from the default
+ <filename>poky_sdk</filename> directory:
+ <literallayout class='monospaced'>
+ . ~/poky_sdk/environment-setup-core2-64-poky-linux
+ </literallayout>
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Ensure the Artifacts are in Place:</emphasis>
+ You need to be sure you have a pre-built kernel that
+ will boot in QEMU.
+ You also need the target root filesystem for your target
+ machine’s architecture:
+ <itemizedlist>
+ <listitem><para>
+ If you have previously built an image for QEMU
+ (e.g. <filename>qemux86</filename>,
+ <filename>qemuarm</filename>, and so forth),
+ then the artifacts are in place in your
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>.
+ </para></listitem>
+ <listitem><para>
+ If you have not built an image, you can go to the
+ <ulink url='&YOCTO_MACHINES_DL_URL;'>machines/qemu</ulink>
+ area and download a pre-built image that matches
+ your architecture and can be run on QEMU.
+ </para></listitem>
+ </itemizedlist></para>
- <section id='qemu-using-the-runqemu-command'>
- <title>Using the <filename>runqemu</filename> Command</title>
-
- <para>
- The basic <filename>runqemu</filename> command syntax is as
- follows:
- <literallayout class='monospaced'>
+ <para>See the
+ "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-extracting-the-root-filesystem'>Extracting the Root Filesystem</ulink>"
+ section in the Yocto Project Application Development and
+ the Extensible Software Development Kit (eSDK) manual
+ for information on how to extract a root filesystem.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Run QEMU:</emphasis>
+ The basic <filename>runqemu</filename> command syntax is as
+ follows:
+ <literallayout class='monospaced'>
$ runqemu [<replaceable>option</replaceable> ] [...]
- </literallayout>
- Based on what you provide on the command line,
- <filename>runqemu</filename> does a good job of figuring out what
- you are trying to do.
- For example, by default, QEMU looks for the most recently built
- image according to the timestamp when it needs to look for an
- image.
- Minimally, through the use of options, you must provide either
- a machine name, a virtual machine image
- (<filename>*.vmdk</filename>), or a kernel image
- (<filename>*.bin</filename>).
- </para>
+ </literallayout>
+ Based on what you provide on the command line,
+ <filename>runqemu</filename> does a good job of figuring
+ out what you are trying to do.
+ For example, by default, QEMU looks for the most recently
+ built image according to the timestamp when it needs to
+ look for an image.
+ Minimally, through the use of options, you must provide
+ either a machine name, a virtual machine image
+ (<filename>*wic.vmdk</filename>), or a kernel image
+ (<filename>*.bin</filename>).</para>
- <para>
- Following is a description of <filename>runqemu</filename>
- options you can provide on the command line:
- <note><title>Tip</title>
- If you do provide some "illegal" option combination or perhaps
- you do not provide enough in the way of options,
- <filename>runqemu</filename> provides appropriate error
- messaging to help you correct the problem.
- </note>
- <itemizedlist>
- <listitem><para><replaceable>QEMUARCH</replaceable>:
- The QEMU machine architecture, which must be "qemux86",
- "qemux86_64", "qemuarm", "qemumips", "qemumipsel",
- “qemumips64", "qemush4", "qemuppc", "qemumicroblaze",
- or "qemuzynq".
- </para></listitem>
- <listitem><para><filename><replaceable>VM</replaceable></filename>:
- The virtual machine image, which must be a
- <filename>.vmdk</filename> file.
- Use this option when you want to boot a
- <filename>.vmdk</filename> image.
- The image filename you provide must contain one of the
- following strings: "qemux86-64", "qemux86", "qemuarm",
- "qemumips64", "qemumips", "qemuppc", or "qemush4".
- </para></listitem>
- <listitem><para><replaceable>ROOTFS</replaceable>:
- A root filesystem that has one of the following
- filetype extensions: "ext2", "ext3", "ext4", "jffs2",
- "nfs", or "btrfs".
- If the filename you provide for this option uses “nfs”, it
- must provide an explicit root filesystem path.
- </para></listitem>
- <listitem><para><replaceable>KERNEL</replaceable>:
- A kernel image, which is a <filename>.bin</filename> file.
- When you provide a <filename>.bin</filename> file,
- <filename>runqemu</filename> detects it and assumes the
- file is a kernel image.
- </para></listitem>
- <listitem><para><replaceable>MACHINE</replaceable>:
- The architecture of the QEMU machine, which must be one
- of the following: "qemux86",
- "qemux86-64", "qemuarm", "qemumips", "qemumipsel",
- “qemumips64", "qemush4", "qemuppc", "qemumicroblaze",
- or "qemuzynq".
- The <replaceable>MACHINE</replaceable> and
- <replaceable>QEMUARCH</replaceable> options are basically
- identical.
- If you do not provide a <replaceable>MACHINE</replaceable>
- option, <filename>runqemu</filename> tries to determine
- it based on other options.
- </para></listitem>
- <listitem><para><filename>ramfs</filename>:
- Indicates you are booting an initial RAM disk (initramfs)
- image, which means the <filename>FSTYPE</filename> is
- <filename>cpio.gz</filename>.
- </para></listitem>
- <listitem><para><filename>iso</filename>:
- Indicates you are booting an ISO image, which means the
- <filename>FSTYPE</filename> is
- <filename>.iso</filename>.
- </para></listitem>
- <listitem><para><filename>nographic</filename>:
- Disables the video console, which sets the console to
- "ttys0".
- </para></listitem>
- <listitem><para><filename>serial</filename>:
- Enables a serial console on
- <filename>/dev/ttyS0</filename>.
- </para></listitem>
- <listitem><para><filename>biosdir</filename>:
- Establishes a custom directory for BIOS, VGA BIOS and
- keymaps.
- </para></listitem>
- <listitem><para><filename>biosfilename</filename>:
- Establishes a custom BIOS name.
- </para></listitem>
- <listitem><para><filename>qemuparams=\"<replaceable>xyz</replaceable>\"</filename>:
- Specifies custom QEMU parameters.
- Use this option to pass options other than the simple
- "kvm" and "serial" options.
- </para></listitem>
- <listitem><para><filename>bootparams=\"<replaceable>xyz</replaceable>\"</filename>:
- Specifies custom boot parameters for the kernel.
- </para></listitem>
- <listitem><para><filename>audio</filename>:
- Enables audio in QEMU.
- The <replaceable>MACHINE</replaceable> option must be
- either "qemux86" or "qemux86-64" in order for audio to be
- enabled.
- Additionally, the <filename>snd_intel8x0</filename>
- or <filename>snd_ens1370</filename> driver must be
- installed in linux guest.
- </para></listitem>
- <listitem><para><filename>slirp</filename>:
- Enables "slirp" networking, which is a different way
- of networking that does not need root access
- but also is not as easy to use or comprehensive
- as the default.
- </para></listitem>
- <listitem><para id='kvm-cond'><filename>kvm</filename>:
- Enables KVM when running "qemux86" or "qemux86-64"
- QEMU architectures.
- For KVM to work, all the following conditions must be met:
+ <para>Here are some additional examples to help illustrate
+ further QEMU:
<itemizedlist>
<listitem><para>
- Your <replaceable>MACHINE</replaceable> must be either
-qemux86" or "qemux86-64".
+ This example starts QEMU with
+ <replaceable>MACHINE</replaceable> set to "qemux86".
+ Assuming a standard
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>,
+ <filename>runqemu</filename> automatically finds the
+ <filename>bzImage-qemux86.bin</filename> image file and
+ the
+ <filename>core-image-minimal-qemux86-20140707074611.rootfs.ext3</filename>
+ (assuming the current build created a
+ <filename>core-image-minimal</filename> image).
+ <note>
+ When more than one image with the same name exists, QEMU finds
+ and uses the most recently built image according to the
+ timestamp.
+ </note>
+ <literallayout class='monospaced'>
+ $ runqemu qemux86
+ </literallayout>
</para></listitem>
<listitem><para>
- Your build host has to have the KVM modules
- installed, which are
- <filename>/dev/kvm</filename>.
- </para></listitem>
- <listitem><para>
- The build host <filename>/dev/kvm</filename>
- directory has to be both writable and readable.
- </para></listitem>
- </itemizedlist>
- </para></listitem>
- <listitem><para><filename>kvm-vhost</filename>:
- Enables KVM with VHOST support when running "qemux86" or "qemux86-64"
- QEMU architectures.
- For KVM with VHOST to work, the following conditions must
- be met:
- <itemizedlist>
- <listitem><para>
- <link linkend='kvm-cond'>kvm</link> option
- conditions must be met.
- </para></listitem>
- <listitem><para>
- Your build host has to have virtio net device, which
- are <filename>/dev/vhost-net</filename>.
- </para></listitem>
- <listitem><para>
- The build host <filename>/dev/vhost-net</filename>
- directory has to be either readable or writable
- and “slirp-enabled”.
- </para></listitem>
- </itemizedlist>
- </para></listitem>
- <listitem><para><filename>publicvnc</filename>:
- Enables a VNC server open to all hosts.
- </para></listitem>
- </itemizedlist>
- </para>
-
- <para>
- For further understanding regarding option use with
- <filename>runqemu</filename>, consider some examples.
- </para>
-
- <para>
- This example starts QEMU with
- <replaceable>MACHINE</replaceable> set to "qemux86".
- Assuming a standard
- <link linkend='build-directory'>Build Directory</link>,
- <filename>runqemu</filename> automatically finds the
- <filename>bzImage-qemux86.bin</filename> image file and
- the
- <filename>core-image-minimal-qemux86-20140707074611.rootfs.ext3</filename>
- (assuming the current build created a
- <filename>core-image-minimal</filename> image).
- <note>
- When more than one image with the same name exists, QEMU finds
- and uses the most recently built image according to the
- timestamp.
- </note>
- <literallayout class='monospaced'>
- $ runqemu qemux86
- </literallayout>
- This example produces the exact same results as the
- previous example.
- This command, however, specifically provides the image
- and root filesystem type.
- <literallayout class='monospaced'>
+ This example produces the exact same results as the
+ previous example.
+ This command, however, specifically provides the image
+ and root filesystem type.
+ <literallayout class='monospaced'>
$ runqemu qemux86 core-image-minimal ext3
- </literallayout>
- This example specifies to boot an initial RAM disk image
- and to enable audio in QEMU.
- For this case, <filename>runqemu</filename> set the
- internal variable <filename>FSTYPE</filename> to
- "cpio.gz".
- Also, for audio to be enabled, an appropriate driver must
- be installed (see the previous description for the
- <filename>audio</filename> option for more information).
- <literallayout class='monospaced'>
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ This example specifies to boot an initial RAM disk image
+ and to enable audio in QEMU.
+ For this case, <filename>runqemu</filename> set the
+ internal variable <filename>FSTYPE</filename> to
+ "cpio.gz".
+ Also, for audio to be enabled, an appropriate driver must
+ be installed (see the previous description for the
+ <filename>audio</filename> option for more information).
+ <literallayout class='monospaced'>
$ runqemu qemux86 ramfs audio
- </literallayout>
- This example does not provide enough information for
- QEMU to launch.
- While the command does provide a root filesystem type, it
- must also minimally provide a
- <replaceable>MACHINE</replaceable>,
- <replaceable>KERNEL</replaceable>, or
- <replaceable>VM</replaceable> option.
- <literallayout class='monospaced'>
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ This example does not provide enough information for
+ QEMU to launch.
+ While the command does provide a root filesystem type, it
+ must also minimally provide a
+ <replaceable>MACHINE</replaceable>,
+ <replaceable>KERNEL</replaceable>, or
+ <replaceable>VM</replaceable> option.
+ <literallayout class='monospaced'>
$ runqemu ext3
- </literallayout>
- This example specifies to boot a virtual machine image
- (<filename>.vmdk</filename> file).
- From the <filename>.vmdk</filename>,
- <filename>runqemu</filename> determines the QEMU
- architecture (<replaceable>MACHINE</replaceable>) to be
- "qemux86" and the root filesystem type to be "vmdk".
- <literallayout class='monospaced'>
- $ runqemu /home/scott-lenovo/vm/core-image-minimal-qemux86.vmdk
- </literallayout>
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ This example specifies to boot a virtual machine
+ image (<filename>.wic.vmdk</filename> file).
+ From the <filename>.wic.vmdk</filename>,
+ <filename>runqemu</filename> determines the QEMU
+ architecture (<replaceable>MACHINE</replaceable>) to be
+ "qemux86" and the root filesystem type to be "vmdk".
+ <literallayout class='monospaced'>
+ $ runqemu /home/scott-lenovo/vm/core-image-minimal-qemux86.wic.vmdk
+ </literallayout>
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ </orderedlist>
</para>
</section>
-</section>
-<section id='qemu-running-under-a-network-file-system-nfs-server'>
- <title>Running Under a Network File System (NFS) Server</title>
-
- <para>
- One method for running QEMU is to run it on an NFS server.
- This is useful when you need to access the same file system from both
- the build and the emulated system at the same time.
- It is also worth noting that the system does not need root privileges
- to run.
- It uses a user space NFS server to avoid that.
- This section describes how to set up for running QEMU using an NFS
- server and then how you can start and stop the server.
- </para>
-
- <section id='qemu-setting-up-to-use-nfs'>
- <title>Setting Up to Use NFS</title>
+ <section id='switching-between-consoles'>
+ <title>Switching Between Consoles</title>
<para>
- Once you are able to run QEMU in your environment, you can use the
- <filename>runqemu-extract-sdk</filename> script, which is located
- in the <filename>scripts</filename> directory along with
- <filename>runqemu</filename> script.
- The <filename>runqemu-extract-sdk</filename> takes a root
- file system tarball and extracts it into a location that you
- specify.
- Then, when you run <filename>runqemu</filename>, you can specify
- the location that has the file system to pass it to QEMU.
- Here is an example that takes a file system and extracts it to
- a directory named <filename>test-nfs</filename>:
- <literallayout class='monospaced'>
+ When booting or running QEMU, you can switch between
+ supported consoles by using
+ Ctrl+Alt+<replaceable>number</replaceable>.
+ For example, Ctrl+Alt+3 switches you to the serial console
+ as long as that console is enabled.
+ Being able to switch consoles is helpful, for example, if
+ the main QEMU console breaks for some reason.
+ <note>
+ Usually, "2" gets you to the main console and "3"
+ gets you to the serial console.
+ </note>
+ </para>
+ </section>
+
+ <section id='removing-the-splash-screen'>
+ <title>Removing the Splash Screen</title>
+
+ <para>
+ You can remove the splash screen when QEMU is booting by
+ using Alt+left.
+ Removing the splash screen allows you to see what is
+ happening in the background.
+ </para>
+ </section>
+
+ <section id='disabling-the-cursor-grab'>
+ <title>Disabling the Cursor Grab</title>
+
+ <para>
+ The default QEMU integration captures the cursor within the
+ main window.
+ It does this since standard mouse devices only provide
+ relative input and not absolute coordinates.
+ You then have to break out of the grab using the "Ctrl+Alt"
+ key combination.
+ However, the Yocto Project's integration of QEMU enables
+ the wacom USB touch pad driver by default to allow input
+ of absolute coordinates.
+ This default means that the mouse can enter and leave the
+ main window without the grab taking effect leading to a
+ better user experience.
+ </para>
+ </section>
+
+ <section id='qemu-running-under-a-network-file-system-nfs-server'>
+ <title>Running Under a Network File System (NFS) Server</title>
+
+ <para>
+ One method for running QEMU is to run it on an NFS server.
+ This is useful when you need to access the same file system
+ from both the build and the emulated system at the same time.
+ It is also worth noting that the system does not need root
+ privileges to run.
+ It uses a user space NFS server to avoid that.
+ Follow these steps to set up for running QEMU using an NFS
+ server.
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Extract a Root Filesystem:</emphasis>
+ Once you are able to run QEMU in your environment, you can
+ use the <filename>runqemu-extract-sdk</filename> script,
+ which is located in the <filename>scripts</filename>
+ directory along with the <filename>runqemu</filename>
+ script.</para>
+
+ <para>The <filename>runqemu-extract-sdk</filename> takes a
+ root filesystem tarball and extracts it into a location
+ that you specify.
+ Here is an example that takes a file system and
+ extracts it to a directory named
+ <filename>test-nfs</filename>:
+ <literallayout class='monospaced'>
runqemu-extract-sdk ./tmp/deploy/images/qemux86/core-image-sato-qemux86.tar.bz2 test-nfs
- </literallayout>
- Once you have extracted the file system, you can run
- <filename>runqemu</filename> normally with the additional
- location of the file system.
- You can then also make changes to the files within
- <filename>./test-nfs</filename> and see those changes appear in the
- image in real time.
- Here is an example using the <filename>qemux86</filename> image:
- <literallayout class='monospaced'>
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Start QEMU:</emphasis>
+ Once you have extracted the file system, you can run
+ <filename>runqemu</filename> normally with the additional
+ location of the file system.
+ You can then also make changes to the files within
+ <filename>./test-nfs</filename> and see those changes
+ appear in the image in real time.
+ Here is an example using the <filename>qemux86</filename>
+ image:
+ <literallayout class='monospaced'>
runqemu qemux86 ./test-nfs
- </literallayout>
- </para>
- </section>
-
- <section id='qemu-starting-and-stopping-nfs'>
- <title>Starting and Stopping NFS</title>
-
- <para>
- You can manually start and stop the NFS share using these
- commands:
- <itemizedlist>
- <listitem><para><emphasis><filename>start</filename>:</emphasis>
- Starts the NFS share:
- <literallayout class='monospaced'>
+ </literallayout>
+ </para></listitem>
+ </orderedlist>
+ <note>
+ <para>
+ Should you need to start, stop, or restart the NFS share,
+ you can use the following commands:
+ <itemizedlist>
+ <listitem><para>
+ The following command starts the NFS share:
+ <literallayout class='monospaced'>
runqemu-export-rootfs start <replaceable>file-system-location</replaceable>
- </literallayout>
- </para></listitem>
- <listitem><para><emphasis><filename>stop</filename>:</emphasis>
- Stops the NFS share:
- <literallayout class='monospaced'>
- runqemu-export-rootfs stop <replaceable>file-system-location</replaceable>
- </literallayout>
- </para></listitem>
- <listitem><para><emphasis><filename>restart</filename>:</emphasis>
- Restarts the NFS share:
- <literallayout class='monospaced'>
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ The following command stops the NFS share:
+ <literallayout class='monospaced'>
+ runqemu-export-rootfs stop <replaceable>file-system-location</replaceable>
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ The following command restarts the NFS share:
+ <literallayout class='monospaced'>
runqemu-export-rootfs restart <replaceable>file-system-location</replaceable>
- </literallayout>
- </para></listitem>
- </itemizedlist>
+ </literallayout>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </note>
</para>
</section>
-</section>
-
-<section id='qemu-tips-and-tricks'>
- <title>Tips and Tricks</title>
-
- <para>
- The following list describes things you can do to make running QEMU
- in the context of the Yocto Project a better experience:
- <itemizedlist>
- <listitem><para><emphasis>Switching Between Consoles:</emphasis>
- When booting or running QEMU, you can switch between
- supported consoles by using
- Ctrl+Alt+<replaceable>number</replaceable>.
- For example, Ctrl+Alt+3 switches you to the serial console as
- long as that console is enabled.
- Being able to switch consoles is helpful, for example, if the
- main QEMU console breaks for some reason.
- <note>
- Usually, "2" gets you to the main console and "3" gets you
- to the serial console.
- </note>
- </para></listitem>
- <listitem><para><emphasis>Removing the Splash Screen:</emphasis>
- You can remove the splash screen when QEMU is booting by
- using Alt+left.
- Removing the splash screen allows you to see what is happening
- in the background.
- </para></listitem>
- <listitem><para><emphasis>Disabling the Cursor Grab:</emphasis>
- The default QEMU integration captures the cursor within the
- main window.
- It does this since standard mouse devices only provide relative
- input and not absolute coordinates.
- You then have to break out of the grab using the "Ctrl+Alt" key
- combination.
- However, the Yocto Project's integration of QEMU enables the
- wacom USB touch pad driver by default to allow input of absolute
- coordinates.
- This default means that the mouse can enter and leave the
- main window without the grab taking effect leading to a better
- user experience.
- </para></listitem>
- </itemizedlist>
- </para>
-</section>
-
</chapter>
<!--
vim: expandtab tw=80 ts=4
diff --git a/import-layers/yocto-poky/documentation/dev-manual/dev-manual-start.xml b/import-layers/yocto-poky/documentation/dev-manual/dev-manual-start.xml
index b8527f6..195b22d 100644
--- a/import-layers/yocto-poky/documentation/dev-manual/dev-manual-start.xml
+++ b/import-layers/yocto-poky/documentation/dev-manual/dev-manual-start.xml
@@ -7,523 +7,744 @@
<title>Getting Started with the Yocto Project</title>
<para>
- This chapter introduces the Yocto Project and gives you an idea of what you need to get started.
- You can find enough information to set up your development host and build or use images for
- hardware supported by the Yocto Project by reading the
+ This chapter provides procedures related to getting set up to use the
+ Yocto Project.
+ For a more front-to-end process that takes you from minimally preparing
+ a build host through building an image, see the
<ulink url='&YOCTO_DOCS_QS_URL;'>Yocto Project Quick Start</ulink>.
</para>
-<para>
- The remainder of this chapter summarizes what is in the Yocto Project Quick Start and provides
- some higher-level concepts you might want to consider.
-</para>
-
-<section id='introducing-the-yocto-project'>
- <title>Introducing the Yocto Project</title>
+<section id='setting-up-the-development-host-to-use-the-yocto-project'>
+ <title>Setting Up the Development Host to Use the Yocto Project</title>
<para>
- The Yocto Project is an open-source collaboration project focused on embedded Linux development.
- The project currently provides a build system that is
- referred to as the
- <link linkend='build-system-term'>OpenEmbedded build system</link>
- in the Yocto Project documentation.
- The Yocto Project provides various ancillary tools for the embedded developer
- and also features the Sato reference User Interface, which is optimized for
- stylus-driven, low-resolution screens.
+ This section provides procedures to set up your development host to
+ use the Yocto Project.
+ You can use the Yocto Project on a native Linux development host or
+ you can use
+ <ulink url='https://git.yoctoproject.org/cgit/cgit.cgi/crops/about/'>CROPS</ulink>,
+ which leverages
+ <ulink url='https://www.docker.com/'>Docker Containers</ulink>,
+ to prepare any Linux, Mac, or Windows development host.
</para>
<para>
- You can use the OpenEmbedded build system, which uses
- <link linkend='bitbake-term'>BitBake</link>, to develop complete Linux
- images and associated user-space applications for architectures based
- on ARM, MIPS, PowerPC, x86 and x86-64.
- <note>
- By default, using the Yocto Project creates a Poky distribution.
- However, you can create your own distribution by providing key
- <link linkend='metadata'>Metadata</link>.
- See the "<link linkend='creating-your-own-distribution'>Creating Your Own Distribution</link>"
- section for more information.
- </note>
- While the Yocto Project does not provide a strict testing framework,
- it does provide or generate for you artifacts that let you perform target-level and
- emulated testing and debugging.
- Additionally, if you are an <trademark class='trade'>Eclipse</trademark>
- IDE user, you can install an Eclipse Yocto Plug-in to allow you to
- develop within that familiar environment.
- </para>
-</section>
-
-<section id='getting-setup'>
- <title>Getting Set Up</title>
-
- <para>
- Here is what you need to use the Yocto Project:
+ Once your development host is set up to use the Yocto Project,
+ further steps are necessary depending on what you want to
+ accomplish.
+ See the following references for information on how to prepare for
+ Board Support Package (BSP) development, kernel development, and
+ development using the <trademark class='trade'>Eclipse</trademark> IDE:
<itemizedlist>
- <listitem><para><emphasis>Host System:</emphasis> You should have a reasonably current
- Linux-based host system.
- You will have the best results with a recent release of Fedora,
- openSUSE, Debian, Ubuntu, or CentOS as these releases are frequently tested against the Yocto Project
- and officially supported.
- For a list of the distributions under validation and their status, see the
- "<ulink url='&YOCTO_DOCS_REF_URL;#detailed-supported-distros'>Supported Linux Distributions</ulink>" section
- in the Yocto Project Reference Manual and the wiki page at
- <ulink url='&YOCTO_WIKI_URL;/wiki/Distribution_Support'>Distribution Support</ulink>.</para>
- <para>
- You should also have about 50 Gbytes of free disk space for building images.
- </para></listitem>
- <listitem><para><emphasis>Packages:</emphasis> The OpenEmbedded build system
- requires that certain packages exist on your development system (e.g. Python 2.7).
- See "<ulink url='&YOCTO_DOCS_QS_URL;#packages'>The Build Host Packages</ulink>"
- section in the Yocto Project Quick Start and the
- "<ulink url='&YOCTO_DOCS_REF_URL;#required-packages-for-the-host-development-system'>Required Packages for the Host Development System</ulink>"
- section in the Yocto Project Reference Manual for the exact
- package requirements and the installation commands to install
- them for the supported distributions.
- </para></listitem>
- <listitem id='local-yp-release'><para><emphasis>Yocto Project Release:</emphasis>
- You need a release of the Yocto Project locally installed on
- your development system.
- The documentation refers to this set of locally installed files
- as the <link linkend='source-directory'>Source Directory</link>.
- You create your Source Directory by using
- <link linkend='git'>Git</link> to clone a local copy
- of the upstream <filename>poky</filename> repository,
- or by downloading and unpacking a tarball of an official
- Yocto Project release.
- The preferred method is to create a clone of the repository.
- </para>
- <para>Working from a copy of the upstream repository allows you
- to contribute back into the Yocto Project or simply work with
- the latest software on a development branch.
- Because Git maintains and creates an upstream repository with
- a complete history of changes and you are working with a local
- clone of that repository, you have access to all the Yocto
- Project development branches and tag names used in the upstream
- repository.</para>
- <note>You can view the Yocto Project Source Repositories at
- <ulink url='&YOCTO_GIT_URL;/cgit.cgi'></ulink>
- </note>
- <para>The following transcript shows how to clone the
- <filename>poky</filename> Git repository into the current
- working directory.
- The command creates the local repository in a directory
- named <filename>poky</filename>.
- For information on Git used within the Yocto Project, see
- the "<link linkend='git'>Git</link>" section.
- <literallayout class='monospaced'>
- $ git clone git://git.yoctoproject.org/poky
- Cloning into 'poky'...
- remote: Counting objects: 226790, done.
- remote: Compressing objects: 100% (57465/57465), done.
- remote: Total 226790 (delta 165212), reused 225887 (delta 164327)
- Receiving objects: 100% (226790/226790), 100.98 MiB | 263 KiB/s, done.
- Resolving deltas: 100% (165212/165212), done.
- </literallayout></para>
- <para>For another example of how to set up your own local Git
- repositories, see this
- <ulink url='&YOCTO_WIKI_URL;/wiki/Transcript:_from_git_checkout_to_meta-intel_BSP'>
- wiki page</ulink>, which describes how to create local
- Git repositories for both
- <filename>poky</filename> and <filename>meta-intel</filename>.
- </para>
- <para>
- You can also get the Yocto Project Files by downloading
- Yocto Project releases from the
- <ulink url="&YOCTO_HOME_URL;">Yocto Project website</ulink>.
- From the website, you just click "Downloads" in the navigation
- pane to the left to display all Yocto Project downloads.
- Current and archived releases are available for download.
- Nightly and developmental builds are also maintained at
- <ulink url="&YOCTO_AB_NIGHTLY_URL;"></ulink>.
- One final site you can visit for information on Yocto Project
- releases is the
- <ulink url='&YOCTO_WIKI_URL;/wiki/Releases'>Releases</ulink>
- wiki.
- </para></listitem>
- <listitem id='local-kernel-files'><para><emphasis>Yocto Project Kernel:</emphasis>
- If you are going to be making modifications to a supported Yocto Project kernel, you
- need to establish local copies of the source.
- You can find Git repositories of supported Yocto Project kernels organized under
- "Yocto Linux Kernel" in the Yocto Project Source Repositories at
- <ulink url='&YOCTO_GIT_URL;/cgit.cgi'></ulink>.</para>
- <para>This setup can involve creating a bare clone of the Yocto Project kernel and then
- copying that cloned repository.
- You can create the bare clone and the copy of the bare clone anywhere you like.
- For simplicity, it is recommended that you create these structures outside of the
- Source Directory, which is usually named <filename>poky</filename>.</para>
- <para>As an example, the following transcript shows how to create the bare clone
- of the <filename>linux-yocto-3.19</filename> kernel and then create a copy of
- that clone.
- <note>When you have a local Yocto Project kernel Git repository, you can
- reference that repository rather than the upstream Git repository as
- part of the <filename>clone</filename> command.
- Doing so can speed up the process.</note></para>
- <para>In the following example, the bare clone is named
- <filename>linux-yocto-3.19.git</filename>, while the
- copy is named <filename>my-linux-yocto-3.19-work</filename>:
- <literallayout class='monospaced'>
- $ git clone --bare git://git.yoctoproject.org/linux-yocto-3.19 linux-yocto-3.19.git
- Cloning into bare repository 'linux-yocto-3.19.git'...
- remote: Counting objects: 3983256, done.
- remote: Compressing objects: 100% (605006/605006), done.
- remote: Total 3983256 (delta 3352832), reused 3974503 (delta 3344079)
- Receiving objects: 100% (3983256/3983256), 843.66 MiB | 1.07 MiB/s, done.
- Resolving deltas: 100% (3352832/3352832), done.
- Checking connectivity... done.
- </literallayout></para>
- <para>Now create a clone of the bare clone just created:
- <literallayout class='monospaced'>
- $ git clone linux-yocto-3.19.git my-linux-yocto-3.19-work
- Cloning into 'my-linux-yocto-3.19-work'...
- done.
- Checking out files: 100% (48440/48440), done.
- </literallayout></para></listitem>
- <listitem id='meta-yocto-kernel-extras-repo'><para><emphasis>
- The <filename>meta-yocto-kernel-extras</filename> Git Repository</emphasis>:
- The <filename>meta-yocto-kernel-extras</filename> Git repository contains Metadata needed
- only if you are modifying and building the kernel image.
- In particular, it contains the kernel BitBake append (<filename>.bbappend</filename>)
- files that you
- edit to point to your locally modified kernel source files and to build the kernel
- image.
- Pointing to these local files is much more efficient than requiring a download of the
- kernel's source files from upstream each time you make changes to the kernel.</para>
- <para>You can find the <filename>meta-yocto-kernel-extras</filename> Git Repository in the
- "Yocto Metadata Layers" area of the Yocto Project Source Repositories at
- <ulink url='&YOCTO_GIT_URL;/cgit.cgi'></ulink>.
- It is good practice to create this Git repository inside the Source Directory.</para>
- <para>Following is an example that creates the <filename>meta-yocto-kernel-extras</filename> Git
- repository inside the Source Directory, which is named <filename>poky</filename>
- in this case:
- <literallayout class='monospaced'>
- $ cd ~/poky
- $ git clone git://git.yoctoproject.org/meta-yocto-kernel-extras meta-yocto-kernel-extras
- Cloning into 'meta-yocto-kernel-extras'...
- remote: Counting objects: 727, done.
- remote: Compressing objects: 100% (452/452), done.
- remote: Total 727 (delta 260), reused 719 (delta 252)
- Receiving objects: 100% (727/727), 536.36 KiB | 240 KiB/s, done.
- Resolving deltas: 100% (260/260), done.
- </literallayout></para></listitem>
- <listitem><para id='supported-board-support-packages-(bsps)'><emphasis>Supported Board Support Packages (BSPs):</emphasis>
- The Yocto Project supports many BSPs, which are maintained in
- their own layers or in layers designed to contain several
- BSPs.
- To get an idea of machine support through BSP layers, you can
- look at the
- <ulink url='&YOCTO_RELEASE_DL_URL;/machines'>index of machines</ulink>
- for the release.</para>
-
- <para>The Yocto Project uses the following BSP layer naming
- scheme:
- <literallayout class='monospaced'>
- meta-<replaceable>bsp_name</replaceable>
- </literallayout>
- where <replaceable>bsp_name</replaceable> is the recognized
- BSP name.
- Here is an example:
- <literallayout class='monospaced'>
- meta-raspberrypi
- </literallayout>
+ <listitem><para>
+ <emphasis>BSP Development:</emphasis>
See the
- "<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-layers'>BSP Layers</ulink>"
+ "<ulink url='&YOCTO_DOCS_BSP_URL;#preparing-your-build-host-to-work-with-bsp-layers'>Preparing Your Build Host to Work With BSP Layers</ulink>"
section in the Yocto Project Board Support Package (BSP)
- Developer's Guide for more information on BSP Layers.</para>
-
- <para>A useful Git repository released with the Yocto
- Project is <filename>meta-intel</filename>, which is a
- parent layer that contains many supported
- <ulink url='&YOCTO_DOCS_BSP_URL;#bsp-layers'>BSP Layers</ulink>.
- You can locate the <filename>meta-intel</filename> Git
- repository in the "Yocto Metadata Layers" area of the Yocto
- Project Source Repositories at
- <ulink url='&YOCTO_GIT_URL;/cgit.cgi'></ulink>.</para>
-
- <para>Using
- <link linkend='git'>Git</link> to create a local clone of the
- upstream repository can be helpful if you are working with
- BSPs.
- Typically, you set up the <filename>meta-intel</filename>
- Git repository inside the Source Directory.
- For example, the following transcript shows the steps to clone
- <filename>meta-intel</filename>.
- <note>
- Be sure to work in the <filename>meta-intel</filename>
- branch that matches your
- <link linkend='source-directory'>Source Directory</link>
- (i.e. <filename>poky</filename>) branch.
- For example, if you have checked out the "master" branch
- of <filename>poky</filename> and you are going to use
- <filename>meta-intel</filename>, be sure to checkout the
- "master" branch of <filename>meta-intel</filename>.
- </note>
- <literallayout class='monospaced'>
- $ cd ~/poky
- $ git clone git://git.yoctoproject.org/meta-intel.git
- Cloning into 'meta-intel'...
- remote: Counting objects: 11917, done.
- remote: Compressing objects: 100% (3842/3842), done.
- remote: Total 11917 (delta 6840), reused 11699 (delta 6622)
- Receiving objects: 100% (11917/11917), 2.92 MiB | 2.88 MiB/s, done.
- Resolving deltas: 100% (6840/6840), done.
- Checking connectivity... done.
- </literallayout></para>
-
- <para>The same
- <ulink url='&YOCTO_WIKI_URL;/wiki/Transcript:_from_git_checkout_to_meta-intel_BSP'>wiki page</ulink>
- referenced earlier covers how to set up the
- <filename>meta-intel</filename> Git repository.
+ Developer's Guide.
</para></listitem>
- <listitem><para><emphasis>Eclipse Yocto Plug-in:</emphasis> If you are developing
- applications using the Eclipse Integrated Development Environment (IDE),
- you will need this plug-in.
+ <listitem><para>
+ <emphasis>Kernel Development:</emphasis>
See the
- "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-appendix-latest-yp-eclipse-plug-in'>Using Eclipse</ulink>"
- section in the Yocto Project Software Development Kit (SDK)
- Developer's Guide for more information.</para></listitem>
+ "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#preparing-the-build-host-to-work-on-the-kernel'>Preparing the Build Host to Work on the Kernel</ulink>"
+ section in the Yocto Project Linux Kernel Development Manual.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Eclipse Development:</emphasis>
+ See the
+ "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-eclipse-project'>Developing Applications Using <trademark class='trade'>Eclipse</trademark></ulink>"
+ Chapter in the Yocto Project Application Development and the
+ Extensible Software Development Kit (eSDK) manual.
+ </para></listitem>
</itemizedlist>
</para>
+
+ <section id='setting-up-a-native-linux-host'>
+ <title>Setting Up a Native Linux Host</title>
+
+ <para>
+ Follow these steps to prepare a native Linux machine as your
+ Yocto Project development host:
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Use a Supported Linux Distribution:</emphasis>
+ You should have a reasonably current Linux-based host
+ system.
+ You will have the best results with a recent release of
+ Fedora, openSUSE, Debian, Ubuntu, or CentOS as these
+ releases are frequently tested against the Yocto Project
+ and officially supported.
+ For a list of the distributions under validation and their
+ status, see the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#detailed-supported-distros'>Supported Linux Distributions</ulink>" section
+ in the Yocto Project Reference Manual and the wiki page at
+ <ulink url='&YOCTO_WIKI_URL;/wiki/Distribution_Support'>Distribution Support</ulink>.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Have Enough Free Memory:</emphasis>
+ You should have at least 50 Gbytes of free disk space
+ for building images.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Meet Minimal Version Requirements:</emphasis>
+ The OpenEmbedded build system should be able to run on any
+ modern distribution that has the following versions for
+ Git, tar, and Python.
+ <itemizedlist>
+ <listitem><para>
+ Git 1.8.3.1 or greater
+ </para></listitem>
+ <listitem><para>
+ tar 1.27 or greater
+ </para></listitem>
+ <listitem><para>
+ Python 3.4.0 or greater.
+ </para></listitem>
+ </itemizedlist>
+ If your build host does not meet any of these three listed
+ version requirements, you can take steps to prepare the
+ system so that you can still use the Yocto Project.
+ See the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#required-git-tar-and-python-versions'>Required Git, tar, and Python Versions</ulink>"
+ section in the Yocto Project Reference Manual for
+ information.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Install Development Host Packages:</emphasis>
+ Required development host packages vary depending on your
+ build machine and what you want to do with the Yocto
+ Project.
+ Collectively, the number of required packages is large
+ if you want to be able to cover all cases.</para>
+
+ <para>For lists of required packages for all scenarios,
+ see the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#required-packages-for-the-host-development-system'>Required Packages for the Host Development System</ulink>"
+ section in the Yocto Project Reference Manual.
+ </para></listitem>
+ </orderedlist>
+ Once you have completed the previous steps, you are ready to
+ continue using a given development path on your native Linux
+ machine.
+ If you are going to use BitBake, see the
+ "<link linkend='cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</link>"
+ section.
+ If you are going to use the Extensible SDK, see the
+ "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-extensible'>Using the Extensible SDK</ulink>"
+ Chapter in the Yocto Project Application Development and the
+ Extensible Software Development Kit (eSDK) manual.
+ If you want to work on the kernel, see the
+ <ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;'>Yocto Project Linux Kernel Development Manual</ulink>.
+ If you are going to use Toaster, see the
+ "<ulink url='&YOCTO_DOCS_TOAST_URL;#toaster-manual-setup-and-use'>Setting Up and Using Toaster</ulink>"
+ section in the Toaster User Manual.
+ </para>
+ </section>
+
+ <section id='setting-up-to-use-crops'>
+ <title>Setting Up to Use CROss PlatformS (CROPS)</title>
+
+ <para>
+ With
+ <ulink url='https://git.yoctoproject.org/cgit/cgit.cgi/crops/about/'>CROPS</ulink>,
+ which leverages
+ <ulink url='https://www.docker.com/'>Docker Containers</ulink>,
+ you can create a Yocto Project development environment that
+ is operating system agnostic.
+ You can set up a container in which you can develop using the
+ Yocto Project on a Windows, Mac, or Linux machine.
+ </para>
+
+ <para>
+ Follow these general steps to prepare a Windows, Mac, or Linux
+ machine as your Yocto Project development host:
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Go to the Docker Installation Site:</emphasis>
+ <ulink url='https://www.docker.com/what-docker'>Docker</ulink>
+ is a software container platform that you need to install
+ on the host development machine.
+ To start the installation process, see the
+ <ulink url='https://docs.docker.com/engine/installation/'>Docker Installation</ulink>
+ site.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Choose Your Docker Edition:</emphasis>
+ Docker comes in several editions.
+ For the Yocto Project, the stable community edition
+ (i.e. "Docker CE Stable") is adequate.
+ You can learn more about the Docker editions from the
+ site.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Go the Install Site for Your Platform:</emphasis>
+ Click the link for the Docker edition associated with
+ your development host machine's native software.
+ For example, if your machine is running Microsoft
+ Windows Version 10 and you want the Docker CE Stable
+ edition, click that link under "Supported Platforms".
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Understand What You Need:</emphasis>
+ The install page has pre-requisites your machine must
+ meet.
+ Be sure you read through this page and make sure your
+ machine meets the requirements to run Docker.
+ If your machine does not meet the requirements, the page
+ has instructions to handle exceptions.
+ For example, to run Docker on Windows 10, you must have
+ the pro version of the operating system.
+ If you have the home version, you need to install the
+ <ulink url='https://docs.docker.com/toolbox/overview/#ready-to-get-started'>Docker Toolbox</ulink>.
+ </para>
+
+ <para>Another example is that a Windows machine needs to
+ have Microsoft Hyper-V.
+ If you have a legacy version of the the Microsoft
+ operating system or for any other reason you do not have
+ Microsoft Hyper-V, you would have to enter the BIOS and
+ enable virtualization.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Install the Software:</emphasis>
+ Once you have understood all the pre-requisites, you can
+ download and install the appropriate software.
+ Follow the instructions for your specific machine and
+ the type of the software you need to install.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Optionally Orient Yourself With Dockers:</emphasis>
+ If you are unfamiliar with Dockers and the container
+ concept, you can learn more here -
+ <ulink url='https://docs.docker.com/get-started/'></ulink>.
+ You should be able to launch Docker or the Docker Toolbox
+ and have a terminal shell on your development host.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Set Up the Containers to Use the Yocto Project:</emphasis>
+ Go to
+ <ulink url='https://github.com/crops/docker-win-mac-docs/wiki'></ulink>
+ and follow the directions for your particular
+ development host (i.e. Linux, Mac, or Windows).</para>
+
+ <para>Once you complete the setup instructions for your
+ machine, you have the Poky, Extensible SDK, and Toaster
+ containers available.
+ You can click those links from the page and learn more
+ about using each of those containers.
+ </para></listitem>
+ </orderedlist>
+ Once you have a container set up, everything is in place to
+ develop just as if you were running on a native Linux machine.
+ If you are going to use the Poky container, see the
+ "<link linkend='cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</link>"
+ section.
+ If you are going to use the Extensible SDK container, see the
+ "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-extensible'>Using the Extensible SDK</ulink>"
+ Chapter in the Yocto Project Application Development and the
+ Extensible Software Development Kit (eSDK) manual.
+ If you are going to use the Toaster container, see the
+ "<ulink url='&YOCTO_DOCS_TOAST_URL;#toaster-manual-setup-and-use'>Setting Up and Using Toaster</ulink>"
+ section in the Toaster User Manual.
+ </para>
+ </section>
</section>
-<section id='building-images'>
- <title>Building Images</title>
+<section id='working-with-yocto-project-source-files'>
+ <title>Working With Yocto Project Source Files</title>
<para>
- The build process creates an entire Linux distribution, including the toolchain, from source.
- For more information on this topic, see the
+ This section contains procedures related to locating and securing
+ Yocto Project files.
+ You establish and use these local files to work on projects.
+ <note><title>Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ For concepts and introductory information about Git as it
+ is used in the Yocto Project, see the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#git'>Git</ulink>"
+ section in the Yocto Project Reference Manual.
+ </para></listitem>
+ <listitem><para>
+ For concepts on Yocto Project source repositories, see the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#yocto-project-repositories'>Yocto Project Source Repositories</ulink>"
+ section in the Yocto Project Reference Manual."
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </para>
+
+ <section id='accessing-source-repositories'>
+ <title>Accessing Source Repositories</title>
+
+ <para>
+ Yocto Project maintains upstream Git
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-repositories'>Source Repositories</ulink>
+ that you can examine and access using a browser-based UI:
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Access Repositories:</emphasis>
+ Open a browser and go to
+ <ulink url='&YOCTO_GIT_URL;'></ulink> to access the
+ GUI-based interface into the Yocto Project source
+ repositories.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Select a Repository:</emphasis>
+ Click on any repository in which you are interested (e.g.
+ <filename>poky</filename>).
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Find the URL Used to Clone the Repository:</emphasis>
+ At the bottom of the page, note the URL used to
+ <ulink url='&YOCTO_DOCS_REF_URL;#git-commands-clone'>clone</ulink>
+ that repository (e.g.
+ <filename>&YOCTO_GIT_URL;/poky</filename>).
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Examine Change History of the Repository:</emphasis>
+ At the top of the page, click on any branch in which you
+ might be interested (e.g.
+ <filename>&DISTRO_NAME_NO_CAP;</filename>).
+ You can then view the commit log or tree view for that
+ development branch.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='accessing-index-of-releases'>
+ <title>Accessing Index of Releases</title>
+
+ <para>
+ Yocto Project maintains an Index of Releases area that contains
+ related files that contribute to the Yocto Project.
+ Rather than Git repositories, these files represent snapshot
+ tarballs.
+ <note><title>Tip</title>
+ The recommended method for accessing Yocto Project
+ components is to use Git to clone a repository and work from
+ within that local repository.
+ The procedure in this section exists should you desire a
+ tarball snapshot of any given component.
+ </note>
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Access the Index of Releases:</emphasis>
+ Open a browser and go to
+ <ulink url='&YOCTO_DL_URL;/releases'></ulink> to access the
+ Index of Releases.
+ The list represents released components (e.g.
+ <filename>eclipse-plugin</filename>,
+ <filename>sato</filename>, and so on).
+ <note>
+ The <filename>yocto</filename> directory contains the
+ full array of released Poky tarballs.
+ The <filename>poky</filename> directory in the
+ Index of Releases was historically used for very
+ early releases and exists for retroactive
+ completeness only.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Select a Component:</emphasis>
+ Click on any released component in which you are interested
+ (e.g. <filename>yocto</filename>).
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Find the Tarball:</emphasis>
+ Drill down to find the associated tarball.
+ For example, click on <filename>yocto-&DISTRO;</filename> to
+ view files associated with the Yocto Project &DISTRO;
+ release (e.g. <filename>poky-&DISTRO_NAME_NO_CAP;-&POKYVERSION;.tar.bz2</filename>,
+ which is the released Poky tarball).
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Download the Tarball:</emphasis>
+ Click a tarball to download and save a snapshot of a
+ given component.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='using-the-downloads-page'>
+ <title>Using the Downloads Page</title>
+
+ <para>
+ The
+ <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink>
+ uses a "Downloads" area from which you can locate and download
+ tarballs of any Yocto Project release.
+ Rather than Git repositories, these files represent snapshot
+ tarballs.
+ <note><title>Tip</title>
+ The recommended method for accessing Yocto Project
+ components is to use Git to clone a repository and work from
+ within that local repository.
+ The procedure in this section exists should you desire a
+ tarball snapshot of any given component.
+ </note>
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Go to the Yocto Project Website:</emphasis>
+ Open The
+ <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink>
+ in your browser.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Get to the Downloads Area:</emphasis>
+ Click the "Downloads" tab.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Select the Type of Files:</emphasis>
+ Click the type of files you want (i.e "Build System",
+ "Tools", or "Board Support Packages (BSPs)".
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Locate and Download the Tarball:</emphasis>
+ From the list of releases, locate the appropriate
+ download link and download the files.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='cloning-the-poky-repository'>
+ <title>Cloning the <filename>poky</filename> Repository</title>
+
+ <para>
+ To use the Yocto Project, you need a release of the Yocto Project
+ locally installed on your development system.
+ The locally installed set of files is referred to as the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
+ in the Yocto Project documentation.
+ </para>
+
+ <para>
+ You create your Source Directory by using
+ <ulink url='&YOCTO_DOCS_REF_URL;#git'>Git</ulink> to clone a local
+ copy of the upstream <filename>poky</filename> repository.
+ <note><title>Tip</title>
+ The preferred method of getting the Yocto Project Source
+ Directory set up is to clone the repository.
+ </note>
+ Working from a copy of the upstream repository allows you
+ to contribute back into the Yocto Project or simply work with
+ the latest software on a development branch.
+ Because Git maintains and creates an upstream repository with
+ a complete history of changes and you are working with a local
+ clone of that repository, you have access to all the Yocto
+ Project development branches and tag names used in the upstream
+ repository.
+ </para>
+
+ <para>
+ Follow these steps to create a local version of the
+ upstream
+ <ulink url='&YOCTO_DOCS_REF_URL;#poky'><filename>poky</filename></ulink>
+ Git repository.
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Set Your Directory:</emphasis>
+ Be in the directory where you want to create your local
+ copy of poky.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Clone the Repository:</emphasis>
+ The following command clones the repository and uses
+ the default name "poky" for your local repository:
+ <literallayout class='monospaced'>
+ $ git clone git://git.yoctoproject.org/poky
+ Cloning into 'poky'...
+ remote: Counting objects: 367178, done.
+ remote: Compressing objects: 100% (88161/88161), done.
+ remote: Total 367178 (delta 272761), reused 366942 (delta 272525)
+ Receiving objects: 100% (367178/367178), 133.26 MiB | 6.40 MiB/s, done.
+ Resolving deltas: 100% (272761/272761), done.
+ Checking connectivity... done.
+ </literallayout>
+ Unless you specify a specific development branch or
+ tag name, Git clones the "master" branch, which results
+ in a snapshot of the latest development changes for
+ "master".
+ For information on how to check out a specific
+ development branch or on how to check out a local
+ branch based on a tag name, see the
+ "<link linkend='checking-out-by-branch-in-poky'>Checking Out By Branch in Poky</link>"
+ and
+ <link linkend='checkout-out-by-tag-in-poky'>Checking Out By Tag in Poky</link>",
+ respectively.</para>
+
+ <para>Once the repository is created, you can change to
+ that directory and check its status.
+ Here, the single "master" branch exists on your system
+ and by default, it is checked out:
+ <literallayout class='monospaced'>
+ $ cd ~/poky
+ $ git status
+ On branch master
+ Your branch is up-to-date with 'origin/master'.
+ nothing to commit, working directory clean
+ $ git branch
+ * master
+ </literallayout>
+ Your local repository of poky is identical to the
+ upstream poky repository at the time from which it was
+ cloned.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='checking-out-by-branch-in-poky'>
+ <title>Checking Out by Branch in Poky</title>
+
+ <para>
+ When you clone the upstream poky repository, you have access to
+ all its development branches.
+ Each development branch in a repository is unique as it forks
+ off the "master" branch.
+ To see and use the files of a particular development branch
+ locally, you need to know the branch name and then specifically
+ check out that development branch.
+ <note>
+ Checking out an active development branch by branch name
+ gives you a snapshot of that particular branch at the time
+ you check it out.
+ Further development on top of the branch that occurs after
+ check it out can occur.
+ </note>
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Switch to the Poky Directory:</emphasis>
+ If you have a local poky Git repository, switch to that
+ directory.
+ If you do not have the local copy of poky, see the
+ "<link linkend='cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</link>"
+ section.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Determine Existing Branch Names:</emphasis>
+ <literallayout class='monospaced'>
+ $ git branch -a
+ * master
+ remotes/origin/1.1_M1
+ remotes/origin/1.1_M2
+ remotes/origin/1.1_M3
+ remotes/origin/1.1_M4
+ remotes/origin/1.2_M1
+ remotes/origin/1.2_M2
+ remotes/origin/1.2_M3
+ .
+ .
+ .
+ remotes/origin/master-next
+ remotes/origin/master-next2
+ remotes/origin/morty
+ remotes/origin/pinky
+ remotes/origin/purple
+ remotes/origin/pyro
+ remotes/origin/rocko
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Checkout the Branch:</emphasis>
+ Checkout the development branch in which you want to work.
+ For example, to access the files for the Yocto Project
+ &DISTRO; Release (&DISTRO_NAME;), use the following command:
+ <literallayout class='monospaced'>
+ $ git checkout -b &DISTRO_NAME_NO_CAP; origin/&DISTRO_NAME_NO_CAP;
+ Branch &DISTRO_NAME_NO_CAP; set up to track remote branch &DISTRO_NAME_NO_CAP; from origin.
+ Switched to a new branch '&DISTRO_NAME_NO_CAP;'
+ </literallayout>
+ The previous command checks out the "&DISTRO_NAME_NO_CAP;"
+ development branch and reports that the branch is tracking
+ the upstream "origin/&DISTRO_NAME_NO_CAP;" branch.</para>
+
+ <para>The following command displays the branches
+ that are now part of your local poky repository.
+ The asterisk character indicates the branch that is
+ currently checked out for work:
+ <literallayout class='monospaced'>
+ $ git branch
+ master
+ * &DISTRO_NAME_NO_CAP;
+ </literallayout>
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='checkout-out-by-tag-in-poky'>
+ <title>Checking Out by Tag in Poky</title>
+
+ <para>
+ Similar to branches, the upstream repository uses tags
+ to mark specific commits associated with significant points in
+ a development branch (i.e. a release point or stage of a
+ release).
+ You might want to set up a local branch based on one of those
+ points in the repository.
+ The process is similar to checking out by branch name except you
+ use tag names.
+ <note>
+ Checking out a branch based on a tag gives you a
+ stable set of files not affected by development on the
+ branch above the tag.
+ </note>
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Switch to the Poky Directory:</emphasis>
+ If you have a local poky Git repository, switch to that
+ directory.
+ If you do not have the local copy of poky, see the
+ "<link linkend='cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</link>"
+ section.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Fetch the Tag Names:</emphasis>
+ To checkout the branch based on a tag name, you need to
+ fetch the upstream tags into your local repository:
+ <literallayout class='monospaced'>
+ $ git fetch --tags
+ $
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>List the Tag Names:</emphasis>
+ You can list the tag names now:
+ <literallayout class='monospaced'>
+ $ git tag
+ 1.1_M1.final
+ 1.1_M1.rc1
+ 1.1_M1.rc2
+ 1.1_M2.final
+ 1.1_M2.rc1
+ .
+ .
+ .
+ yocto-2.2
+ yocto-2.2.1
+ yocto-2.3
+ yocto-2.3.1
+ yocto-2.4
+ yocto_1.5_M5.rc8
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Checkout the Branch:</emphasis>
+ <literallayout class='monospaced'>
+ $ git checkout tags/&DISTRO; -b my_yocto_&DISTRO;
+ Switched to a new branch 'my_yocto_&DISTRO;'
+ $ git branch
+ master
+ * my_yocto_&DISTRO;
+ </literallayout>
+ The previous command creates and checks out a local
+ branch named "my_yocto_&DISTRO;", which is based on
+ the commit in the upstream poky repository that has
+ the same tag.
+ In this example, the files you have available locally
+ as a result of the <filename>checkout</filename>
+ command are a snapshot of the
+ "&DISTRO_NAME_NO_CAP;" development branch at the point
+ where Yocto Project &DISTRO; was released.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+</section>
+
+<section id='performing-a-simple-build'>
+ <title>Performing a Simple Build</title>
+
+ <para>
+ Several methods exist that allow you to build an image within the
+ Yocto Project.
+ This procedure shows how to build an image using BitBake from a
+ Linux host.
+ <note><title>Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ For information on how to build an image using
+ <ulink url='&YOCTO_DOCS_REF_URL;#toaster-term'>Toaster</ulink>,
+ see the
+ <ulink url='&YOCTO_DOCS_TOAST_URL;'>Yocto Project Toaster Manual</ulink>.
+ </para></listitem>
+ <listitem><para>
+ For information on how to use
+ <filename>devtool</filename> to build images, see the
+ "<ulink url='&YOCTO_DOCS_SDK_URL;#using-devtool-in-your-sdk-workflow'>Using <filename>devtool</filename> in Your SDK Workflow</ulink>"
+ section in the Yocto Project Application Development and
+ the Extensible Software Development Kit (eSDK) manual.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </para>
+
+ <para>
+ The build process creates an entire Linux distribution from source
+ and places it in your
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
+ under <filename>tmp/deploy/images</filename>.
+ For detailed information on the build process using BitBake, see the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#images-dev-environment'>Images</ulink>"
+ section in the Yocto Project Reference Manual.
+ You can also reference the
"<ulink url='&YOCTO_DOCS_QS_URL;#qs-building-images'>Building Images</ulink>"
section in the Yocto Project Quick Start.
</para>
<para>
- The build process is as follows:
+ The following figure and list overviews the build process:
+ <imagedata fileref="figures/bitbake-build-flow.png" width="7in" depth="4in" align="center" scalefit="1" />
<orderedlist>
- <listitem><para>Make sure you have set up the Source Directory described in the
- previous section.</para></listitem>
- <listitem><para>Initialize the build environment by sourcing a build
- environment script (i.e.
- <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>
- or
- <ulink url='&YOCTO_DOCS_REF_URL;#structure-memres-core-script'><filename>oe-init-build-env-memres</filename></ulink>).
+ <listitem><para>
+ <emphasis>Set up Your Host Development System to Support
+ Development Using the Yocto Project</emphasis>:
+ See the
+ "<ulink url='&YOCTO_DOCS_QS_URL;#yp-resources'>Setting Up to Use the Yocto Project</ulink>"
+ section in the Yocto Project Quick Start for options on how
+ to get a build host ready to use the Yocto Project.
</para></listitem>
- <listitem><para>Optionally ensure the <filename>conf/local.conf</filename> configuration file,
- which is found in the
- <link linkend='build-directory'>Build Directory</link>,
+ <listitem><para>
+ <emphasis>Initialize the Build Environment:</emphasis>
+ Initialize the build environment by sourcing the build
+ environment script (i.e.
+ <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>).
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Make Sure Your <filename>local.conf</filename>
+ File is Correct:</emphasis>
+ Ensure the <filename>conf/local.conf</filename> configuration
+ file, which is found in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>,
is set up how you want it.
- This file defines many aspects of the build environment including
- the target machine architecture through the
+ This file defines many aspects of the build environment
+ including the target machine architecture through the
<filename><ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'>MACHINE</ulink></filename> variable,
the packaging format used during the build
(<ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></ulink>),
and a centralized tarball download directory through the
- <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-DL_DIR'>DL_DIR</ulink></filename> variable.</para></listitem>
+ <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-DL_DIR'>DL_DIR</ulink></filename> variable.
+ </para></listitem>
<listitem><para>
+ <emphasis>Build the Image:</emphasis>
Build the image using the <filename>bitbake</filename> command.
- If you want information on BitBake, see the
+ For example, the following command builds the
+ <filename>core-image-minimal</filename> image:
+ <literallayout class='monospaced'>
+ $ bitbake core-image-minimal
+ </literallayout>
+ For information on BitBake, see the
<ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual</ulink>.
</para></listitem>
- <listitem><para>Run the image either on the actual hardware or using the QEMU
- emulator.</para></listitem>
</orderedlist>
</para>
</section>
-<section id='flashing-images-using-bmaptool'>
- <title>Flashing Images Using <filename>bmaptool</filename></title>
-
- <para>
- An easy way to flash an image to a bootable device is to use
- <filename>bmaptool</filename>, which is integrated into the
- OpenEmbedded build system.
- </para>
-
- <para>
- Following, is an example that shows how to flash a Wic image.
- <note>
- You can use <filename>bmaptool</filename> to flash any
- type of image.
- </note>
- Use these steps to flash an image using
- <filename>bmaptool</filename>:
- <note>
- Unless you are able to install the
- <filename>bmap-tools</filename> package as mentioned in the note
- in the second bullet of step 3 further down, you will need to build
- <filename>bmaptool</filename> before using it.
- Build the tool using the following command:
- <literallayout class='monospaced'>
- $ bitbake bmap-tools-native
- </literallayout>
- </note>
- <orderedlist>
- <listitem><para>
- Add the following to your <filename>local.conf</filename>
- file:
- <literallayout class='monospaced'>
- IMAGE_FSTYPES += "wic wic.bmap"
- </literallayout>
- </para></listitem>
- <listitem><para>
- Either have your image ready (pre-built) or take the step
- build the image:
- <literallayout class='monospaced'>
- $ bitbake <replaceable>image</replaceable>
- </literallayout>
- </para></listitem>
- <listitem><para>
- Flash the image to the media by using
- <filename>bmaptool</filename> depending on your particular
- setup:
- <itemizedlist>
- <listitem><para>
- If you have write access to the media,
- use this command form:
- <literallayout class='monospaced'>
- $ oe-run-native bmaptool copy ./tmp/deploy/images/qemux86-64/core-image-minimal-<replaceable>machine</replaceable>.wic /dev/sd<replaceable>X</replaceable>
- </literallayout>
- </para></listitem>
- <listitem><para>
- If you do not have write access to
- the media, use the following
- commands:
- <literallayout class='monospaced'>
- $ sudo bash
- $ PATH=tmp/sysroots/x86_64-linux/usr/bin/ bmaptool copy ./tmp/deploy/images/qemux86-64/core-image-minimal-<replaceable>machine</replaceable>.wic /dev/sd<replaceable>X</replaceable>
- </literallayout>
- <note>
- If you are using Ubuntu or Debian distributions,
- you can install the
- <filename>bmap-tools</filename> package using the
- following command and then use the tool
- without specifying
- <filename>PATH</filename> even from the
- root account:
- <literallayout class='monospaced'>
- $ sudo apt-get install bmap-tools
- </literallayout>
- </note>
- </para></listitem>
- </itemizedlist>
- </para></listitem>
- </orderedlist>
- </para>
-
- <para>
- For help on the <filename>bmaptool</filename> command, use either of
- the following commands:
- <literallayout class='monospaced'>
- $ bmaptool --help
- $ oe-run-native bmaptool --help
- </literallayout>
- </para>
-</section>
-
-<section id='using-pre-built-binaries-and-qemu'>
- <title>Using Pre-Built Binaries and QEMU</title>
-
- <para>
- Another option you have to get started is to use pre-built binaries.
- The Yocto Project provides many types of binaries with each release.
- See the "<ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Images</ulink>"
- chapter in the Yocto Project Reference Manual
- for descriptions of the types of binaries that ship with a Yocto Project
- release.
- </para>
-
- <para>
- Using a pre-built binary is ideal for developing software
- applications to run on your target hardware.
- To do this, you need to be able to access the appropriate
- cross-toolchain tarball for the architecture on which you are
- developing.
- If you are using an SDK type image, the image ships with the complete
- toolchain native to the architecture (i.e. a toolchain designed to
- run on the
- <ulink url='&YOCTO_DOCS_REF_URL;#var-SDKMACHINE'><filename>SDKMACHINE</filename></ulink>).
- If you are not using an SDK type image, you need to separately download
- and install the stand-alone Yocto Project cross-toolchain tarball.
- See the
- "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-appendix-obtain'>Obtaining the SDK</ulink>"
- appendix in the Yocto Project Software Development Kit (SDK)
- Developer's Guide for more information on locating and installing
- cross-toolchains.
- </para>
-
- <para>
- Regardless of the type of image you are using, you need to download the pre-built kernel
- that you will boot in the QEMU emulator and then download and extract the target root
- filesystem for your target machine’s architecture.
- You can get architecture-specific binaries and file systems from
- <ulink url='&YOCTO_MACHINES_DL_URL;'>machines</ulink>.
- You can get installation scripts for stand-alone toolchains from
- <ulink url='&YOCTO_TOOLCHAIN_DL_URL;'>toolchains</ulink>.
- Once you have all your files, you set up the environment to emulate the hardware
- by sourcing an environment setup script.
- Finally, you start the QEMU emulator.
- You can find details on all these steps in the
- <ulink url='&YOCTO_DOCS_SDK_URL;#sdk-manual'>Yocto Project Software Development Kit (SDK) Developer's Guide</ulink>.
- You can learn more about using QEMU with the Yocto Project in the
- "<link linkend='dev-manual-qemu'>Using the Quick EMUlator (QEMU)</link>"
- section.
- </para>
-
- <para>
- Using QEMU to emulate your hardware can result in speed issues
- depending on the target and host architecture mix.
- For example, using the <filename>qemux86</filename> image in the emulator
- on an Intel-based 32-bit (x86) host machine is fast because the target and
- host architectures match.
- On the other hand, using the <filename>qemuarm</filename> image on the same Intel-based
- host can be slower.
- But, you still achieve faithful emulation of ARM-specific issues.
- </para>
-
- <para>
- To speed things up, the QEMU images support using <filename>distcc</filename>
- to call a cross-compiler outside the emulated system.
- If you used <filename>runqemu</filename> to start QEMU, and the
- <filename>distccd</filename> application is present on the host system, any
- BitBake cross-compiling toolchain available from the build system is automatically
- used from within QEMU simply by calling <filename>distcc</filename>.
- You can accomplish this by defining the cross-compiler variable
- (e.g. <filename>export CC="distcc"</filename>).
- Alternatively, if you are using a suitable SDK image or the appropriate
- stand-alone toolchain is present,
- the toolchain is also automatically used.
- </para>
-
- <note>
- Several mechanisms exist that let you connect to the system running on the
- QEMU emulator:
- <itemizedlist>
- <listitem><para>QEMU provides a framebuffer interface that makes standard
- consoles available.</para></listitem>
- <listitem><para>Generally, headless embedded devices have a serial port.
- If so, you can configure the operating system of the running image
- to use that port to run a console.
- The connection uses standard IP networking.</para></listitem>
- <listitem><para>
- SSH servers exist in some QEMU images.
- The <filename>core-image-sato</filename> QEMU image has a
- Dropbear secure shell (SSH) server that runs with the root
- password disabled.
- The <filename>core-image-full-cmdline</filename> and
- <filename>core-image-lsb</filename> QEMU images
- have OpenSSH instead of Dropbear.
- Including these SSH servers allow you to use standard
- <filename>ssh</filename> and <filename>scp</filename> commands.
- The <filename>core-image-minimal</filename> QEMU image,
- however, contains no SSH server.
- </para></listitem>
- <listitem><para>You can use a provided, user-space NFS server to boot the QEMU session
- using a local copy of the root filesystem on the host.
- In order to make this connection, you must extract a root filesystem tarball by using the
- <filename>runqemu-extract-sdk</filename> command.
- After running the command, you must then point the <filename>runqemu</filename>
- script to the extracted directory instead of a root filesystem image file.</para></listitem>
- </itemizedlist>
- </note>
-</section>
+-->
</chapter>
<!--
vim: expandtab tw=80 ts=4
diff --git a/import-layers/yocto-poky/documentation/dev-manual/dev-manual.xml b/import-layers/yocto-poky/documentation/dev-manual/dev-manual.xml
index 26ee974..ed8011d 100644
--- a/import-layers/yocto-poky/documentation/dev-manual/dev-manual.xml
+++ b/import-layers/yocto-poky/documentation/dev-manual/dev-manual.xml
@@ -17,14 +17,14 @@
</mediaobject>
<title>
- Yocto Project Development Manual
+ Yocto Project Development Tasks Manual
</title>
<authorgroup>
<author>
<firstname>Scott</firstname> <surname>Rifenbark</surname>
<affiliation>
- <orgname>Intel Corporation</orgname>
+ <orgname>Scotty's Documentation Services, INC</orgname>
</affiliation>
<email>srifenbark@gmail.com</email>
</author>
@@ -97,24 +97,19 @@
<revremark>Released with the Yocto Project 2.3 Release.</revremark>
</revision>
<revision>
- <revnumber>2.3.1</revnumber>
- <date>June 2017</date>
- <revremark>Released with the Yocto Project 2.3.1 Release.</revremark>
+ <revnumber>2.4</revnumber>
+ <date>October 2017</date>
+ <revremark>Released with the Yocto Project 2.4 Release.</revremark>
</revision>
<revision>
- <revnumber>2.3.2</revnumber>
- <date>September 2017</date>
- <revremark>Released with the Yocto Project 2.3.2 Release.</revremark>
- </revision>
- <revision>
- <revnumber>2.3.3</revnumber>
+ <revnumber>2.4.1</revnumber>
<date>January 2018</date>
- <revremark>Released with the Yocto Project 2.3.3 Release.</revremark>
+ <revremark>Released with the Yocto Project 2.4.1 Release.</revremark>
</revision>
<revision>
- <revnumber>2.3.4</revnumber>
- <date>April 2018</date>
- <revremark>Released with the Yocto Project 2.3.4 Release.</revremark>
+ <revnumber>2.4.2</revnumber>
+ <date>March 2018</date>
+ <revremark>Released with the Yocto Project 2.4.2 Release.</revremark>
</revision>
</revhistory>
@@ -130,33 +125,34 @@
Creative Commons Attribution-Share Alike 2.0 UK: England & Wales</ulink> as published by
Creative Commons.
</para>
-
- <note><title>Manual Notes</title>
- <itemizedlist>
- <listitem><para>
- For the latest version of the Yocto Project Development
- Manual associated with this Yocto Project release
- (version &YOCTO_DOC_VERSION;),
- see the Yocto Project Development Manual from the
- <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>.
+ <note><title>Manual Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ This version of the
+ <emphasis>Yocto Project Development Tasks Manual</emphasis>
+ is for the &YOCTO_DOC_VERSION; release of the
+ Yocto Project.
+ To be sure you have the latest version of the manual
+ for this release, use the manual from the
+ <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>.
+ </para></listitem>
+ <listitem><para>
+ For manuals associated with other releases of the Yocto
+ Project, go to the
+ <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>
+ and use the drop-down "Active Releases" button
+ and choose the manual associated with the desired
+ Yocto Project.
+ </para></listitem>
+ <listitem><para>
+ To report any inaccuracies or problems with this
+ manual, send an email to the Yocto Project
+ discussion group at
+ <filename>yocto@yoctoproject.com</filename> or log into
+ the freenode <filename>#yocto</filename> channel.
</para></listitem>
- <listitem><para>
- This version of the manual is version
- &YOCTO_DOC_VERSION;.
- For later releases of the Yocto Project (if they exist),
- go to the
- <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>
- and use the drop-down "Active Releases" button
- and choose the Yocto Project version for which you want
- the manual.
- </para></listitem>
- <listitem><para>
- For an in-development version of the Yocto Project
- Development Manual, see
- <ulink url='&YOCTO_DOCS_URL;/latest/dev-manual/dev-manual.html'></ulink>.
- </para></listitem>
- </itemizedlist>
- </note>
+ </itemizedlist>
+ </note>
</legalnotice>
</bookinfo>
@@ -167,8 +163,6 @@
<xi:include href="dev-manual-newbie.xml"/>
- <xi:include href="dev-manual-model.xml"/>
-
<xi:include href="dev-manual-common-tasks.xml"/>
<xi:include href="dev-manual-qemu.xml"/>
diff --git a/import-layers/yocto-poky/documentation/dev-manual/figures/bitbake-build-flow.png b/import-layers/yocto-poky/documentation/dev-manual/figures/bitbake-build-flow.png
new file mode 100644
index 0000000..108265a
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/dev-manual/figures/bitbake-build-flow.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/dev-manual/figures/bsp-dev-flow.png b/import-layers/yocto-poky/documentation/dev-manual/figures/bsp-dev-flow.png
deleted file mode 100644
index 540b0ab..0000000
--- a/import-layers/yocto-poky/documentation/dev-manual/figures/bsp-dev-flow.png
+++ /dev/null
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/dev-manual/figures/dev-title.png b/import-layers/yocto-poky/documentation/dev-manual/figures/dev-title.png
index d3cac4a..15e67d0 100644
--- a/import-layers/yocto-poky/documentation/dev-manual/figures/dev-title.png
+++ b/import-layers/yocto-poky/documentation/dev-manual/figures/dev-title.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/dev-manual/figures/devtool-add-flow.png b/import-layers/yocto-poky/documentation/dev-manual/figures/devtool-add-flow.png
deleted file mode 100644
index 985ac33..0000000
--- a/import-layers/yocto-poky/documentation/dev-manual/figures/devtool-add-flow.png
+++ /dev/null
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/dev-manual/figures/devtool-modify-flow.png b/import-layers/yocto-poky/documentation/dev-manual/figures/devtool-modify-flow.png
deleted file mode 100644
index fd684ff..0000000
--- a/import-layers/yocto-poky/documentation/dev-manual/figures/devtool-modify-flow.png
+++ /dev/null
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/dev-manual/figures/devtool-upgrade-flow.png b/import-layers/yocto-poky/documentation/dev-manual/figures/devtool-upgrade-flow.png
deleted file mode 100644
index 65474da..0000000
--- a/import-layers/yocto-poky/documentation/dev-manual/figures/devtool-upgrade-flow.png
+++ /dev/null
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/dev-manual/figures/git-workflow.png b/import-layers/yocto-poky/documentation/dev-manual/figures/git-workflow.png
deleted file mode 100644
index e401330..0000000
--- a/import-layers/yocto-poky/documentation/dev-manual/figures/git-workflow.png
+++ /dev/null
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/dev-manual/figures/index-downloads.png b/import-layers/yocto-poky/documentation/dev-manual/figures/index-downloads.png
deleted file mode 100644
index 41251d5..0000000
--- a/import-layers/yocto-poky/documentation/dev-manual/figures/index-downloads.png
+++ /dev/null
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/dev-manual/figures/kernel-dev-flow.png b/import-layers/yocto-poky/documentation/dev-manual/figures/kernel-dev-flow.png
deleted file mode 100644
index 009105d..0000000
--- a/import-layers/yocto-poky/documentation/dev-manual/figures/kernel-dev-flow.png
+++ /dev/null
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/dev-manual/figures/kernel-overview-1.png b/import-layers/yocto-poky/documentation/dev-manual/figures/kernel-overview-1.png
deleted file mode 100644
index 116c0b9..0000000
--- a/import-layers/yocto-poky/documentation/dev-manual/figures/kernel-overview-1.png
+++ /dev/null
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/dev-manual/figures/kernel-overview-2-generic.png b/import-layers/yocto-poky/documentation/dev-manual/figures/kernel-overview-2-generic.png
deleted file mode 100644
index cb970ea..0000000
--- a/import-layers/yocto-poky/documentation/dev-manual/figures/kernel-overview-2-generic.png
+++ /dev/null
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/dev-manual/figures/source-repos.png b/import-layers/yocto-poky/documentation/dev-manual/figures/source-repos.png
deleted file mode 100644
index 65c5f29..0000000
--- a/import-layers/yocto-poky/documentation/dev-manual/figures/source-repos.png
+++ /dev/null
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/dev-manual/figures/yp-download.png b/import-layers/yocto-poky/documentation/dev-manual/figures/yp-download.png
deleted file mode 100644
index 5770be6..0000000
--- a/import-layers/yocto-poky/documentation/dev-manual/figures/yp-download.png
+++ /dev/null
Binary files differ