dev-manual: Applied review comments to poky-tiny section

Fixes YOCTO #2568

Applied Darren's review comments where I could for his
review.  Not all questions are answered but this represents
the third draft of the section.

(From yocto-docs rev: da0bc9542259238caf7b474bb15157d80a2b3651)

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-22 13:44:47 -07:00 committed by Richard Purdie
parent de4f0d1ded
commit 30a806dcbd
1 changed files with 32 additions and 22 deletions

View File

@ -2197,12 +2197,13 @@
<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 or in-package memory (cheaper), better
through efficient cache usage, lower power requirements due to less performance through efficient cache usage, lower power requirements
memory, faster boot times, and reduced development overhead. due to less 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. and small headless systems.
</para> </para>
<para> <para>
@ -2217,10 +2218,9 @@
<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 distributions with smaller
have a kernel and root filesystem under 4 Mbytes, boot to the filesystems, faster boot times, maintain your critical
shell in under two seconds, maintain <filename>ipv4</filename> functionality, and avoid initial RAM disks:
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>
@ -2254,7 +2254,7 @@
</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 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.
@ -2290,11 +2290,10 @@
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 allocated 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 and also includes the <filename>__init__</filename>
Temporary memory also includes the <filename>__init__</filename>
functions. functions.
</para> </para>
@ -2305,9 +2304,9 @@
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
the size of the kernel files.</para></listitem> component sizes for the kernel files.</para></listitem>
<listitem><para><filename>dirsize.py</filename>: Reports <listitem><para><filename>dirsize.py</filename>: Reports
the size of the root filesystem.</para></listitem> component sizes for 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:
@ -2332,12 +2331,12 @@
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 &lt;bitbake_target&gt;</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 informed decisions when cutting out various pieces of the
kernel and root filesystem.</para></listitem> kernel and root filesystem.</para></listitem>
</itemizedlist> </itemizedlist>
</para> </para>
@ -2357,7 +2356,7 @@
<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.py</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;
$ dirsize.py 100000 > dirsize-100k.log $ dirsize.py 100000 > dirsize-100k.log
@ -2366,6 +2365,9 @@
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.
The sizes reported by the tool are uncompressed and thus,
will be smaller by a relatively constant factor in a
compressed root filesystem.
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.
</para> </para>
@ -2388,7 +2390,8 @@
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> instead of
<filename>udev</filename>.
</para> </para>
<para> <para>
@ -2402,10 +2405,14 @@
</para> </para>
<para> <para>
Some other examples of where you can look to eliminate size Finally, you should consider exactly what filesystem you need
from the root filesystem are using <filename>ext2</filename> to meet your needs while also reducing size.
rather than <filename>ext3</filename>, which requires a For example, consider <filename>cramfs</filename>,
1 Mbyte journal. <filename>squashfs</filename>, <filename>ubifs</filename>,
<filename>ext2</filename>, or an <filename>initramfs</filename>
using <filename>initramfs</filename>.
Be aware that <filename>ext3</filename> requires a 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>
@ -2446,6 +2453,9 @@
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.
The sizes reported by the tool are uncompressed and thus,
will be smaller by a relatively constant factor in a compressed
kernel image.
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>