All of lore.kernel.org
 help / color / mirror / Atom feed
* How can I remove packages from rootfs file ?
@ 2013-05-25 13:58 Jack
  2013-05-26  6:31 ` Jack
  2013-05-26 11:41 ` Paul Eggleton
  0 siblings, 2 replies; 8+ messages in thread
From: Jack @ 2013-05-25 13:58 UTC (permalink / raw)
  To: yocto

Hi,

I maked a fsl-image-minaml rootfs file and customized it with adding
particular packages. For example, I added
IMAGE_INSTALL_append_pn-fsl-image-minimal = " task-core-ssh-openssh
task-core-nfs-server" in local.conf file. The problem is that, the rootfs
file has 6-7 MB capacity but this capacity of file is very high and not
acceptable to me. So how can I remove some packages from rootfs file that I
do not want ? For example, remove packages like ar, arping,  basename,
telnet, beep, .....

Thanks,
Js



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How can I remove packages from rootfs file ?
  2013-05-25 13:58 How can I remove packages from rootfs file ? Jack
@ 2013-05-26  6:31 ` Jack
  2013-05-26 11:41 ` Paul Eggleton
  1 sibling, 0 replies; 8+ messages in thread
From: Jack @ 2013-05-26  6:31 UTC (permalink / raw)
  To: yocto


Any help ???




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How can I remove packages from rootfs file ?
  2013-05-25 13:58 How can I remove packages from rootfs file ? Jack
  2013-05-26  6:31 ` Jack
@ 2013-05-26 11:41 ` Paul Eggleton
  2013-05-27  7:03   ` Nicolas Dechesne
  2013-05-27 14:56   ` Jack
  1 sibling, 2 replies; 8+ messages in thread
From: Paul Eggleton @ 2013-05-26 11:41 UTC (permalink / raw)
  To: Jack; +Cc: yocto

On Saturday 25 May 2013 13:58:46 Jack wrote:
> I maked a fsl-image-minaml rootfs file and customized it with adding
> particular packages. For example, I added
> IMAGE_INSTALL_append_pn-fsl-image-minimal = " task-core-ssh-openssh
> task-core-nfs-server" in local.conf file. The problem is that, the rootfs
> file has 6-7 MB capacity but this capacity of file is very high and not
> acceptable to me. So how can I remove some packages from rootfs file that I
> do not want ? 

There are several different aspects to answering this question.

The list of packages to be installed is composed of several things - the list
of packages specified in IMAGE_INSTALL, packages brought in by IMAGE_FEATURES,
and packages brought in to satisfy dependencies of either of the first two.

One way to analyse the contents of your image is to enable buildhistory [1]
which gives you the full list of installed packages, installed packages by
size, as well as graphs (.dot) that will show you the dependency relationships
between the packages. These dot graphs can be viewed by converting them to
images using the "dot" command (from graphviz) or using a viewer such as xdot
[2].

Once you've analysed things at this level, you may find there are dependency
relationships that can't easily be broken, or some packages that are overly 
large. At this point you will need to start looking at changing the build 
configuraton of the packages in question - disabling optional functionalty, 
removing optional dependencies etc. (usually this would be done by changing
DISTRO_FEATURES, modifying the kernel configuration, changing PACKAGECONFIG
options for individual recipes, or if those aren't available modifying
EXTRA_OECONF). How far you want to go with this depends on how much you want
to optimise the size of your image.

If you do find you need to go down the latter path, I'd recommend checking out
Darren Hart's presentation "Tuning Embedded Linux - When Less is More" [3].

> For example, remove packages like ar, arping,  basename, telnet, beep, .....

Note that whilst some of these may be from packages you can remove, many of
them may be functionality provided by busybox, i.e. where the command is just
a symlink to the busybox binary. You can modify the busybox build-time
configuration to disable these, but bear in mind that disabling them
usually only saves you a few kB. For some applications that may be a useful
saving, of course.

HTH.

Cheers,
Paul

[1] http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality

[2] https://github.com/jrfonseca/xdot.py

