top of page
  • Zach Pfeffer

Add GENIVI's DLT to a PetaLinux Tools Managed Build


This post demonstrates how to add GENIVI's Diagnostic Log and Trace Daemon (DLT) to a PetaLinux Tools managed build.

Versions

PetaLinux Tools 2017.4 used (2017.4 is based on Morty - see link for details)

meta-ivi/12.0.0 at link was used based it is based on the morty Yocto branch

Prerequisites

  • Download and Install Xilinx's 2017.4 PetaLinux Tools at link

  • Read "Add a Yocto Layer to a PetaLinux Project and Build a Recipe in the Layer with PetaLinux Tools" at link

Method

A way to pull the dlt-daemon into the build is to pull in the meta-ivi Yocto layer and build the dlt-daemon recipe from the layer.

Steps

1. Set up your PetaLinux Tools

2. Change to your PetaLinux project

3. Check out the meta-ivi layer

4. Use the following settings:

  • While using the instructions below, the user layer should be:

  • While using the instructions below, add the following to project-spec/meta-user/recipes-core/images/petalinux-image.bbappend

  • Pull in the new layer and build the dlt-daemon recipe with these instructions (don't petalinux-build yet):

5. Create:

...in:

...with:

6. Put

..in

7. Run:

Errors and Resolutions

petalinux-build Error

You may get something like this error :

Note: The error will be saved in build/build.log and build/tmp/log/cooker/plnx_aarch64/console-latest.log.

Start Investigation

Investigating components/ext_source/meta-ivi/meta-ivi/recipes-yocto-ivi/packagegroups/packagegroup-core-boot-genivi.bb shows:

Who raises this error?

Grepping for:

Leads to a few results:

The aarch64 line is the right one, because in this case we're building for the Zynq UltraScale+ MPSoC:

This file lists:

What is the distro level in Yocto?

From version 2.2.3 of the Yocto Mega Manual page 15/400:

Configuration File: Configuration information in various .conf files provides global definitions of variables. The conf/local.conf configuration file in the Build Directory contains user-defined variables that affect every build. The meta-poky/conf/distro/poky.conf configuration file defines Yocto "distro" configuration variables used only when building with this policy. Machine configuration files, which are located throughout the Source Directory, define variables for specific hardware and are only used when building for that target (e.g. the machine/beaglebone.conf configuration file defines variables for the Texas Instruments ARM Cortex-A8 development board). Configuration files end with a .conf filename extension.

From page 74 (with comments pertaining to PetaLinux Tools Yocto interwork):

5.14. Creating Your Own Distribution

When you build an image using the Yocto Project and do not alter any distribution Metadata, you are creating a Poky distribution. If you wish to gain more control over package alternative selections, compile-time options, and other low-level configurations, you can create your own distribution.

To create your own distribution, the basic steps consist of creating your own distribution layer, creating your own distribution configuration file, and then adding any needed code and Metadata to the layer. The following steps provide some more detail:

Create a layer for your new distro: Create your distribution layer so that you can keep your Metadata and code for the distribution separate. It is strongly recommended that you create and use your own layer for configuration and code. Using your own layer as compared to just placing configurations in a local.conf configuration file makes it easier to reproduce the same build configuration when using multiple build machines. See the "Creating a General Layer Using the yocto-layer Script" section for information on how to quickly set up a layer.

Create the distribution configuration file: The distribution configuration file needs to be created in the conf/distro directory of your layer. You need to name it using your distribution name (e.g. mydistro.conf).

Note

The DISTRO variable in your local.conf file determines the name of your distribution.

You can split out parts of your configuration file into include files and then "require" them from within your distribution configuration file. Be sure to place the include files in the conf/distro/include directory of your layer. A common example usage of include files would be to separate out the selection of desired version and revisions for individual recipes.

Your configuration file needs to set the following required variables:

DISTRO_NAME DISTRO_VERSION

As it applies to PetaLinux Tools / Yocto interoperation:

This implies that if we search for "DISTRO_NAME" we'll find if PetaLinux Tools creates a distro layer.

Grepping in my project directory failed to show any results

...apart from

Grepping with this command in the PetaLinux Tools install directory

...gave many results:

The following are relevant because we're using Zynq UltraScale+ MPSoC (aarch64)

In $PETALINUX_TOOLS_INSTALL_DIR/components/yocto/source/aarch64/layers/meta-petalinux/conf/distro/petalinux.conf it requires conf/distro/poky.conf:

...and includes:

VIRTUAL-RUNTIME_init_manager is missing.

Yocto Documentation Continued...

These following variables are optional and you typically set them from the distribution configuration file:

If you want to base your distribution configuration file on the very basic configuration from OE-Core, you can use conf/distro/defaultsetup.conf as a reference and just include variables that differ as compared to defaultsetup.conf. Alternatively, you can create a distribution configuration file from scratch using the defaultsetup.conf file or configuration files from other distributions such as Poky or Angstrom as references.

Provide miscellaneous variables: Be sure to define any other variables for which you want to create a default or enforce as part of the distribution configuration. You can include nearly any variable from the local.conf file. The variables you use are not limited to the list in the previous bulleted item.

Point to Your distribution configuration file: In your local.conf file in the Build Directory, set your DISTRO variable to point to your distribution's configuration file. For example, if your distribution's configuration file is named mydistro.conf, then you point to it as follows:

DISTRO = "mydistro"

As it applies to PetaLinux Tools / Yocto interoperation:

$PETALINUX_TOOLS_INSTALL_DIR/components/yocto/source/aarch64/layers/meta-petalinux/conf/distro/petalinux.conf lists:

Yocto Documentation Continued...

Add more to the layer if necessary: Use your layer to hold other information needed for the distribution:

  • Add recipes for installing distro-specific configuration files that are not already installed by another recipe. If you have distro-specific configuration files that are included by an existing recipe, you should add an append file (.bbappend) for those. For general information and recommendations on how to add recipes to your layer, see the "Creating Your Own Layer" and "Best Practices to Follow When Creating Layers" sections.

  • Add any image recipes that are specific to your distribution.

  • Add a psplash append file for a branded splash screen. For information on append files, see the "Using .bbappend Files" section.

  • Add any other append files to make custom changes that are specific to individual recipes.

petalinux-build Error Continued...

Tried putting ./project-spec/meta-user/conf/petalinuxbsp.conf

Then hit this error after typing petalinux-build

Package systemd was not found in the pkg-config search path Error

Is systemd required?

https://github.com/GENIVI/dlt-daemon/blob/master/INSTALL shows that you can use sysvinit. sysvinit is the PetaLinux Tools 2017.4 out-of-the-box default:

How can we try turning it off?

In:

Put a # in front of this to comment it out.

After this I was able to build the dlt-daemon into my image using PetaLinux Tools 2017.4 with:

Where should the # go?

It is a little "hacky" to comment out EXTRAX_OECMAKE on the recipe.

A better way to to leverage the ability to "append" to the recipe using a Yocto (Bit Bake) bbappend file.

Where should it go?

PetaLinux Tools provides a "meta-user" layer which is _a_ place to put a bbappend file for the dlt-daemon.

Steps

1. Create:

...in:

...with:

2. Put the # back in the recipe:

3. Run to clean and rebuild:

Other Info

meta-ivi/13.0.0 at link is based on pyro and meta-ivi/14.0.0 at link is based on rocko

References

  • ​Yocto Project Mega-Manual 2.2.3 @ link

  • Note: using 2.2.3 because PetaLinux Tools 2017.4 is built on Yocto 2.2.3

  • ​BitBake User Manual 2.2.3 @ link

bottom of page