Bug 661

Summary: util-linux ends up in images due to problematic dependencies
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Aleksandr Koltsoff <aleksandr.koltsoff>
Component: coreAssignee: Qing He <qing.he>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: aleksandr.koltsoff, meta.mr.watcher, meta.watcher, sgw
Version: 0.9   
Target Milestone: 1.0 M3   
Hardware: Other   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Aleksandr Koltsoff 2011-01-18 06:13:14 UTC
(Sorry for the vague summary, feel free to fix once root cause is identified, also the subcomponent might be also devtools, but since util-linux is in core, using that).

When building very small images, util-linux is still explicitly part of the image, growing its size considerably, especially since busybox could be used in place of many of the tools instead.

For example, a minimal image only containing e2fsck and busybox yields very interesting results.

The following recipe:
--
DESCRIPTION = "fsck-image"
LICENSE = "MIT"
IMAGE_INSTALL = "busybox e2fsprogs-e2fsck"
export IMAGE_BASENAME = "fsck-image-small"
IMAGE_LINGUAS = ""

inherit poky-image
--

The above yields an image which will contain busybox, but also a large number of util-linux programs, and also the fsck binaries will be included 4-5 times (depending on how you count, probably because of partially static linking).

Tracing the dependencies of util-linux/e2fsprogs is non-trivial, for example, blkid is taken from util-linux by the recipe of e2fsprogs (explicitly, via DEPENDS), when it probably shouldn't be renamed that way at all as util-linux-blkid would be the more logical way (however, I'm by far not an expert in OE). Also, libuuid (from util-linux) is used as a build-time dependency for e2fsprogs, separating this into a separate package might make sense. As well as any other libs that util-linux currently carries.

--

So, ideally, the above recipe would produce an image with busybox, *libc and e2fsck. Now it contains a large number of additional binaries which end up taking quite a bit of space compared to the rest of the system.

A similar micro-recipe with just busybox in it works correctly (no extra cruft is included except for the modules dir for the kernel with the various maps).
Comment 1 Qing He 2011-01-18 18:00:19 UTC
(In reply to comment #0)
> (Sorry for the vague summary, feel free to fix once root cause is identified,
> also the subcomponent might be also devtools, but since util-linux is in core,
> using that).
> When building very small images, util-linux is still explicitly part of the
> image, growing its size considerably, especially since busybox could be used in
> place of many of the tools instead.
> For example, a minimal image only containing e2fsck and busybox yields very
> interesting results.
> The following recipe:
> --
> DESCRIPTION = "fsck-image"
> LICENSE = "MIT"
> IMAGE_INSTALL = "busybox e2fsprogs-e2fsck"
> export IMAGE_BASENAME = "fsck-image-small"
> IMAGE_LINGUAS = ""
> inherit poky-image
> --
> The above yields an image which will contain busybox, but also a large number
> of util-linux programs, and also the fsck binaries will be included 4-5 times
> (depending on how you count, probably because of partially static linking).
> Tracing the dependencies of util-linux/e2fsprogs is non-trivial, for example,
> blkid is taken from util-linux by the recipe of e2fsprogs (explicitly, via
> DEPENDS), when it probably shouldn't be renamed that way at all as
> util-linux-blkid would be the more logical way (however, I'm by far not an
> expert in OE). Also, libuuid (from util-linux) is used as a build-time
> dependency for e2fsprogs, separating this into a separate package might make
> sense. As well as any other libs that util-linux currently carries.
> --
> So, ideally, the above recipe would produce an image with busybox, *libc and
> e2fsck. Now it contains a large number of additional binaries which end up
> taking quite a bit of space compared to the rest of the system.
> A similar micro-recipe with just busybox in it works correctly (no extra cruft
> is included except for the modules dir for the kernel with the various maps).

Thanks for the reporting, and yes, at least libuuid and libblkid should be packaged separately.
Comment 2 Qing He 2011-01-29 21:49:02 UTC
fixed in commit 036e4a920fe1dd97c521eb44dcb50bf3df29e43b