[3] Slides: http://elinux.org/images/2/2b/Elce11_hart.pdf
Video: http://www.youtube.com/watch?v=WHLvI8j31vk

-- 

Paul Eggleton
Intel Open Source Technology Centre


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How can I remove packages from rootfs file ?
  2013-05-26 11:41 ` Paul Eggleton
@ 2013-05-27  7:03   ` Nicolas Dechesne
  2013-05-28 13:49     ` Jack
  2013-05-27 14:56   ` Jack
  1 sibling, 1 reply; 8+ messages in thread
From: Nicolas Dechesne @ 2013-05-27  7:03 UTC (permalink / raw)
  To: Paul Eggleton; +Cc: Yocto list discussion, Jack

[-- Attachment #1: Type: text/plain, Size: 4360 bytes --]

On Sun, May 26, 2013 at 1:41 PM, Paul Eggleton <
paul.eggleton@linux.intel.com> wrote:

> On Saturday 25 May 2013 13:58:46 Jack wrote:
> > I maked a fsl-image-minaml rootfs file and customized it with adding
> > particular packages. For example, I added
> > IMAGE_INSTALL_append_pn-fsl-image-minimal = " task-core-ssh-openssh
> > task-core-nfs-server" in local.conf file. The problem is that, the rootfs
> > file has 6-7 MB capacity but this capacity of file is very high and not
> > acceptable to me. So how can I remove some packages from rootfs file
> that I
> > do not want ?
>
> There are several different aspects to answering this question.
>
> The list of packages to be installed is composed of several things - the
> list
> of packages specified in IMAGE_INSTALL, packages brought in by
> IMAGE_FEATURES,
> and packages brought in to satisfy dependencies of either of the first two.
>
> One way to analyse the contents of your image is to enable buildhistory [1]
> which gives you the full list of installed packages, installed packages by
> size, as well as graphs (.dot) that will show you the dependency
> relationships
> between the packages. These dot graphs can be viewed by converting them to
> images using the "dot" command (from graphviz) or using a viewer such as
> xdot
> [2].
>
> Once you've analysed things at this level, you may find there are
> dependency
> relationships that can't easily be broken, or some packages that are overly
> large. At this point you will need to start looking at changing the build
> configuraton of the packages in question - disabling optional functionalty,
> removing optional dependencies etc. (usually this would be done by changing
> DISTRO_FEATURES, modifying the kernel configuration, changing PACKAGECONFIG
> options for individual recipes, or if those aren't available modifying
> EXTRA_OECONF). How far you want to go with this depends on how much you
> want
> to optimise the size of your image.
>
> If you do find you need to go down the latter path, I'd recommend checking
> out
> Darren Hart's presentation "Tuning Embedded Linux - When Less is More" [3].
>
> > For example, remove packages like ar, arping,  basename, telnet, beep,
> .....
>
> Note that whilst some of these may be from packages you can remove, many of
> them may be functionality provided by busybox, i.e. where the command is
> just
> a symlink to the busybox binary. You can modify the busybox build-time
> configuration to disable these, but bear in mind that disabling them
> usually only saves you a few kB. For some applications that may be a useful
> saving, of course.
>

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:

# Poky-tiny is intended to define a tiny Linux system comprised of a


# Linux kernel tailored to support each specific MACHINE and busybox.


# Poky-tiny sets some basic policy to ensure a usable system while still


# keeping the rootfs and kernel image as small as possible.



see [2]

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.


[1]
http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#building-a-tiny-system
[2]
http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta-yocto/conf/distro/poky-tiny.conf


>
> HTH.
>
> Cheers,
> Paul
>
> [1]
> http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality
>
> [2] https://github.com/jrfonseca/xdot.py
>
> [3] Slides: http://elinux.org/images/2/2b/Elce11_hart.pdf
> Video: http://www.youtube.com/watch?v=WHLvI8j31vk
>
> --
>
> Paul Eggleton
> Intel Open Source Technology Centre
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>

[-- Attachment #2: Type: text/html, Size: 6613 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How can I remove packages from rootfs file ?
  2013-05-26 11:41 ` Paul Eggleton
  2013-05-27  7:03   ` Nicolas Dechesne
@ 2013-05-27 14:56   ` Jack
  2013-05-27 18:33     ` Paul Eggleton
  1 sibling, 1 reply; 8+ messages in thread
From: Jack @ 2013-05-27 14:56 UTC (permalink / raw)
  To: yocto

Thanks a lot Paul.

Paul Eggleton <paul.eggleton@...> writes:

> 
> On Saturday 25 May 2013 13:58:46 Jack wrote:
> > I maked a fsl-image-minaml rootfs file and customized it with adding
> > particular packages. For example, I added
> > IMAGE_INSTALL_append_pn-fsl-image-minimal = " task-core-ssh-openssh
> > task-core-nfs-server" in local.conf file. The problem is that, the rootfs
> > file has 6-7 MB capacity but this capacity of file is very high and not
> > acceptable to me. So how can I remove some packages from rootfs file that I
> > do not want ? 
> 
> There are several different aspects to answering this question.
> 
> The list of packages to be installed is composed of several things - the list
> of packages specified in IMAGE_INSTALL, packages brought in by IMAGE_FEATURES,
> and packages brought in to satisfy dependencies of either of the first two.
> 
> One way to analyse the contents of your image is to enable buildhistory [1]
> which gives you the full list of installed packages, installed packages by
> size, as well as graphs (.dot) that will show you the dependency relationships
> between the packages. These dot graphs can be viewed by converting them to
> images using the "dot" command (from graphviz) or using a viewer such as xdot
> [2].
I enabled buildhistory by adding INHERIT += "buildhistory" and
BUILDHISTORY_COMMIT = "1" to local.conf file. But I got this error :

| error: Failed dependencies:
| libcrypt.so.1(GLIBC_2.0) is needed by inetutils-1.8-r0.ppce500v2
.
.
.
.

How can I solve this error ?

> 
> Once you've analysed things at this level, you may find there are dependency
> relationships that can't easily be broken, or some packages that are overly 
> large. At this point you will need to start looking at changing the build 
> configuraton of the packages in question - disabling optional functionalty, 
> removing optional dependencies etc. (usually this would be done by changing
> DISTRO_FEATURES, modifying the kernel configuration, changing PACKAGECONFIG
> options for individual recipes, or if those aren't available modifying
> EXTRA_OECONF). How far you want to go with this depends on how much you want
> to optimise the size of your image.
> 
> If you do find you need to go down the latter path, I'd recommend checking out
> Darren Hart's presentation "Tuning Embedded Linux - When Less is More" [3].

I changed DISTRO_FEATURES in local.conf to DISTRO_FEATURE = "busybox" but it
didn't compile.
> 

> > For example, remove packages like ar, arping,  basename, telnet, beep, .....
> 
> Note that whilst some of these may be from packages you can remove, many of
> them may be functionality provided by busybox, i.e. where the command is just
> a symlink to the busybox binary. You can modify the busybox build-time
> configuration to disable these, but bear in mind that disabling them
> usually only saves you a few kB. For some applications that may be a useful
> saving, of course.
> 
> HTH.
> 
> Cheers,
> Paul
> 
> [1]
http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality
> 
> [2] https://github.com/jrfonseca/xdot.py
> 
> [3] Slides: http://elinux.org/images/2/2b/Elce11_hart.pdf
> Video: http://www.youtube.com/watch?v=WHLvI8j31vk
> 

Finally, I found that one way to customize an image is hob. I remove some
packages with hob and the size of my root filesystem decreased. The type of
output file that generated is .rootfs.ext2.gz but I need
.rootfs.ext2.gz.u-boot type. How can I have .rootfs.ext2.gz.u-boot type with
hob? Is it possible convert .rootfs.ext2.gz to .rootfs.ext2.gz.u-boot?






^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How can I remove packages from rootfs file ?
  2013-05-27 14:56   ` Jack
@ 2013-05-27 18:33     ` Paul Eggleton
  0 siblings, 0 replies; 8+ messages in thread
From: Paul Eggleton @ 2013-05-27 18:33 UTC (permalink / raw)
  To: Jack; +Cc: yocto

On Monday 27 May 2013 14:56:18 Jack wrote:
> Thanks a lot Paul.
> 
> Paul Eggleton <paul.eggleton@...> writes:
> > On Saturday 25 May 2013 13:58:46 Jack wrote:
> > > I maked a fsl-image-minaml rootfs file and customized it with adding
> > > particular packages. For example, I added
> > > IMAGE_INSTALL_append_pn-fsl-image-minimal = " task-core-ssh-openssh
> > > task-core-nfs-server" in local.conf file. The problem is that, the
> > > rootfs
> > > file has 6-7 MB capacity but this capacity of file is very high and not
> > > acceptable to me. So how can I remove some packages from rootfs file
> > > that I
> > > do not want ?
> > 
> > There are several different aspects to answering this question.
> > 
> > The list of packages to be installed is composed of several things - the
> > list of packages specified in IMAGE_INSTALL, packages brought in by
> > IMAGE_FEATURES, and packages brought in to satisfy dependencies of either
> > of the first two.
> > 
> > One way to analyse the contents of your image is to enable buildhistory
> > [1]
> > which gives you the full list of installed packages, installed packages by
> > size, as well as graphs (.dot) that will show you the dependency
> > relationships between the packages. These dot graphs can be viewed by
> > converting them to images using the "dot" command (from graphviz) or
> > using a viewer such as xdot [2].
> 
> I enabled buildhistory by adding INHERIT += "buildhistory" and
> 
> BUILDHISTORY_COMMIT = "1" to local.conf file. But I got this error :
> | error: Failed dependencies:
> | libcrypt.so.1(GLIBC_2.0) is needed by inetutils-1.8-r0.ppce500v2

This has nothing to do with buildhistory. Not sure what would cause this but 
it looks like inetutils depends on libcrypt and for whatever reason that 
wasn't provided by any package by the time it came to construct the image. Did 
you change any other settings?

> I changed DISTRO_FEATURES in local.conf to DISTRO_FEATURE = "busybox" but it
> didn't compile.

I'm afraid you can't just set DISTRO_FEATURES to "busybox". In particular this 
will exclude a bunch of eglibc features, some of which are mandatory. You need 
to understand what you are removing.

> Finally, I found that one way to customize an image is hob. I remove some
> packages with hob and the size of my root filesystem decreased. The type of
> output file that generated is .rootfs.ext2.gz but I need
> .rootfs.ext2.gz.u-boot type. How can I have .rootfs.ext2.gz.u-boot type with
> hob? Is it possible convert .rootfs.ext2.gz to .rootfs.ext2.gz.u-boot?

Doesn't seem to be a way to do this from hob at the moment (likely due to bug 
4386). You could probably run u-boot-mkimage directly to generate the image.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How can I remove packages from rootfs file ?
  2013-05-27  7:03   ` Nicolas Dechesne
@ 2013-05-28 13:49     ` Jack
  2013-05-28 14:14       ` Nicolas Dechesne
  0 siblings, 1 reply; 8+ messages in thread
From: Jack @ 2013-05-28 13:49 UTC (permalink / raw)
  To: yocto

Thanks Nicolas,

Nicolas Dechesne <nicolas.dechesne@...> writes:

> 
> 
> 
> On Sun, May 26, 2013 at 1:41 PM, Paul Eggleton
<paul.eggleton@linux.intel.com> wrote:
> On Saturday 25 May 2013 13:58:46 Jack wrote:
> 
> 
> > I maked a fsl-image-minaml rootfs file and customized it with adding
> > particular packages. For example, I added
> > IMAGE_INSTALL_append_pn-fsl-image-minimal = " task-core-ssh-openssh
> > task-core-nfs-server" in local.conf file. The problem is that, the rootfs
> > file has 6-7 MB capacity but this capacity of file is very high and not
> > acceptable to me. So how can I remove some packages from rootfs file that I
> > do not want ?
> There are several different aspects to answering this question.
> The list of packages to be installed is composed of several things - the list
> of packages specified in IMAGE_INSTALL, packages brought in by IMAGE_FEATURES,
> and packages brought in to satisfy dependencies of either of the first two.
> One way to analyse the contents of your image is to enable buildhistory [1]
> which gives you the full list of installed packages, installed packages by
> size, as well as graphs (.dot) that will show you the dependency relationships
> between the packages. These dot graphs can be viewed by converting them to
> images using the "dot" command (from graphviz) or using a viewer such as xdot
> [2].
> Once you've analysed things at this level, you may find there are dependency
> relationships that can't easily be broken, or some packages that are overly
> large. At this point you will need to start looking at changing the build
> configuraton of the packages in question - disabling optional functionalty,
> removing optional dependencies etc. (usually this would be done by changing
> DISTRO_FEATURES, modifying the kernel configuration, changing PACKAGECONFIG
> options for individual recipes, or if those aren't available modifying
> EXTRA_OECONF). How far you want to go with this depends on how much you want
> to optimise the size of your image.
> If you do find you need to go down the latter path, I'd recommend checking out
> Darren Hart's presentation "Tuning Embedded Linux - When Less is More" [3].
> 
> > For example, remove packages like ar, arping,  basename, telnet, beep, .....
> Note that whilst some of these may be from packages you can remove, many of
> them may be functionality provided by busybox, i.e. where the command is just
> a symlink to the busybox binary. You can modify the busybox build-time
> configuration to disable these, but bear in mind that disabling them
> usually only saves you a few kB. For some applications that may be a useful
> saving, of course.
> 
> 
> 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:
> 

My MACHINE is p1022ds and DISTRO is fsl. When I changed fsl to poky I got
error.
What should I do ?

> # Poky-tiny is intended to define a tiny Linux system comprised of a      
                                                                           
                         
> 
> 
> # Linux kernel tailored to support each specific MACHINE and busybox.    
                                                                           
                          
> # Poky-tiny sets some basic policy to ensure a usable system while still  
                                                                           
                         
> 
> # keeping the rootfs and kernel image as small as possible.              
                                                                           
                          
> 
> see [2]
> 
> 
> 
> 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.
> 
> 
> 
>
[1] http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#building-a-tiny-system
> 
> 
>
[2] http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta-yocto/conf/distro/poky-tiny.conf





^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How can I remove packages from rootfs file ?
  2013-05-28 13:49     ` Jack
@ 2013-05-28 14:14       ` Nicolas Dechesne
  0 siblings, 0 replies; 8+ messages in thread
From: Nicolas Dechesne @ 2013-05-28 14:14 UTC (permalink / raw)
  To: Jack; +Cc: Yocto list discussion

[-- Attachment #1: Type: text/plain, Size: 840 bytes --]

On Tue, May 28, 2013 at 3:49 PM, Jack <jackrubby2010@gmail.com> wrote:

> > 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:
> >
>
> My MACHINE is p1022ds and DISTRO is fsl. When I changed fsl to poky I got
> error.
> What should I do ?


ok, i was assuming you might be using DISTRO=poky... if you use another
DISTRO, then i suggest that you study the differences between poky and
poky-tiny to understand how the 'reference' DISTRO is building its 'tiny'
variant. there are certainly things you can reused from poky-tiny to
optimize your own build.

[-- Attachment #2: Type: text/html, Size: 1296 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-05-28 14:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-25 13:58 How can I remove packages from rootfs file ? Jack
2013-05-26  6:31 ` Jack
2013-05-26 11:41 ` Paul Eggleton
2013-05-27  7:03   ` Nicolas Dechesne
2013-05-28 13:49     ` Jack
2013-05-28 14:14       ` Nicolas Dechesne
2013-05-27 14:56   ` Jack
2013-05-27 18:33     ` Paul Eggleton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.