This document describes how to add a new configuration in yocto.

Adding a new machine to the Yocto Project involves following steps:

  • Create a new layer which will hold all the recipes and machine configurations for the new SoC/OEM.
  • Adding the Machine Configuration File for the new SoC/OEM.
  • Adding a Kernel for the Machine.
  • Adding Recipe for SoC/OEM
  • Creating packages for building images

Creating the new SoC/OEM Layer

Use the yocto-layer create sub-command to create a new general layer.

  •  yocto-layer create mylayer

There shall be separate device (machine)  configuration file (.conf) for each device for the particular chip family for which the layer is intended for

  • For Eg : A layer "meta-rdk-oem-OEM-X-SOC-Y" means this layer shall be able to build any devices manufactured by  OEM "X" with all variants of SoC "Y" like Y-1,Y-2 etc

The device (machine) configuration file shall include corresponding include (.inc) file to get machine configuration details.

Adding the Machine Configuration File

To add a machine configuration, you need to add a .conf file with details of the device being added to the conf/machine/ file.
The most important variables to set in this file are as follows:

  • TARGET_ARCH (e.g. "arm")
  • PREFERRED_PROVIDER_virtual/kernel 
  • MACHINE_FEATURES (e.g. "apm screen wifi")

You might also need these variables:

  • KERNEL_IMAGETYPE (e.g. "zImage")
  • IMAGE_FSTYPES (e.g. "tar.gz jffs2")

The default configuration are defined in meta-rdk/conf/distro/rdk.conf and it should be overwritten by the machine specific conf file.
For example, meta-rdk-oem-<>/meta-<>/conf/machine/include/<>.inc

  • PREFERRED_PROVIDER_virtual/iarmmgrs-hal = "iarmmgrs-hal-broadcom"
  • PREFERRED_PROVIDER_virtual/closedcaption-hal = "closedcaption-hal-broadcom"

Adding a Kernel for the Machine

The OpenEmbedded build system needs to be able to build a kernel for the machine. We need to either create a new kernel recipe for this machine, or extend an existing recipe. There are several kernel examples in the Source Directory at meta/recipes-kernel/linux that can be used as references.
If you are creating a new recipe, following steps need to be done:

  • setting up a SRC_URI.
  • Specify any necessary patches
  • create a configure task that configures the unpacked kernel with a defconfig.

If you are extending an existing kernel, it is usually a matter of adding a suitable defconfig file. The file needs to be added into a location similar to defconfig files used for other machines in a given kernel.
A possible way to do this is by listing the file in the SRC_URI and adding the machine to the expression in COMPATIBLE_MACHINE:

  • COMPATIBLE_MACHINE = '(qemux86|qemumips)'

Adding recipes for SoC/OEM

The following kind of recipes can be added to SoC/OEM layer. 

  • recipes (.bb) to build Kernel
  • recipes(.bb)  to build SDK
  • Kernel patches (SoC/OEM specific - if any)
  • SDK patches (SoC/OEM specific - if any)
  • Any SoC/OEM specific scripts or files which need to be installed in RFS

Creating packages for building images

Create a custom package-group for the SoC/OEM which shall list all the recipes that are required for this image. For example, for the hybrid box the following recipe can be appended to the mediaserver package group.

  • meta-rdk-soc-broadcom/meta-brcm/recipes-core/packagegroups/packagegroup-rdk-mediaserver.bbappend : 
    RDEPENDS_packagegroup-rdk-generic-mediaserver += "\
        gstqamtunersrc-brcm \
    "

Create a custom image for generating RFS for required SoC/OEM. For example,

  • meta-rdk-<soc>/recipes-core/images/<soc>-hybrid-image.bb
    IMAGE_INSTALL += "\
        packagegroup-rdk-baserootfs \
        packagegroup-rdk-<soc/oem specific packages> \
    "
  • No labels