yocto : create a meta layer by manual procedure

Create a Directory:  Create the directory for your layer. While not strictly required, prepend the name of the folder with the string meta- . For example:


Lets say we want to create, meta-mylayer as name of custom layer.

$ mkdir meta-mylayer

Create a Layer Configuration File: Inside your new layer folder, you need to create a conf/layer.conf file.

$ cd meta-mylayer
$ mkdir conf
$ vim layer.conf

# We have a conf and classes directory, append to BBPATH

# We have a recipes directory, add to BBFILES
BBFILES += "${LAYERDIR}/*/*/*.bb ${LAYERDIR}/*/*/*.bbappend ${LAYERDIR}/images/*.bb"

BBFILE_PATTERN_my-layer := "^${LAYERDIR}/"
BBFILE_PRIORITY_my-layer = "7"

You can also use a layer.conf from our github mata layer.

Here is an explanation of the example:

  • The configuration and classes directory is appended to BBPATH .
  • The recipes for the layers are appended to BBFILES .
  • The BBFILE_COLLECTIONS variable is then appended with the layer name.
  • The BBFILE_PATTERN variable is set to a regular expression and is used to match files from BBFILES into a particular layer. In this case LAYERDIR is used to make BBFILE_PATTERN match within the layer’s
    a particular layer. In this case,
    BBFILE_PRIORITY variable then assigns a priority to the layer. Applying priorities is useful in situations
    where the same recipe might appear in multiple layers and allows you to choose the layer that takes precedence.
    LAYERVERSION variable optionally specifies the version of a layer as a single number.
    Note the use of the
    LAYERDIR variable, which expands to the directory of the current layer.
    BBPATH variable, BitBake locates class files ( .bbclass ), configuration files, and files that
    include and require statements. For these cases, BitBake uses the first file that matches
    the name found in BBPATH . This is similar to the way the PATH variable is used for binaries. It is recommended,
    Through the use of the
    are included with
    therefore, that you use unique class and configuration filenames in your custom layer.
Android Android Commands Android Java Applications Application Libraries Application Stack / User Interface Bash / Shell Scripts Commands and Packages Compilation Content Management System - CMS Core Kernel C Programs Development & Build Development Environment Setup Errors & Failures Flutter git Go Language Programs Hardware Platforms HTML JAVA Programs Kernel & Device Drivers Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL Monetization / Google AdSense Multimedia - Audio, Video, Images NDK / Middleware / HAL OS Concepts PHP Programming Languages RaspberryPi Scripting and Automation Search Engine Optimisation ( SEO ) Social Media Socurce Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized User Interface Web design and development Wordpress Yocto / Bitbake / Openembedded

Leave a Reply / Ask Question