dev-manual: Re-ordered sections for customizing an image.
The four sub-sections describing how to customize an image seemed to be backwards as they progressed from most complex to easiest. I switched up the order and provided better transitional introductory wording for the four sub-sections. Reported-by: Robert P. J. Day <rpjday@crashcourse.ca> (From yocto-docs rev: ebce74fde98fb3d3b74ed476288e482e87c83461) Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
f977932cca
commit
18c59735d7
|
@ -887,105 +887,68 @@
|
||||||
This section describes several methods and provides guidelines for each.
|
This section describes several methods and provides guidelines for each.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<section id='usingpoky-extend-customimage-custombb'>
|
<section id='usingpoky-extend-customimage-localconf'>
|
||||||
<title>Customizing Images Using Custom .bb Files</title>
|
<title>Customizing Images Using <filename>local.conf</filename></title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
One way to customize an image is to create a custom recipe
|
Probably the easiest way to customize an image is to add a
|
||||||
that defines additional software as part of the image.
|
package by way of the <filename>local.conf</filename>
|
||||||
The following example shows the form for the two lines you need:
|
configuration file.
|
||||||
<literallayout class='monospaced'>
|
Because it is limited to local use, this method generally only
|
||||||
IMAGE_INSTALL = "packagegroup-core-x11-base package1 package2"
|
allows you to add packages and is not as flexible as creating
|
||||||
|
your own customized image.
|
||||||
inherit core-image
|
When you add packages using local variables this way, you need
|
||||||
</literallayout>
|
to realize that these variable changes affect all images at
|
||||||
|
the same time and might not be what you require.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Defining the software using a custom recipe gives you total
|
To add a package to your image using the local configuration
|
||||||
control over the contents of the image.
|
file, use the
|
||||||
It is important to use the correct names of packages in the
|
|
||||||
<filename><ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_INSTALL'>IMAGE_INSTALL</ulink></filename>
|
<filename><ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_INSTALL'>IMAGE_INSTALL</ulink></filename>
|
||||||
|
variable with the <filename>_append</filename> operator:
|
||||||
|
<literallayout class='monospaced'>
|
||||||
|
IMAGE_INSTALL_append = " strace"
|
||||||
|
</literallayout>
|
||||||
|
Use of the syntax is important - specifically, the space between
|
||||||
|
the quote and the package name, which is
|
||||||
|
<filename>strace</filename> in this example.
|
||||||
|
This space is required since the <filename>_append</filename>
|
||||||
|
operator does not add the space.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Furthermore, you must use <filename>_append</filename> instead
|
||||||
|
of the <filename>+=</filename> operator if you want to avoid
|
||||||
|
ordering issues.
|
||||||
|
The reason for this is because doing so unconditionally appends
|
||||||
|
to the variable and avoids ordering problems due to the
|
||||||
|
variable being set in image recipes and
|
||||||
|
<filename>.bbclass</filename> files with operators like
|
||||||
|
<filename>?=</filename>.
|
||||||
|
Using <filename>_append</filename> ensures the operation takes
|
||||||
|
affect.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
As shown in its simplest use,
|
||||||
|
<filename>IMAGE_INSTALL_append</filename> affects all images.
|
||||||
|
It is possible to extend the syntax so that the variable
|
||||||
|
applies to a specific image only.
|
||||||
|
Here is an example:
|
||||||
|
<literallayout class='monospaced'>
|
||||||
|
IMAGE_INSTALL_append_pn-core-image-minimal = " strace"
|
||||||
|
</literallayout>
|
||||||
|
This example adds <filename>strace</filename> to
|
||||||
|
<filename>core-image-minimal</filename> only.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
You can add packages using a similar approach through the
|
||||||
|
<filename><ulink url='&YOCTO_DOCS_REF_URL;#var-CORE_IMAGE_EXTRA_INSTALL'>CORE_IMAGE_EXTRA_INSTALL</ulink></filename>
|
||||||
variable.
|
variable.
|
||||||
You must use the OpenEmbedded notation and not the Debian notation for the names
|
If you use this variable, only
|
||||||
(e.g. <filename>eglibc-dev</filename> instead of <filename>libc6-dev</filename>).
|
<filename>core-image-*</filename> images are affected.
|
||||||
</para>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
The other method for creating a custom image is to base it on an existing image.
|
|
||||||
For example, if you want to create an image based on <filename>core-image-sato</filename>
|
|
||||||
but add the additional package <filename>strace</filename> to the image,
|
|
||||||
copy the <filename>meta/recipes-sato/images/core-image-sato.bb</filename> to a
|
|
||||||
new <filename>.bb</filename> and add the following line to the end of the copy:
|
|
||||||
<literallayout class='monospaced'>
|
|
||||||
IMAGE_INSTALL += "strace"
|
|
||||||
</literallayout>
|
|
||||||
</para>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section id='usingpoky-extend-customimage-customtasks'>
|
|
||||||
<title>Customizing Images Using Custom Package Groups</title>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
For complex custom images, the best approach is to create a
|
|
||||||
custom package group recipe that is used to build the image or
|
|
||||||
images.
|
|
||||||
A good example of a package group recipe is
|
|
||||||
<filename>meta/recipes-core/packagegroups/packagegroup-core-boot.bb</filename>.
|
|
||||||
The
|
|
||||||
<filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGES'>PACKAGES</ulink></filename>
|
|
||||||
variable lists the package group packages you wish to produce.
|
|
||||||
<filename>inherit packagegroup</filename> sets appropriate
|
|
||||||
default values and automatically adds <filename>-dev</filename>,
|
|
||||||
<filename>-dbg</filename>, and <filename>-ptest</filename>
|
|
||||||
complementary packages for every package specified in
|
|
||||||
<filename>PACKAGES</filename>.
|
|
||||||
Note that the inherit line should be towards
|
|
||||||
the top of the recipe, certainly before you set
|
|
||||||
<filename>PACKAGES</filename>.
|
|
||||||
For each package you specify in <filename>PACKAGES</filename>,
|
|
||||||
you can use
|
|
||||||
<filename><ulink url='&YOCTO_DOCS_REF_URL;#var-RDEPENDS'>RDEPENDS</ulink></filename>
|
|
||||||
and
|
|
||||||
<filename><ulink url='&YOCTO_DOCS_REF_URL;#var-RRECOMMENDS'>RRECOMMENDS</ulink></filename>
|
|
||||||
entries to provide a list of packages the parent task package
|
|
||||||
should contain.
|
|
||||||
Following is an example:
|
|
||||||
<literallayout class='monospaced'>
|
|
||||||
DESCRIPTION = "My Custom Package Groups"
|
|
||||||
|
|
||||||
inherit packagegroup
|
|
||||||
|
|
||||||
PACKAGES = "\
|
|
||||||
packagegroup-custom-apps \
|
|
||||||
packagegroup-custom-tools \
|
|
||||||
"
|
|
||||||
|
|
||||||
RDEPENDS_packagegroup-custom-apps = "\
|
|
||||||
dropbear \
|
|
||||||
portmap \
|
|
||||||
psplash"
|
|
||||||
|
|
||||||
RDEPENDS_packagegroup-custom-tools = "\
|
|
||||||
oprofile \
|
|
||||||
oprofileui-server \
|
|
||||||
lttng-control \
|
|
||||||
lttng-viewer"
|
|
||||||
|
|
||||||
RRECOMMENDS_packagegroup-custom-tools = "\
|
|
||||||
kernel-module-oprofile"
|
|
||||||
</literallayout>
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
In the previous example, two package group packages are created with their dependencies and their
|
|
||||||
recommended package dependencies listed: <filename>packagegroup-custom-apps</filename>, and
|
|
||||||
<filename>packagegroup-custom-tools</filename>.
|
|
||||||
To build an image using these package group packages, you need to add
|
|
||||||
<filename>packagegroup-custom-apps</filename> and/or
|
|
||||||
<filename>packagegroup-custom-tools</filename> to
|
|
||||||
<filename><ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_INSTALL'>IMAGE_INSTALL</ulink></filename>.
|
|
||||||
For other forms of image dependencies see the other areas of this section.
|
|
||||||
</para>
|
</para>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
@ -994,8 +957,8 @@
|
||||||
<filename>EXTRA_IMAGE_FEATURES</filename></title>
|
<filename>EXTRA_IMAGE_FEATURES</filename></title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
You might want to customize your image by enabling or
|
Another method for customizing your image is to enable or
|
||||||
disabling high-level image features by using the
|
disable high-level image features by using the
|
||||||
<ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></ulink>
|
<ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></ulink>
|
||||||
and <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_IMAGE_FEATURES'><filename>EXTRA_IMAGE_FEATURES</filename></ulink>
|
and <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_IMAGE_FEATURES'><filename>EXTRA_IMAGE_FEATURES</filename></ulink>
|
||||||
variables.
|
variables.
|
||||||
|
@ -1070,59 +1033,105 @@
|
||||||
</note>
|
</note>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section id='usingpoky-extend-customimage-localconf'>
|
<section id='usingpoky-extend-customimage-custombb'>
|
||||||
<title>Customizing Images Using <filename>local.conf</filename></title>
|
<title>Customizing Images Using Custom .bb Files</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
It is possible to customize image contents by using variables from your
|
You can also customize an image by creating a custom recipe
|
||||||
local configuration in your <filename>conf/local.conf</filename> file.
|
that defines additional software as part of the image.
|
||||||
Because it is limited to local use, this method generally only allows you to
|
The following example shows the form for the two lines you need:
|
||||||
add packages and is not as flexible as creating your own customized image.
|
<literallayout class='monospaced'>
|
||||||
When you add packages using local variables this way, you need to realize that
|
IMAGE_INSTALL = "packagegroup-core-x11-base package1 package2"
|
||||||
these variable changes affect all images at the same time and might not be
|
|
||||||
what you require.
|
inherit core-image
|
||||||
|
</literallayout>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
The simplest way to add extra packages to all images is by using the
|
Defining the software using a custom recipe gives you total
|
||||||
|
control over the contents of the image.
|
||||||
|
It is important to use the correct names of packages in the
|
||||||
<filename><ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_INSTALL'>IMAGE_INSTALL</ulink></filename>
|
<filename><ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_INSTALL'>IMAGE_INSTALL</ulink></filename>
|
||||||
variable with the <filename>_append</filename> operator:
|
|
||||||
<literallayout class='monospaced'>
|
|
||||||
IMAGE_INSTALL_append = " strace"
|
|
||||||
</literallayout>
|
|
||||||
Use of the syntax is important - specifically, the space between
|
|
||||||
the quote and the package name, which is
|
|
||||||
<filename>strace</filename> in this example.
|
|
||||||
This space is required since the <filename>_append</filename>
|
|
||||||
operator does not add the space.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
Furthermore, you must use <filename>_append</filename> instead of the <filename>+=</filename>
|
|
||||||
operator if you want to avoid ordering issues.
|
|
||||||
The reason for this is because doing so unconditionally appends to the variable and
|
|
||||||
avoids ordering problems due to the variable being set in image recipes and
|
|
||||||
<filename>.bbclass</filename> files with operators like <filename>?=</filename>.
|
|
||||||
Using <filename>_append</filename> ensures the operation takes affect.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
As shown in its simplest use, <filename>IMAGE_INSTALL_append</filename> affects
|
|
||||||
all images.
|
|
||||||
It is possible to extend the syntax so that the variable applies to a specific image only.
|
|
||||||
Here is an example:
|
|
||||||
<literallayout class='monospaced'>
|
|
||||||
IMAGE_INSTALL_append_pn-core-image-minimal = " strace"
|
|
||||||
</literallayout>
|
|
||||||
This example adds <filename>strace</filename> to <filename>core-image-minimal</filename>
|
|
||||||
only.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
You can add packages using a similar approach through the
|
|
||||||
<filename><ulink url='&YOCTO_DOCS_REF_URL;#var-CORE_IMAGE_EXTRA_INSTALL'>CORE_IMAGE_EXTRA_INSTALL</ulink></filename>
|
|
||||||
variable.
|
variable.
|
||||||
If you use this variable, only <filename>core-image-*</filename> images are affected.
|
You must use the OpenEmbedded notation and not the Debian notation for the names
|
||||||
|
(e.g. <filename>eglibc-dev</filename> instead of <filename>libc6-dev</filename>).
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
The other method for creating a custom image is to base it on an existing image.
|
||||||
|
For example, if you want to create an image based on <filename>core-image-sato</filename>
|
||||||
|
but add the additional package <filename>strace</filename> to the image,
|
||||||
|
copy the <filename>meta/recipes-sato/images/core-image-sato.bb</filename> to a
|
||||||
|
new <filename>.bb</filename> and add the following line to the end of the copy:
|
||||||
|
<literallayout class='monospaced'>
|
||||||
|
IMAGE_INSTALL += "strace"
|
||||||
|
</literallayout>
|
||||||
|
</para>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section id='usingpoky-extend-customimage-customtasks'>
|
||||||
|
<title>Customizing Images Using Custom Package Groups</title>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
For complex custom images, the best approach for customizing
|
||||||
|
an image is to create a custom package group recipe that is
|
||||||
|
used to build the image or images.
|
||||||
|
A good example of a package group recipe is
|
||||||
|
<filename>meta/recipes-core/packagegroups/packagegroup-core-boot.bb</filename>.
|
||||||
|
The
|
||||||
|
<filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGES'>PACKAGES</ulink></filename>
|
||||||
|
variable lists the package group packages you wish to produce.
|
||||||
|
<filename>inherit packagegroup</filename> sets appropriate
|
||||||
|
default values and automatically adds <filename>-dev</filename>,
|
||||||
|
<filename>-dbg</filename>, and <filename>-ptest</filename>
|
||||||
|
complementary packages for every package specified in
|
||||||
|
<filename>PACKAGES</filename>.
|
||||||
|
Note that the inherit line should be towards
|
||||||
|
the top of the recipe, certainly before you set
|
||||||
|
<filename>PACKAGES</filename>.
|
||||||
|
For each package you specify in <filename>PACKAGES</filename>,
|
||||||
|
you can use
|
||||||
|
<filename><ulink url='&YOCTO_DOCS_REF_URL;#var-RDEPENDS'>RDEPENDS</ulink></filename>
|
||||||
|
and
|
||||||
|
<filename><ulink url='&YOCTO_DOCS_REF_URL;#var-RRECOMMENDS'>RRECOMMENDS</ulink></filename>
|
||||||
|
entries to provide a list of packages the parent task package
|
||||||
|
should contain.
|
||||||
|
Following is an example:
|
||||||
|
<literallayout class='monospaced'>
|
||||||
|
DESCRIPTION = "My Custom Package Groups"
|
||||||
|
|
||||||
|
inherit packagegroup
|
||||||
|
|
||||||
|
PACKAGES = "\
|
||||||
|
packagegroup-custom-apps \
|
||||||
|
packagegroup-custom-tools \
|
||||||
|
"
|
||||||
|
|
||||||
|
RDEPENDS_packagegroup-custom-apps = "\
|
||||||
|
dropbear \
|
||||||
|
portmap \
|
||||||
|
psplash"
|
||||||
|
|
||||||
|
RDEPENDS_packagegroup-custom-tools = "\
|
||||||
|
oprofile \
|
||||||
|
oprofileui-server \
|
||||||
|
lttng-control \
|
||||||
|
lttng-viewer"
|
||||||
|
|
||||||
|
RRECOMMENDS_packagegroup-custom-tools = "\
|
||||||
|
kernel-module-oprofile"
|
||||||
|
</literallayout>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
In the previous example, two package group packages are created with their dependencies and their
|
||||||
|
recommended package dependencies listed: <filename>packagegroup-custom-apps</filename>, and
|
||||||
|
<filename>packagegroup-custom-tools</filename>.
|
||||||
|
To build an image using these package group packages, you need to add
|
||||||
|
<filename>packagegroup-custom-apps</filename> and/or
|
||||||
|
<filename>packagegroup-custom-tools</filename> to
|
||||||
|
<filename><ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_INSTALL'>IMAGE_INSTALL</ulink></filename>.
|
||||||
|
For other forms of image dependencies see the other areas of this section.
|
||||||
</para>
|
</para>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
|
|
Loading…
Reference in New Issue