yoctobitbake

In yocto (poky) why is the layers config in the build/ folder?


I'm new to yocto. I'm trying to learn how the packages are added, how to create new layers and so on... just poking around. Started by cloning poky and playing around.

To my understanding, the bblayers.conf file is critical to the project configuration and what you end up building (what layers and packages go into your final image).

This might be the wrong assumption, but I also have a feeling that the build/ folder is where things you build (bitbake) stay. Images, lots of things needed to build them, a big cache of stuff... You can delete it and rebuild it if you somehow broke it. Or you can just copy everything without the build/ folder and continue working on a different computer.

Apparently it's not quite the case. The build/conf/ folder has the important .conf files like the bblayers.conf.

Can someone explain why is this the case? Is there an elegant way to separate the project config and the build folder?


Solution

  • There are a couple layers to the Yocto Project, mainly:

     

    In BSPDIR/sources/poky/meta/conf/bitbake.conf

    sources/poky/meta/conf/bitbake.conf:TMPDIR ?= "${TOPDIR}/tmp"
    sources/poky/meta/conf/bitbake.conf:PERSISTENT_DIR = "${TOPDIR}/cache"
    sources/poky/meta/conf/bitbake.conf:DL_DIR ?= "${TOPDIR}/downloads"
    sources/poky/meta/conf/bitbake.conf:SSTATE_DIR ?= "${TOPDIR}/sstate-cache"
    

    TOPDIR is where you initialize when run setup-environment or oe-init-build-env; All the other bitbake configuration environment variable can be changed based on your need in conf/local.conf;

    e.g. modify conf/local.conf to change the downloads directory from TOPDIR/downloads;

    DL_DIR ?= "/home/downloads/"
    

    To create new layer, please watch this video: https://www.youtube.com/watch?v=3HsaoVqX7dg