Ignore different layers for different targets

  • Hello,

    I want to be able to bitbake different targets. Each target should include different layers.
    I read, that this is possible with the multiconfig approach. (The Yocto Project ® dev documentation) And BBMASK in each of the configs.


    But this is not supported on the "ZEUS"-Release of yocto.

    Is it possible to switch to a newer release of yocto (e.g. 3.3 or later)?

    If not, is there a way to exclude some recipes or complete layers, when bitbaking different targets?
    Example:
    bitbake image1 -> shall contain layer meta-layer1 but not meta-layer2
    bitbake image2 -> shall contain layer meta-layer2 but not meta-layer1

    Tahnks and regards,

    Marcel.

  • Can't you simply create different build directories with different setups? The fact that you have many layers included in your source tree does not automatically mean that you need to include these packages in your configuration.


    Or how about this approach: Configure Yocto to build the sum of all packages that you need on any of your targets. Then create recipes for separate rootfs images, one for each of your targets. Each rootfs image only pulls in those (binary) packages of the generic build that are needed on this specific target.


    I think this approach has the advantage that most basic packages are actually exactly the same on all targets, reducing the support requirements. For example if one of the packages needs a security fix, you change it once in the source tree and then you can update all targets with one simple rebuild. This will update all rootfs images in one go. Or when moving to newer package versions (e.g. a newer Yocto), you also get an update for all of your platforms in one go.


    I only see problems with this approach if the configuration requirements for two targets actually contradict each other. For example if two targets need gstreamer, but one target must support media format X and the other is not allowed to show even the slightest sign of format X. But even then it might be easier to build two different versions of this single package instead of building completely different setup environments.


    Your F&S Support Team

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • Yes I could create multiple build directories with different setups, but then I either have many different tmp-directories or I have to sync all projects somehow. But the difference between the build is very small (only a different IP atm), I think managing multiple build-directories for this small difference is too much overhead.

    My problem is not concerning normal .bb-recipes the problem is that I am using a .bbappend file to set the static Ip-Address of an image.
    I wrote the following 2 files:


    systemd-conf_%.bbappend:

    FILESEXTRAPATHS_prepend := "${THISDIR}:"

    SRC_URI_append = " file://wired.network "


    wired.network:

    [Match]

    Name=en* eth*

    KernelCommandLine=!nfsroot


    [Network]

    Address=192.168.100.100

    Netmask=255.255.255.0


    [DHCP]

    RouteMetric=10

    ClientIdentifier=mac


    Each image now shall use a different ip, so I created multiple recipes which only differ in the Address in the wired.network file. But all .bbappend files are active (if I add the layers for all the images I want to build), so only the last .bbappend file is relevant. So as a consequence every image is using the same ip.

    I a searching for a solution to be able to set the ip-adress based on the target I build for.
    I would like to avoid using multiple build-directories for now.
    (I don't think your second solution would solve the problem I am facing)

    Maybe you know a different solution, to get per target-ip-addresses.

    Thanks and regards,

    Marcel.

  • The IP address can be saved in an U-Boot environment variable. If you set ipaddr in U-Boot, then you can pass this to the Linux command line so that it is correctly set from the beginning if you do not call DHCP functions. So you can use the same image for all boards and just have to set this variable differently.


    Your F&S Support Team

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.