It is easiest to have something to start with when creating
your own distribution.
You can use the Yocto Project out-of-the-box to create the
poky-tiny
distribution.
Ultimately, you will want to make changes in your own
distribution that are likely modeled after
poky-tiny
.
poky-tiny
in your build,
set the
DISTRO
variable in your
local.conf
file to "poky-tiny"
as described in the
"Creating Your Own Distribution"
section.
Understanding some memory concepts will help you reduce the
system size.
Memory consists of static, dynamic, and temporary memory.
Static memory is the TEXT (code), DATA (initialized data
in the code), and BSS (uninitialized data) sections.
Dynamic memory contains memory that is allocated at runtime,
stacks, hash tables, and so forth.
Temporary memory is recovered after the boot process.
This memory consists of memory used for decompressing
the kernel and for the __init__
functions.
To help you see where you currently are with kernel and root
filesystem sizes, you can use two tools found in the
Source Directory in
the scripts
directory:
ksize.py
: Reports
component sizes for the kernel build objects.
dirsize.py
: Reports
component sizes for the root filesystem.
This next tool and command helps you organize configuration fragments and view file dependencies in a human-readable form:
merge_config.sh
:
Helps you manage configuration files and fragments
within the kernel.
With this tool, you can merge individual configuration
fragments together.
The tool allows you to make overrides and warns you
of any missing configuration options.
The tool is ideal for allowing you to iterate on
configurations, create minimal configurations, and
create configuration files for different machines
without having to duplicate your process.
The merge_config.sh
script is
part of the Linux Yocto kernel Git repository in the
scripts/kconfig
directory.
For more information on configuration fragments, see the "Generating Configuration Files" section of the Yocto Project Linux Kernel Development Manual and the "Creating Configuration Fragments" section, which is in this manual.
bitbake -u depexp -g <bitbake_target>
:
Using the BitBake command with these options brings up
a Dependency Explorer from which you can view file
dependencies.
Understanding these dependencies allows you to make
informed decisions when cutting out various pieces of the
kernel and root filesystem.