[yocto] Control which host components are included in ADT output?

Evade Flow evadeflow at gmail.com
Wed Oct 10 07:52:08 PDT 2012


> Seems you're more interested in generate a SDK for host?

I wouldn't say 'more' interested, just... interested. I guess this is a
general QA issue. We have components implementing state machines that
only communicate via sockets, for example, and don't talk directly to
hardware; these can be prototyped and tested on a Desktop Linux system.
We have Qt apps that can run either on the target or the host. In
general, we've been finding ways to get work done even without target
hardware, since boards are scarce and tend to 'walk off' when you're not
looking.

Unfortunately, each developer on our team seems to do this in a slightly
different way. We're 'supposed' to be using Ubuntu 12.04, but one guy
uses Ubuntu 12.10, another uses 10.04 because he despises Unity so much,
and another prefers Linux Mint. And each goes through a different
process of typing 'apt-get install' and manually building missing
dependencies until he's able to compile applications on his host system.

This isn't the best situation, but so far it hasn't caused any major
headaches. The 'ground truth' for the health of the project is based on
how apps behave on the target, and apps compiled for the target are
ALWAYS built using the same toolchain and libs. Apps compiled for the
host are just a convenience for prototyping and testing.

Still, it worries me that each developer is making lots of little
decisions every day based on feedback from applications compiled for his
host using a process that is essentially uncontrolled and variable.  It
seems I could remove most of the variation by including all required
host-side headers and libraries in the same tarball that supplies the
target SDK.

When I saw these two subdirectories in /opt/poky/1.2.1/sysroots:

  - armv5te-poky-linux-gnueabi/usr/lib
  - i686-pokysdk-linux/usr/lib

I got the impression that the Yocto ADT could be used to create a
complete host SDK as well as a target SDK, but it appears I was
mistaken?

Do other people have this same 'problem'? What's a good solution? Or...
is it not worth worrying about?


On Wed, Oct 10, 2012 at 2:14 AM, Zhang, Jessica <jessica.zhang at intel.com> wrote:
> Hi Evade,
>
> The main purpose of Yocto ADT is for setting up a development environment on your host which allows you to cross develop applications for your target.  And there're two key components help you to achieve this: cross-toolchain and sysroot. That's why the sysroot provides you a collection of target libs and all the main focus of ADT manual is for how to customize your sysroot to meet your special development needs.
>
> Seems you're more interested in generate a SDK for host?
>
> Thanks,
> Jessica
>
> -----Original Message-----
> From: yocto-bounces at yoctoproject.org [mailto:yocto-bounces at yoctoproject.org] On Behalf Of Evade Flow
> Sent: Tuesday, October 09, 2012 3:11 PM
> To: yocto at yoctoproject.org
> Subject: [yocto] Control which host components are included in ADT output?
>
> I have a question about the ADT and how it selects host SDK components.
> If I type:
>
> % bitbake meta-toolchain-sdk
>
> I wind up getting hundreds of target libs when I extract the generated
> tarball:
>
> % pwd
> /opt/poky/1.2.1/sysroots
> % ls armv5te-poky-linux-gnueabi/usr/lib | wc -l
> 696
>
> but a relatively small number of host libs:
>
> % ls i686-pokysdk-linux/usr/lib | wc -l
> 53
>
> Is this normal? Taking libxml2 as an example:
>
> % ls -1 armv5te-poky-linux-gnueabi/usr/lib/libxml*
> armv5te-poky-linux-gnueabi/usr/lib/libxml2.la
> armv5te-poky-linux-gnueabi/usr/lib/libxml2.so
> armv5te-poky-linux-gnueabi/usr/lib/libxml2.so.2
> armv5te-poky-linux-gnueabi/usr/lib/libxml2.so.2.7.8
> % ls -1 i686-pokysdk-linux/usr/lib/libxml*
> zsh: no matches found: i686-pokysdk-linux/usr/lib/libxml*
>
> It seems desirable to have libxml2 be part of the SDK I give to my development team. We have a lot of test applications that can be run on the host, and I don't like the thought of somebody wasting time chasing a bug that turns out to be due to the fact that he is linking against a different (system-installed) version of libxml2 rather than the target version.
>
> Skimming the ADT manual, this section seems to hint at a solution:
>
>  - http://www.yoctoproject.org/docs/current/adt-manual/adt-manual.html#adt-package
>
> But I can't quite follow all the steps. :-% It says (using libglade as an example):
>
>   First, you should generate the ipk file for the libglade package and
>   add it into a working opkg repository. Use these commands:
>
>     $ bitbake libglade
>     $ bitbake package-index
>
>
> Being totally new to opkg, this lost me. What does the 'package-index'
> target actually do?  Does bitbake "add it [libglade] into a working opkg repository" for me, or am I supposed to take the output of the command and do something with it? I had a look in these two locations for 'package-index' and came up empty:
>
>  - http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html
>  - http://www.yoctoproject.org/docs/current/poky-ref-manual/poky-ref-manual.html
>
> What's the best place to look for these kinds of references when I get stuck on something?
>
> The ADT docs go on to say:
>
>   Next, source the environment setup script found in the Yocto Project
>   files. Follow that by setting up the installation destination to point
>   to your sysroot as <sysroot_dir>. Finally, have an OPKG configuration
>   file <conf_file> that corresponds to the opkg repository you have just
>   created.
>
>      $ opkg-cl -f <conf_file> -o <sysroot_dir> update
>      $ opkg-cl -f <cconf_file> -o <sysroot_dir> \
>         --force-overwrite install libglade
>      $ opkg-cl -f <cconf_file> -o <sysroot_dir> \
>         --force-overwrite install libglade-dbg
>      $ opkg-cl -f <conf_file> -o <sysroot_dir> \
>         --force-overwrite install libglade-dev
>
> <sysroot_dir> I understand, but what is <conf_file>? Did bitbake generate this for me? Am I supposed to create one by hand? Where? These instructions are a little hard to follow due to the use of placeholders rather than concrete arguments. I think a complete, explicit example would help a lot here.
>
> Also, it seems likely that the above commands would only install a libglade compiled for the target? How would I generate a libglade for the host?
>
> Another question is: is there a way to tune the ADT tarball to be a better fit for my needs so that I don't need to add so many packages by hand after-the-fact?
>
> Any advice much appreciated, thanks!
> _______________________________________________
> yocto mailing list
> yocto at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto



More information about the yocto mailing list