Skip to content

Create a New Meta-Layer

Once you have successfully compiled an image (see the NXP or ST quick start), you can create a new custom meta-layer for your project.

This allows you to store your own recipes, configurations, and patches separately from the BSP and upstream layers — keeping your customizations modular and maintainable.


Create the Layer

To create a new layer, use the following command:

bitbake-layers create-layer ../sources/meta-customer

The new meta-layer is automatically generated with an example recipe and directory structure:

../sources/meta-customer/
├── conf
│   └── layer.conf
├── COPYING.MIT
├── README
└── recipes-example
    └── example
        └── example_0.1.bb

3 directories, 4 files

This structure includes:

  • conf/layer.conf — layer configuration file
  • recipes-example/ — folder containing a sample recipe
  • COPYING.MIT — license file
  • README — basic documentation for the layer

Add the Layer to the Build Environment

Once the layer is created, you must add it to your build configuration so BitBake can include it.

Edit the file conf/bblayers.conf and append your new layer path under BBLAYERS:

conf/bblayers.conf
LCONF_VERSION = "7"

BBPATH = "${TOPDIR}"
BSPDIR := "${@os.path.abspath(os.path.dirname(d.getVar('FILE', True)) + '/../..')}"

BBFILES ?= ""
BBLAYERS = " \
  ${BSPDIR}/sources/poky/meta \
  ${BSPDIR}/sources/poky/meta-poky \
  \
  ${BSPDIR}/sources/meta-openembedded/meta-oe \
  ${BSPDIR}/sources/meta-openembedded/meta-multimedia \
  ${BSPDIR}/sources/meta-openembedded/meta-python \
  \
  ${BSPDIR}/sources/meta-freescale \
  ${BSPDIR}/sources/meta-freescale-3rdparty \
  ${BSPDIR}/sources/meta-freescale-distro \
"

# i.MX Yocto Project Release layers
BBLAYERS += "${BSPDIR}/sources/meta-imx/meta-imx-bsp"
BBLAYERS += "${BSPDIR}/sources/meta-imx/meta-imx-sdk"
BBLAYERS += "${BSPDIR}/sources/meta-imx/meta-imx-ml"
BBLAYERS += "${BSPDIR}/sources/meta-imx/meta-imx-v2x"
BBLAYERS += "${BSPDIR}/sources/meta-nxp-demo-experience"
BBLAYERS += "${BSPDIR}/sources/meta-matter/meta-nxp-matter-baseline"
BBLAYERS += "${BSPDIR}/sources/meta-matter/meta-nxp-openthread"

BBLAYERS += "${BSPDIR}/sources/meta-arm/meta-arm"
BBLAYERS += "${BSPDIR}/sources/meta-arm/meta-arm-toolchain"
BBLAYERS += "${BSPDIR}/sources/meta-browser/meta-chromium"
BBLAYERS += "${BSPDIR}/sources/meta-clang"
BBLAYERS += "${BSPDIR}/sources/meta-openembedded/meta-gnome"
BBLAYERS += "${BSPDIR}/sources/meta-openembedded/meta-networking"
BBLAYERS += "${BSPDIR}/sources/meta-openembedded/meta-filesystems"
BBLAYERS += "${BSPDIR}/sources/meta-qt6"
BBLAYERS += "${BSPDIR}/sources/meta-security/meta-parsec"
BBLAYERS += "${BSPDIR}/sources/meta-security/meta-tpm"
BBLAYERS += "${BSPDIR}/sources/meta-virtualization"
BBLAYERS += "${BSPDIR}/sources/meta-engicam-nxp"

# Add your new custom layer
BBLAYERS += "${BSPDIR}/sources/meta-customer"

Tip

Remember to adjust the path to match your actual directory structure. Typically, custom layers are placed under ../sources/ next to other meta-layers.


Verify the Layer

To ensure the layer has been correctly added, run:

bitbake-layers show-layers

You should see meta-customer listed among the active layers.