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:

meta-mylayer
meta-GUI_xyz
meta-mymachine

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
BBPATH .= ":${LAYERDIR}"

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

BBFILE_COLLECTIONS += "my-layer"
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,
    path.
    The
    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.
    The
    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 Bash / Shell Scripts Bluetooth driver Build Frameworks Commands and Packages Core Kernel C Programs Development Environment Setup Documents / Books Errors & Failures File Systems Framebuffer / Display Driver git Go Language Programs Hardware Platforms Home JAVA Programs Kernel & Device Drivers Kernel Booting and Porting Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL NDK / Middleware / HAL Network Driver OS Concepts PHP Procfs Filesystem Programming Languages RaspberryPi Scripting and Automation Search Engine Optimisation ( SEO ) Socurce Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized Userspace Utilities Web design and development Wordpress Yocto / Bitbake / Openembedded
Tags:

Leave a Reply