[yocto] The role of "distro" and "image"

Joshua Lock josh at linux.intel.com
Tue Dec 13 12:36:34 PST 2011


On 13/12/11 12:23, Darren Hart wrote:
> I'm trying to wrap up my work on meta-tiny and integrate it into poky
> proper. I'm having some difficulty drawing a line between the
> responsibility of the distro definition versus that of the image definition.
> 
> For example, if I define a distro which uses tmpdevfs (no udev or mdev)
> and specifies KMACHINE=yocto/standard/tiny to build the tiny variant of
> the linux-yocto kernel, and customizes the busybox build to leave out
> various things - would it make sense for someone to then try to build
> core-image-sato with it? It doesn't to me, but nothing prevents the user
> from doing that (other than a likely build failure).

These all sounds like policy (and therefore distro) decisions to me. As
with much of our system there's no hard and fast rule but this certainly
sounds like a distro to me.

I think it's perfectly reasonable to assume that you can't build every
image you find in the wild for every distro configuration you create.

> 
> So what does the distro define and what does the image define?

Distro defines the build configuration policy, image defines image contents.

You shouldn't set anything in the image definition which affects how
things are built as the packages can then be used in another image.

> 
> Digging around in conf/distro for meta and meta-yocto, I see things like
> naming convention, additional dependencies, choice of toolchain and
> libc, source mirrors, default virtual providers, etc.

*nod*

> 
> The image seems to basically define the package list for the image as
> well as the format of the rootfs and boot media.

*nod* though arguably the latter 3 are likely poked elsewhere also.

> If I understand this correctly, a new "tiny" distro definition would
> change the preferred linux-yocto provider to a linux-yocto-tiny recipe
> (which would in turn specify the default KMACHINE/KTYPE as well, the
> TCLIBC, DISTRO_FEATURES_LIBC, and some naming rules.

Yes!

> I currently define a new task-core-tiny.bb to reset some
> MACHINE_ESSENTIAL bits (qemu pulls in more than is necessary for tiny)
> and redefine the REDEPENDS for the image. I believe I could do this
> instead with assignments in the new distro definition and reuse
> task-core-boot.bb.

Seems like a good approach.

> As for images, I might be able to reuse core-image-minimal - but it
> oddly contains "${POKY_EXTRA_INSTALL}" in the IMAGE_INSTALL. Since
> core-image-minimal.bb is defined in oe-core and POKY is a distro notion
> of meta-yocto, this contributes to my confusion over distro vs. image.
> 
> I'd appreciate some discussion to help me clarify where these lines
> should be.

That's just a stray variable that has yet to be properly renamed by the
looks of it.

It sounds to me like your understanding is correct and this variable has
just thrown you for a loop.

Cheers,
Joshua
-- 
Joshua Lock
        Yocto Project "Johannes factotum"
        Intel Open Source Technology Centre



More information about the yocto mailing list