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

dev-manual: First draft of recipetool section.

(From yocto-docs rev: 3220f98c756291d95da0d9d7cff4aa09e8670ff2)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Scott Rifenbark
2015-01-29 16:58:08 -08:00
committed by Richard Purdie
parent b2a68067f5
commit 5d19f2bf27
@@ -1213,40 +1213,154 @@
</para> </para>
</section> </section>
<section id='new-recipe-locate-a-base-recipe'> <section id='new-recipe-locate-or-automatically-create-a-base-recipe'>
<title>Locate a Base Recipe</title> <title>Locate or Automatically Create a Base Recipe</title>
<para> <para>
Before writing a recipe from scratch, it is often useful to You can always write a recipe from scratch.
discover whether someone else has already written one that However, two choices exist that can help you quickly get a
meets (or comes close to meeting) your needs. start on a new recipe:
The Yocto Project and OpenEmbedded communities maintain many <itemizedlist>
recipes that might be candidates for what you are doing. <listitem><para><emphasis><filename>recipetool</filename>:</emphasis>
You can find a good central index of these recipes in the A tool provided by the Yocto Project that automates
<ulink url='http://layers.openembedded.org'>OpenEmbedded metadata index</ulink>. creation of a base recipe based on the source
files.
</para></listitem>
<listitem><para><emphasis>Existing Recipes:</emphasis>
Location and modification of an existing recipe that is
similar in function to the recipe you need.
</para></listitem>
</itemizedlist>
</para> </para>
<para> <section id='new-recipe-creating-the-base-recipe-using-recipetool'>
Working from an existing recipe or a skeleton recipe is the <title>Creating the Base Recipe Using <filename>recipetool</filename></title>
best way to get started.
Here are some points on both methods: <para>
<itemizedlist> <filename>recipetool</filename> automates creation of
<listitem><para><emphasis>Locate and modify a recipe that a base recipe given a set of source code files.
is close to what you want to do:</emphasis> As long as you can extract or point to the source files,
This method works when you are familiar with the the tool will construct a recipe and automatically
current recipe space. configure all pre-build information into the recipe.
The method does not work so well for those new to For example, suppose you have an application that builds
the Yocto Project or writing recipes.</para> using Autotools.
<para>Some risks associated with this method are Creating the base recipe using
using a recipe that has areas totally unrelated to <filename>recipetool</filename> results in a recipe
what you are trying to accomplish with your recipe, that has the pre-build dependencies, license requirements,
not recognizing areas of the recipe that you might and checksums configured.
have to add from scratch, and so forth. </para>
All these risks stem from unfamiliarity with the
existing recipe space.</para></listitem> <para>
<listitem><para><emphasis>Use and modify the following To run the tool, you just need to be in your
skeleton recipe:</emphasis> <link linkend='build-directory'>Build Directory</link>
<literallayout class='monospaced'> 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>).
Here is the basic <filename>recipetool</filename> syntax:
<literallayout class='monospaced'>
recipetool -h
recipetool create [-h]
recipetool [-d] [-q] [--color auto | always | never ] create [-o <replaceable>OUTFILE</replaceable>] [-m] [-x <replaceable>EXTERNALSRC</replaceable>] <replaceable>source</replaceable>
-d Enables debug output.
-q Outputs only errors (quiet mode).
--color Colorizes the output automatically, always, or never.
-h Displays Python generated syntax for recipetool.
create Causes recipetool to create a base recipe. The create
command is further defined with these options:
-o <replaceable>OUTFILE</replaceable> Specifies the full path and filename for the generated
recipe.
-m Causes the recipe to be machine-specific rather than
architecture-specific (default).
-x <replaceable>EXTERNALSRC</replaceable> Fetches and extracts source files from <replaceable>source</replaceable>
and places them in <replaceable>EXTERNALSRC</replaceable>.
<replaceable>source</replaceable> must be a URL.
-h Displays Python-generated syntax for create.
<replaceable>source</replaceable> Specifies the source code on which to base the
recipe.
</literallayout>
</para>
<para>
Running <filename>recipetool</filename> creates the base
recipe and locates it properly in the layer that contains
your source files.
Following are some syntax examples:
</para>
<para>
Use this syntax to generate a recipe based on <replaceable>source</replaceable>.
Once generated, the recipe resides in the existing source
code layer:
<literallayout class='monospaced'>
recipetool create <replaceable>source</replaceable>
</literallayout>
Use this syntax to generate a recipe using code that you
extract from <replaceable>source</replaceable>.
The extracted code is placed in its own layer defined
by <replaceable>EXTERNALSRC</replaceable>.
<literallayout class='monospaced'>
recipetool create -x <replaceable>EXTERNALSRC</replaceable> <replaceable>source</replaceable>
</literallayout>
Use this syntax to generate a recipe and override the
tool's default placement of the recipe by specifying both
its location and name using <replaceable>OUTFILE</replaceable>.
<literallayout class='monospaced'>
recipetool create -o <replaceable>OUTFILE</replaceable> <replaceable>source</replaceable>
</literallayout>
Use this syntax to generate a recipe based on <replaceable>source</replaceable>.
The options direct <filename>recipetool</filename> to
run in "quiet mode" and to generate debugging information.
Once generated, the recipe resides in the existing source
code layer:
<literallayout class='monospaced'>
recipetool create -o <replaceable>OUTFILE</replaceable> <replaceable>source</replaceable>
</literallayout>
</para>
</section>
<section id='new-recipe-locating-and-using-a-similar-recipe'>
<title>Locating and Using a Similar Recipe</title>
<para>
Before writing a recipe from scratch, it is often useful to
discover whether someone else has already written one that
meets (or comes close to meeting) your needs.
The Yocto Project and OpenEmbedded communities maintain many
recipes that might be candidates for what you are doing.
You can find a good central index of these recipes in the
<ulink url='http://layers.openembedded.org'>OpenEmbedded metadata index</ulink>.
</para>
<para>
Working from an existing recipe or a skeleton recipe is the
best way to get started.
Here are some points on both methods:
<itemizedlist>
<listitem><para><emphasis>Locate and modify a recipe that
is close to what you want to do:</emphasis>
This method works when you are familiar with the
current recipe space.
The method does not work so well for those new to
the Yocto Project or writing recipes.</para>
<para>Some risks associated with this method are
using a recipe that has areas totally unrelated to
what you are trying to accomplish with your recipe,
not recognizing areas of the recipe that you might
have to add from scratch, and so forth.
All these risks stem from unfamiliarity with the
existing recipe space.</para></listitem>
<listitem><para><emphasis>Use and modify the following
skeleton recipe:</emphasis>
If for some reason you do not want to use
<filename>recipetool</filename> and you cannot
find an existing recipe that is close to meeting
your needs, you can use the following structure to
provide the fundamental areas of a new recipe.
<literallayout class='monospaced'>
DESCRIPTION = "" DESCRIPTION = ""
HOMEPAGE = "" HOMEPAGE = ""
LICENSE = "" LICENSE = ""
@@ -1255,14 +1369,11 @@
LIC_FILES_CHKSUM = "" LIC_FILES_CHKSUM = ""
SRC_URI = "" SRC_URI = ""
</literallayout> </literallayout>
Modifying this recipe is the recommended method for </para></listitem>
creating a new recipe. </itemizedlist>
The recipe provides the fundamental areas that you need </para>
to include, exclude, or alter to fit your needs. </section>
</para></listitem>
</itemizedlist>
</para>
</section> </section>
<section id='new-recipe-storing-and-naming-the-recipe'> <section id='new-recipe-storing-and-naming-the-recipe'>