<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, May 26, 2013 at 1:41 PM, Paul Eggleton <span dir="ltr"><<a href="mailto:paul.eggleton@linux.intel.com" target="_blank">paul.eggleton@linux.intel.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">On Saturday 25 May 2013 13:58:46 Jack wrote:<br>
> I maked a fsl-image-minaml rootfs file and customized it with adding<br>
> particular packages. For example, I added<br>
> IMAGE_INSTALL_append_pn-fsl-image-minimal = " task-core-ssh-openssh<br>
> task-core-nfs-server" in local.conf file. The problem is that, the rootfs<br>
> file has 6-7 MB capacity but this capacity of file is very high and not<br>
> acceptable to me. So how can I remove some packages from rootfs file that I<br>
> do not want ?<br>
<br>
</div>There are several different aspects to answering this question.<br>
<br>
The list of packages to be installed is composed of several things - the list<br>
of packages specified in IMAGE_INSTALL, packages brought in by IMAGE_FEATURES,<br>
and packages brought in to satisfy dependencies of either of the first two.<br>
<br>
One way to analyse the contents of your image is to enable buildhistory [1]<br>
which gives you the full list of installed packages, installed packages by<br>
size, as well as graphs (.dot) that will show you the dependency relationships<br>
between the packages. These dot graphs can be viewed by converting them to<br>
images using the "dot" command (from graphviz) or using a viewer such as xdot<br>
[2].<br>
<br>
Once you've analysed things at this level, you may find there are dependency<br>
relationships that can't easily be broken, or some packages that are overly<br>
large. At this point you will need to start looking at changing the build<br>
configuraton of the packages in question - disabling optional functionalty,<br>
removing optional dependencies etc. (usually this would be done by changing<br>
DISTRO_FEATURES, modifying the kernel configuration, changing PACKAGECONFIG<br>
options for individual recipes, or if those aren't available modifying<br>
EXTRA_OECONF). How far you want to go with this depends on how much you want<br>
to optimise the size of your image.<br>
<br>
If you do find you need to go down the latter path, I'd recommend checking out<br>
Darren Hart's presentation "Tuning Embedded Linux - When Less is More" [3].<br>
<div class="im"><br>
> For example, remove packages like ar, arping, basename, telnet, beep, .....<br>
<br>
</div>Note that whilst some of these may be from packages you can remove, many of<br>
them may be functionality provided by busybox, i.e. where the command is just<br>
a symlink to the busybox binary. You can modify the busybox build-time<br>
configuration to disable these, but bear in mind that disabling them<br>
usually only saves you a few kB. For some applications that may be a useful<br>
saving, of course.<br></blockquote><div><br></div><div style>on top of that, i wanted to remind that there is a dedicated chapter in the Yocto manual about building 'tiny' systems [1]. Also you don't mention which 'DISTRO' you are using, so make sure that you are aware that Yocto comes with Poky, and Poky-tiny as well, which according to conf/distro/poky-tiny.conf says:</div>
<div style><br></div><div style><div># Poky-tiny is intended to define a tiny Linux system comprised of a </div><div>
# Linux kernel tailored to support each specific MACHINE and busybox. </div><div># Poky-tiny sets some basic policy to ensure a usable system while still </div>
<div># keeping the rootfs and kernel image as small as possible. </div><div><br></div><div style>see [2]</div>
<div style><br></div></div><div style>Finally, note that some packages comes with builtin "RRECOMMENDS" which are installed by default in the RootFS. If you are using IPK backend you can use the variables BAD_RECOMMENDS to make sure that though packages are marked as RRECOMMENDS, they aren't installed in the rootFS. I believe this only works with IPK for now.</div>
<div style><br></div><div style><br></div><div style>[1] <a href="http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#building-a-tiny-system">http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#building-a-tiny-system</a></div>
<div>[2] <a href="http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta-yocto/conf/distro/poky-tiny.conf">http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta-yocto/conf/distro/poky-tiny.conf</a></div><div> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
HTH.<br>
<br>
Cheers,<br>
Paul<br>
<br>
[1] <a href="http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality" target="_blank">http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality</a><br>
<br>
[2] <a href="https://github.com/jrfonseca/xdot.py" target="_blank">https://github.com/jrfonseca/xdot.py</a><br>
<br>
[3] Slides: <a href="http://elinux.org/images/2/2b/Elce11_hart.pdf" target="_blank">http://elinux.org/images/2/2b/Elce11_hart.pdf</a><br>
Video: <a href="http://www.youtube.com/watch?v=WHLvI8j31vk" target="_blank">http://www.youtube.com/watch?v=WHLvI8j31vk</a><br>
<span class=""><font color="#888888"><br>
--<br>
<br>
Paul Eggleton<br>
Intel Open Source Technology Centre<br>
</font></span><div class=""><div class="h5">_______________________________________________<br>
yocto mailing list<br>
<a href="mailto:yocto@yoctoproject.org">yocto@yoctoproject.org</a><br>
<a href="https://lists.yoctoproject.org/listinfo/yocto" target="_blank">https://lists.yoctoproject.org/listinfo/yocto</a><br>
</div></div></blockquote></div><br></div></div>