Skip to content

eclipse-iceoryx/meta-iceoryx2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

meta-yocto-iceoryx2

Yocto Layer for Eclipse iceoryx2™

Manual setup

Prerequisites

This setup is based on Ubuntu 24.04.

If you are running in a docker environment with a minimal Ubuntu setup, ensure that a timezone is set before running the other commands. One option to succeed with this is:

sudo DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata

Before we start with the Yocto build, ensure that the following dependencies are installed:

sudo apt install -y \
    chrpath \
    cpio \
    diffstat \
    file \
    gawk \
    gcc \
    git \
    language-pack-en \
    lz4 \
    pip \
    python3 \
    wget \
    zstd

Setup the Yocto build

Move to your project directory and checkout the Poky distribution and switch to the scarthgap branch:

git clone git://git.yoctoproject.org/poky --branch scarthgap
cd poky

Now source the oe-init-build-env and build the base system.

source oe-init-build-env

This will also change the location to the build directory. If you don't want to have the build directory inside the poky source checkout, you can pass a path to oe-init-build-env.

Since Yocto can consume quite a lot of disk space, we add INHERIT += "rm_work" to conf/local.conf.

echo 'INHERIT += "rm_work"' >> conf/local.conf

Now it's time to build the base image. This can take quite some time.

bitbake core-image-base

Build iceoryx2-image-full

In order to build iceoryx2, we need to add more dependencies. Navigate to the poky directory, clone meta-openenbedded, meta-rust-bin and meta-iceoryx2 and add the layers to conf/bblayers.conf:

git clone https://github.com/openembedded/meta-openembedded.git --branch scarthgap
bitbake-layers add-layer meta-openembedded/meta-oe

git clone https://github.com/rust-embedded/meta-rust-bin.git
bitbake-layers add-layer meta-rust-bin

git clone https://github.com/eclipse-iceoryx/meta-iceoryx2.git
bitbake-layers add-layer meta-iceoryx2

The meta-oe layer is needed in order to build the tests with gTest and the meta-iceoryx2-bin layer is required to build iceoryx2 itself.

We are now ready to build the iceoryx2-image-full, which does not only contain the libraries and CLI tools but also the examples and tests.

For enable unit tests of iceoryx2 and iceoryx2-cxx, add to local.conf

DISTRO_FEATURES:append = " ptest"
bitbake iceoryx2-image-full

By default, the qemux86-64 image is build. To select a different image, just uncomment the desired platform from the Machine Selection.

Once the build process completes, the image can be used with the runqemu qemux86-64 command.

Run an iceoryx2 example

The examples are located under /usr/bin/iceoryx2/examples, with rust, c and cxx subfolders.

When qemu is used to run the image, the user needs to login with root and no password. Once logged in, the following command can be used to run the publish-subscribe examples.

/usr/bin/iceoryx2/examples/rust/publish_subscribe_subscriber &
/usr/bin/iceoryx2/examples/rust/publish_subscribe_publisher

On the terminal, the output of the applications should now appear.

When the publisher is stopped, the iceoryx2 CLI can be used to list the information from the still running subscriber example.

iox2 node list
iox2 service list

These command will list the available information about the iceoryx2 application. For more details about the iceoryx2 CLI, please visit https://github.com/eclipse-iceoryx/iceoryx2/tree/main/iceoryx2-cli.

How to build iceoryx2-image-full with kas

mkdir yocto-iceoryx2
cd yocto-iceoryx2
python3 -m venv .venv
source .venv/bin/activate
pip3 install kas
git clone https://github.com/eclipse-iceoryx/meta-iceoryx2.git
  • build with yocto kirkstone - machine=qemux86-64
kas build meta-iceoryx2/kas/kirkstone.yml
  • build with yocto scarthgap - machine=qemux86-64
kas build meta-iceoryx2/kas/scarthgap.yml

Run ptest with kas MACHINE qemux86-64

  • Bootup QEMU
kas shell meta-iceoryx2/kas/scarthgap.yml -c 'runqemu kvm nographic'
  • Login and use ptest-runner running test cases
# For running iceoryx2 unit tests
ptest-runner iceoryx2
# For running iceoryx2-cxx unit tests
ptest-runner iceoryx2-cxx