dev-manual: Reword for when to use BBMASK.

Changed the wording on when a user would consider using
the BBMASK variable.  It is more suited for excluding things
that cause problems rather than for speeding up build time.

Reporte-by: Paul Eggleton <paul.eggleton@linux.com>
(From yocto-docs rev: 993d7c953a37747297238cd9af53a1f00e737df9)

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 2013-03-21 06:47:31 -07:00 committed by Richard Purdie
parent 9114dfcbe8
commit 33f2c1a0ae
1 changed files with 87 additions and 85 deletions

View File

@ -2132,18 +2132,18 @@
<para> <para>
Very small distributions have some significant advantages such Very small distributions have some significant advantages such
as requiring less on-die memory (cheaper), better performance as requiring less on-die memory (cheaper), better performance
through efficient cache usage, lower power requirements due to less through efficient cache usage, lower power requirements due to less
memory, faster boot times, and reduced development overhead. memory, faster boot times, and reduced development overhead.
Some real-world examples where a very small distribution gives Some real-world examples where a very small distribution gives
you distinct advantages are digital cameras, medical devices, you distinct advantages are digital cameras, medical devices,
small headless systems, and partitioned flash. small headless systems, and partitioned flash.
</para> </para>
<para> <para>
This section presents information that shows you how you can This section presents information that shows you how you can
trim your distribution to even smaller sizes than the trim your distribution to even smaller sizes than the
8 Mbytes <filename>poky-tiny</filename> distribution that 8 Mbytes <filename>poky-tiny</filename> distribution that
can be built out-of-the-box using the Yocto Project. can be built out-of-the-box using the Yocto Project.
</para> </para>
@ -2151,18 +2151,18 @@
<title>Overview</title> <title>Overview</title>
<para> <para>
The following list presents the overall steps you need to The following list presents the overall steps you need to
consider and perform to create very small systems that consider and perform to create very small systems that
have a kernel and root filesystem under 4 Mbytes, boot to the have a kernel and root filesystem under 4 Mbytes, boot to the
shell in under two seconds, maintain <filename>ipv4</filename> shell in under two seconds, maintain <filename>ipv4</filename>
functionality, and avoid an initial RAM disk: functionality, and avoid an initial RAM disk:
<itemizedlist> <itemizedlist>
<listitem><para>Determine your goals and guiding <listitem><para>Determine your goals and guiding
principles.</para></listitem> principles.</para></listitem>
<listitem><para>Understand what gives your image size. <listitem><para>Understand what gives your image size.
</para></listitem> </para></listitem>
<listitem><para>Reduce the size of the root filesystem. <listitem><para>Reduce the size of the root filesystem.
</para></listitem> </para></listitem>
<listitem><para>Reduce the size of the kernel. <listitem><para>Reduce the size of the kernel.
</para></listitem> </para></listitem>
<listitem><para>Iterate on the process.</para></listitem> <listitem><para>Iterate on the process.</para></listitem>
@ -2174,26 +2174,26 @@
<title>Goals and Guiding Principles</title> <title>Goals and Guiding Principles</title>
<para> <para>
Before you can reach your destination, you need to know Before you can reach your destination, you need to know
where you are going. where you are going.
Here is an example list that you can use as a guide when Here is an example list that you can use as a guide when
creating very small distributions: creating very small distributions:
<itemizedlist> <itemizedlist>
<listitem><para>Determine how much space you need <listitem><para>Determine how much space you need
(e.g. a kernel that is 1 Mbyte or less and (e.g. a kernel that is 1 Mbyte or less and
a root filesystem that is 3 Mbytes or less). a root filesystem that is 3 Mbytes or less).
</para></listitem> </para></listitem>
<listitem><para>Find the areas that are currently <listitem><para>Find the areas that are currently
taking 90% of the space and concentrate on reducing taking 90% of the space and concentrate on reducing
those areas. those areas.
</para></listitem> </para></listitem>
<listitem><para>Do not create any difficult "hacks" <listitem><para>Do not create any difficult "hacks"
to achieve your goals.</para></listitem> to achieve your goals.</para></listitem>
<listitem><para>Leverage off the device-specific <listitem><para>Leverage off the device-specific
options.</para></listitem> options.</para></listitem>
<listitem><para>Work in a separate layer so that you <listitem><para>Work in a separate layer so that you
keep changes isolated. keep changes isolated.
For information on how to create layers, see For information on how to create layers, see
the "<link linkend='understanding-and-creating-layers'>Understanding and Creating Layers</link>" section. the "<link linkend='understanding-and-creating-layers'>Understanding and Creating Layers</link>" section.
</para></listitem> </para></listitem>
</itemizedlist> </itemizedlist>
@ -2204,9 +2204,9 @@
<title>Understand What Gives Your Image Size</title> <title>Understand What Gives Your Image Size</title>
<para> <para>
You will need to have an image from which you can You will need to have an image from which you can
work. work.
The Yocto Project ships with the ability to create a The Yocto Project ships with the ability to create a
<filename>poky-tiny</filename> distribution. <filename>poky-tiny</filename> distribution.
This distribution consists of a small, sub-8 Mbyte kernel This distribution consists of a small, sub-8 Mbyte kernel
that works with two shipped Board Support Packages (BSPs): that works with two shipped Board Support Packages (BSPs):
@ -2218,16 +2218,16 @@
"<link linkend='creating-your-own-distribution'>Creating Your Own Distribution</link>" "<link linkend='creating-your-own-distribution'>Creating Your Own Distribution</link>"
section for information. section for information.
</para> </para>
<para> <para>
Understanding some memory concepts will help you reduce the Understanding some memory concepts will help you reduce the
system size. system size.
Memory consists of static, dynamic, and temporary memory. Memory consists of static, dynamic, and temporary memory.
Static memory is the TEXT (the code), DATA (initialized data Static memory is the TEXT (the code), DATA (initialized data
in the code), and BSS (uninitialized data) sections. in the code), and BSS (uninitialized data) sections.
Dynamic memory contains memory that is allocate at runtime, Dynamic memory contains memory that is allocate at runtime,
stacks, hash tables, and so forth. stacks, hash tables, and so forth.
Temporary memory is decompressed from the expanded kernel Temporary memory is decompressed from the expanded kernel
after boot. after boot.
Temporary memory also includes the <filename>__init__</filename> Temporary memory also includes the <filename>__init__</filename>
functions. functions.
@ -2235,8 +2235,8 @@
<para> <para>
To help you see where you currently are with kernel and root To help you see where you currently are with kernel and root
filesystem sizes, you can use two tools found in the filesystem sizes, you can use two tools found in the
<link linkend='source-directory'>Source Directory</link> in <link linkend='source-directory'>Source Directory</link> in
the <filename>scripts</filename> directory: the <filename>scripts</filename> directory:
<itemizedlist> <itemizedlist>
<listitem><para><filename>ksize.py</filename>: Reports <listitem><para><filename>ksize.py</filename>: Reports
@ -2244,54 +2244,54 @@
<listitem><para><filename>dirsize.py</filename>: Reports <listitem><para><filename>dirsize.py</filename>: Reports
the size of the root filesystem.</para></listitem> the size of the root filesystem.</para></listitem>
</itemizedlist> </itemizedlist>
This next tool and command helps you organize configuration This next tool and command helps you organize configuration
fragments and view file dependencies in a human-readable form: fragments and view file dependencies in a human-readable form:
<itemizedlist> <itemizedlist>
<listitem><para><filename>merge_config.sh</filename>: <listitem><para><filename>merge_config.sh</filename>:
Helps you manage configuration files and fragments Helps you manage configuration files and fragments
within the kernel. within the kernel.
With this tool you can merge individual configuration With this tool you can merge individual configuration
fragments together. fragments together.
The tool allows you to make overrides and warns you The tool allows you to make overrides and warns you
of any missing configuration options. of any missing configuration options.
The tool is ideal for allowing you to iterate on The tool is ideal for allowing you to iterate on
configurations, create minimal configurations, and configurations, create minimal configurations, and
create a configuration files for different machines create a configuration files for different machines
without having to duplicate your process.</para> without having to duplicate your process.</para>
<para>The <filename>merge_config.sh</filename> script is <para>The <filename>merge_config.sh</filename> script is
part of the Linux Yocto kernel Git repository in the part of the Linux Yocto kernel Git repository in the
<filename>scripts/kconfig</filename> directory.</para> <filename>scripts/kconfig</filename> directory.</para>
<para>For more information on configuration fragments, <para>For more information on configuration fragments,
see the see the
"<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#generating-configuration-files'>Generating Configuration Files</ulink>" "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#generating-configuration-files'>Generating Configuration Files</ulink>"
section of the Yocto Project Linux Kernel Development section of the Yocto Project Linux Kernel Development
Manual and the "<link linkend='creating-config-fragments'>Creating Configuration Fragments</link>" Manual and the "<link linkend='creating-config-fragments'>Creating Configuration Fragments</link>"
section, which is in this manual.</para></listitem> section, which is in this manual.</para></listitem>
<listitem><para><filename>bitbake -u depexp -g core-image-*</filename>: <listitem><para><filename>bitbake -u depexp -g core-image-*</filename>:
Using the BitBake command with these options brings up Using the BitBake command with these options brings up
a Dependency Explorer from which you can view file a Dependency Explorer from which you can view file
dependencies. dependencies.
Understanding these dependencies allows you to make Understanding these dependencies allows you to make
sane decisions when cutting out various pieces of the sane decisions when cutting out various pieces of the
kernel and root filesystem.</para></listitem> kernel and root filesystem.</para></listitem>
</itemizedlist> </itemizedlist>
</para> </para>
</section> </section>
<section id='trim-the-root-filesystem'> <section id='trim-the-root-filesystem'>
<title>Trim the Root Filesystem</title> <title>Trim the Root Filesystem</title>
<para> <para>
Root filesystem is made up of packages for booting, libraries, Root filesystem is made up of packages for booting, libraries,
and applications. and applications.
To change things you can configure how the packaging happens, To change things you can configure how the packaging happens,
which changes the way you build them. which changes the way you build them.
You can also tweak the filesystem itself or select a different You can also tweak the filesystem itself or select a different
file system. file system.
</para> </para>
<para> <para>
First, check out what is hogging your file system running the First, check out what is hogging your file system running the
<filename>dirsize.sh</filename> script from your root directory: <filename>dirsize.sh</filename> script from your root directory:
<literallayout class='monospaced'> <literallayout class='monospaced'>
$ cd &lt;root-directory-of-image&gt; $ cd &lt;root-directory-of-image&gt;
@ -2299,7 +2299,7 @@
$ cat dirsize-100k.log $ cat dirsize-100k.log
</literallayout> </literallayout>
You can apply a filter to the script to ignore files under You can apply a filter to the script to ignore files under
a certain size. a certain size.
This example filters out anything below 100 Kbytes. This example filters out anything below 100 Kbytes.
When you examine your log file, you can focus on areas of the When you examine your log file, you can focus on areas of the
root filesystem that take up large amounts of memory. root filesystem that take up large amounts of memory.
@ -2307,20 +2307,20 @@
<para> <para>
You need to be sure that what you eliminate does not cripple You need to be sure that what you eliminate does not cripple
the functionality you need. the functionality you need.
One way to see how packages relate to each other is by using One way to see how packages relate to each other is by using
the Dependency Explorer UI with the BitBake command: the Dependency Explorer UI with the BitBake command:
<literallayout class='monospaced'> <literallayout class='monospaced'>
$ cd &lt;image-directory&gt; $ cd &lt;image-directory&gt;
$ bitbake -u depexp -g &lt;image&gt; $ bitbake -u depexp -g &lt;image&gt;
</literallayout> </literallayout>
Use the interface to select potential packages you wish to Use the interface to select potential packages you wish to
eliminate and see their dependency relationships. eliminate and see their dependency relationships.
</para> </para>
<para> <para>
When deciding how to reduce the size, get rid of packages that When deciding how to reduce the size, get rid of packages that
result in minimal impact on the feature set. result in minimal impact on the feature set.
For example, you might not need a VGA display. For example, you might not need a VGA display.
Or, you might be able to get by with <filename>devtmpfs</filename> Or, you might be able to get by with <filename>devtmpfs</filename>
and <filename>mdev</filename>. and <filename>mdev</filename>.
@ -2328,8 +2328,8 @@
<para> <para>
Use the <filename>local.conf</filename> file to make changes. Use the <filename>local.conf</filename> file to make changes.
For example, to eliminate <filename>udev</filename> and For example, to eliminate <filename>udev</filename> and
<filename>glib</filename>, set the following in the <filename>glib</filename>, set the following in the
local configuration file: local configuration file:
<literallayout class='monospaced'> <literallayout class='monospaced'>
VIRTUAL-RUNTIME_dev_manager = "" VIRTUAL-RUNTIME_dev_manager = ""
@ -2337,21 +2337,21 @@
</para> </para>
<para> <para>
Some other examples of where you can look to eliminate size Some other examples of where you can look to eliminate size
from the root filesystem are using <filename>ext2</filename> from the root filesystem are using <filename>ext2</filename>
rather than <filename>ext3</filename>, which requires a rather than <filename>ext3</filename>, which requires a
1 Mbyte journal. 1 Mbyte journal.
If you are okay with running read-only you don't need this If you are okay with running read-only you don't need this
journal. journal.
</para> </para>
<note> <note>
After each round of elimination, you need to rebuild your After each round of elimination, you need to rebuild your
system and then use the tools to see the effects of your system and then use the tools to see the effects of your
reductions. reductions.
</note> </note>
</section> </section>
<section id='trim-the-kernel'> <section id='trim-the-kernel'>
@ -2370,51 +2370,51 @@
<para> <para>
Run the <filename>ksize.py</filename> script from the top-level Run the <filename>ksize.py</filename> script from the top-level
Linux build directory to get an idea of what is making up Linux build directory to get an idea of what is making up
the kernel: the kernel:
<literallayout class='monospaced'> <literallayout class='monospaced'>
$ cd &lt;top-level-linux-build-directory&gt; $ cd &lt;top-level-linux-build-directory&gt;
$ ksize.py > ksize.log $ ksize.py > ksize.log
$ cat ksize.log $ cat ksize.log
</literallayout> </literallayout>
When you examine the log, you will see how much space is When you examine the log, you will see how much space is
taken up with the built-in <filename>.o</filename> files for taken up with the built-in <filename>.o</filename> files for
drivers, networking, core kernel files, filesystem, sound, drivers, networking, core kernel files, filesystem, sound,
and so forth. and so forth.
Look to reduce the areas that are large and taking up around Look to reduce the areas that are large and taking up around
the "90% rule". the "90% rule".
</para> </para>
<para> <para>
To examine, or drill down, into any particular area, use the To examine, or drill down, into any particular area, use the
<filename>-d</filename> option with the script: <filename>-d</filename> option with the script:
<literallayout class='monospaced'> <literallayout class='monospaced'>
$ ksize.py -d > ksize.log $ ksize.py -d > ksize.log
</literallayout> </literallayout>
Using this option breaks out the individual file information Using this option breaks out the individual file information
for each area of the kernel (e.g. drivers, networking, and for each area of the kernel (e.g. drivers, networking, and
so forth). so forth).
</para> </para>
<para> <para>
Use your log file to see what you can eliminate from the kernel Use your log file to see what you can eliminate from the kernel
based on features you can let go. based on features you can let go.
For example, if you are not going to need sound, you do not For example, if you are not going to need sound, you do not
need any drivers that support sound. need any drivers that support sound.
</para> </para>
<para> <para>
After figuring out what to eliminate, you need to reconfigure After figuring out what to eliminate, you need to reconfigure
kernel to reflect those changes during the next build. kernel to reflect those changes during the next build.
You could run <filename>menuconfig</filename> and make all your You could run <filename>menuconfig</filename> and make all your
changes at once. changes at once.
However, that makes it difficult to see the effects of your However, that makes it difficult to see the effects of your
individual eliminations and also makes it difficult to replicate individual eliminations and also makes it difficult to replicate
the changes for perhaps another target device. the changes for perhaps another target device.
A better method is to start with no configurations using A better method is to start with no configurations using
<filename>allnoconfig</filename>, create configuration <filename>allnoconfig</filename>, create configuration
fragments for individual changes, and then manage the fragments for individual changes, and then manage the
fragments into a single configuration file using fragments into a single configuration file using
<filename>merge_config.sh</filename>. <filename>merge_config.sh</filename>.
The tool makes it easy for you to iterate using the The tool makes it easy for you to iterate using the
configuration change/build cycle. configuration change/build cycle.
@ -2422,7 +2422,7 @@
<para> <para>
Each time you make configuration changes, you need to rebuild Each time you make configuration changes, you need to rebuild
the kernel and check to see what impact your changes had on the kernel and check to see what impact your changes had on
the overall size. the overall size.
</para> </para>
</section> </section>
@ -2432,16 +2432,16 @@
<para> <para>
If you have not reached your goals on system size, you need If you have not reached your goals on system size, you need
to iterate on the process. to iterate on the process.
The process is the same. The process is the same.
Use the tools and see just what is taking up 90% of the root Use the tools and see just what is taking up 90% of the root
filesystem and the kernel. filesystem and the kernel.
Decide what you can eliminate without limiting your device Decide what you can eliminate without limiting your device
beyond what you need. beyond what you need.
</para> </para>
<para> <para>
Depending on your system, a good place to look might be Depending on your system, a good place to look might be
Busybox, which provides a stripped down Busybox, which provides a stripped down
version of Unix tools in a single, executable file. version of Unix tools in a single, executable file.
You might be able to drop virtual terminal services or perhaps You might be able to drop virtual terminal services or perhaps
@ -3004,9 +3004,11 @@
<para> <para>
You might find that there are groups of recipes or append files You might find that there are groups of recipes or append files
that you want to filter out of the build process. that you want to filter out of the build process.
For example, recipes you know you will never use or want should not Usually, this is not necessary.
be part of the build. However, on rare occasions where you might want to use a
Removing these files from parsing speeds up parts of the build. layer but exclude parts that are causing problems, such
as introducing a different version of a recipe, you can
use <filename>BBMASK</filename> to exclude the recipe.
</para> </para>
<para> <para>