Skip to content

Yocto Layer for Odin Control

Joseph Nobes edited this page Aug 30, 2024 · 28 revisions

Creating a Yocto Layer for an application Odin-Control Instance

The Yocto recipe layer is a directory that specifies how the application-specific code should be baked into the Linux image. The is combined with general layers for the hardware provided by the vendor, as well as additional layers for supporting the LOKI infrastructure. In a typical LOKI application repository, this layer is used to create recipe derived from an odin-control base recipe to install the custom adapter into the image such that resources end up in a predictable place, and everything is executed automatically.

A good example of how this can work is in the BabyD repository.

  1. Create the parent directories from your project root. The name meta-<project> is just a convention, but the other directories and files must have the same names to overlay properly.
mkdir meta-<project>
mkdir meta-<project>/conf
mkdir meta-<project>/recipes-apps
touch meta-<project>/petalinuxbsp.conf
touch meta-<project>/user-rootfsconfig
touch meta-<project>/layer.conf
  1. Edit the main config file. layer.conf describes the contents of this layer as well as how it overlays. These settings should work fine, but remember to replace "" with whatever your project's name is.
# layer.conf

# We have a conf and classes directory, add to BBPATH
BBPATH .= ":${LAYERDIR}"

# We have recipes-* directories, add to BBFILES
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
	${LAYERDIR}/recipes-*/*/*.bbappend"

BBFILE_COLLECTIONS += "<project>"
BBFILE_PATTERN_<project> = "^${LAYERDIR}/"
BBFILE_PRIORITY_<project> = "9"
LAYERVERSION_<project> = "1"
LAYERSERIES_COMPAT_<project> = "zeus"
  1. Create an odin-detector recipe instance (see external guide)

  2. Add the recipe name to the layer.conf so that it will always be brought into the Linux image without being a dependency.

IMAGE_INSTALL_APPENDS = " <project>-detector"
  1. Update your repository environment file to include the location of the new user layer (see Repository Configuration Files for more information).

In repo.env:

yocto_user_layer_0=$(shell pwd)/meta-<project>

Clone this wiki locally