[yocto] Moving to Yocto 2.3 - recipe-specific sysroots - improving the documentation

CHMIELARZ Radoslaw radoslaw.chmielarz at leica-geosystems.com
Fri Oct 26 05:38:52 PDT 2018


Hi all,

I think the documentation on migrating between Yocto 2.2 and 2.3 needs more clarification as to how did the sysroots have changed.

I wanted to migrate our build system from 2.2 to 2.5 and one package in particular has caused me a day worth of scratching my head and trying different ideas.
We have a custom recipe for openssh-server which among other things had a line:
EXTRA_OECONF += "--with-ssl-dir=${STAGING_DIR}/${MACHINE}/usr/local/openssl-1.0"

This is due the fact that openssl-1.0 is being installed to /usr/local/openssl-1.0.

Now when trying to migrate I have noticed that STAGING_DIR is not populated any more and this is clearly explained by the documentation. What is not explained however is how to get the files from other recipes. The documentation simply states that each recipe has its own staging directory. Hence what I have tried to is steer this directory to the staging directory of openssl-1.0.

Of course the real solution is that openssh-server recipe installs header files of all packages in DEPENDS into openssh-server STAGING_DIR_TARGET (in my case, could be other STAGING_* directories apart from STAGING_DIR which is empty right now) and the simple solution was to change the above line to:
EXTRA_OECONF += "--with-ssl-dir=${STAGING_DIR_TARGET}/usr/local/openssl-1.0"

And thus to save other people time I think it would be best to add another point to the documentation (https://www.yoctoproject.org/docs/2.5.1/ref-manual/ref-manual.html#migration-2.3-recipe-specific-sysroots)
"Consider the following:
[..]

  *   Examine the recipes that use STAGING_DIR: STAGING_DIR is a shared directory not populated any more. Instead if You want to use files from another recipe in Your recipe include that recipe in DEPENDS variable which will copy the files from another recipe into Your recipe's staging directories. Now You can refer to those files using STAGING_DIR* pointing to Your recipe's staging directories. For example instead of:
EXTRA_OECONF += "--with-ssl-dir=${STAGING_DIR}/${MACHINE}/usr/local/openssl-1.0"
                Write the following:
                               DEPENDS += "openssl-1.0"
EXTRA_OECONF += "--with-ssl-dir=${STAGING_DIR_TARGET}/usr/local/openssl-1.0"
"

Of course this can be made more general and a precaution could be added that this is taken care of by most of the packages. Maybe in my case it could also be changed to be automatic but this I haven't yet explored.

Cheers,
Radek Chmielarz
Leica Geosystems AG
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20181026/1472dae5/attachment.html>


More information about the yocto mailing list