yocto : create a meta layer by manual procedure

In our another post “Create meta layer using yocto scripts” we seen how you can automatically create meta layer using python scripts from yocto. In this post, we show similar but with manual efforts.

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.
  • 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.


Subscribe with Valid Email Id to receive updates in Inbox. ( Secured by Google FeedBurner )


Leave a Comment

Android Android Applications Android Build system Android Commands Application Libraries Application Stack / User Interface Bash / Shell Scripts Bluetooth driver Cloud Technologies Commands and Packages Compilation Content Management System Core Kernel C Programs Development & Build Development, Debugging and Performance Tools Development Environment Setup Django & REST Api Errors & Failures Git Hardware Platforms HTML JAVA Programs Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL Multimedia Audio, Video, Images NDK / Middleware / HAL OS Concepts PHP Programming Languages Scripting and Automation Search Engine Optimisation ( SEO ) Social Media Source Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized Web design and development Website Hosting Wordpress Yocto / Bitbake / Openembedded