From ac15c28151a89b2dc60b037e8e99214349952c8b Mon Sep 17 00:00:00 2001 From: Scott Rifenbark Date: Tue, 19 Mar 2013 09:07:58 -0700 Subject: [PATCH] dev-manual: First pass at poky-tiny section. (From yocto-docs rev: fbf31831e9cf3fc088c12a2867fa56e2004d624b) Signed-off-by: Scott Rifenbark Signed-off-by: Richard Purdie --- .../dev-manual/dev-manual-common-tasks.xml | 150 +++++++++++++++++- 1 file changed, 149 insertions(+), 1 deletion(-) diff --git a/documentation/dev-manual/dev-manual-common-tasks.xml b/documentation/dev-manual/dev-manual-common-tasks.xml index 69a42542da..39da63436f 100644 --- a/documentation/dev-manual/dev-manual-common-tasks.xml +++ b/documentation/dev-manual/dev-manual-common-tasks.xml @@ -2013,7 +2013,7 @@ -
+
Creating Your Own Distribution @@ -2127,6 +2127,154 @@
+
+ Building a Tiny System + + + * Introduction that tells what, why, and benefits + * Overview of the process + * Cutting back on the kernel size + * Cutting back on the filesystem (libc and busybox) + + + + Very small distributions have some significant advantages such + requiring less on-die memory (cheaper), better performance through + efficient cache usage, lower power requirements due to less + memory, faster boot times, and reduced development overhead. + Some real-world examples where a very small distribution gives + you distinct advantages are digital cameras, medical devices, + small headless systems, and partitioned flash. + You can use the Yocto Project to create very small distribution. + + + + This section presents information that shows you how you can + trim your distribution to even smaller sizes than the + 8 Mbytes poky-tiny distribution that + can be built out-of-the-box using the Yocto Project. + + +
+ Overview + + + The following list presents the overall steps you need to + consider and perform to create very small systems that + have a kernel and root filesystem under 4 Mbytes, boot to the + shell in under two seconds, maintain ipv4 + functionality, and avoid an initial RAM disk: + + Determine your goals and guiding + principles. + Know what you are starting with. + + Trim the root filesystem. + + Trim the kernel + + +
+ +
+ Goals and Guiding Principles + + + Before you can reach your destination, you need to know + where you are going. + Here is an example list that you can use as a guide when + creating very small distributions: + + Determine how much space you need + (e.g. a kernel that is 1 Mbyte or less and + a root filesystem that is 3 Mbytes or less). + + Find the areas that are currently + taking 90% of the space and concentrate on that + for trimming. + + Do not create any difficult "hacks" + to achieve your goals. + Leverage of the device-specific + options. + Do your work in a separate layer + to keep changes isolated. + For information on how to create layers, see + the "Understanding and Creating Layers" section. + + + +
+ +
+ Know What You Are Starting With + + + You will need to have an image from which you can + work. + The Yocto Project ships with the ability to create a + poky-tiny distribution. + This distribution consists of a small, sub-8 Mbyte kernel + that works with two shipped Board Support Packages (BSPs): + Fish River Island 2 and QEMU. + You can use this distribution as a starting point and trim + down from there. + If you need to build out the poky-tiny + distribution, see 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, DATA, and BSS sections. + Dynamic memory contains memory that is allocate at runtime, + stacks, hashtables, and so forth. + Temporary memory is decompression and + __init__ + + + + To help you see where you currently are with kernel and root + filesystem sizes, you can use some tools found in the + Source Directory in + the scripts directory: + + ksize.py: Reports + the size of the kernel files. + dirsize.py: Reports + the size of the root filesystem. + + This next tool and command helps you organized configuration + fragments and view file dependencies in a human-readable form: + + merge_config.sh: + Merges individual configuration fragments. + 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 in this manual. + bitbake -u depexp -g core-image-*: + 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 + sane decisions when cutting out various pieces of the + kernel and root filesystem. + + +
+ +
+ Trim the Root Filesystem + +
+
+
Working with Packages