Customizing the BSP


There is no need at all to modify any existing files in the Yocto source directory to customize the BSP for your own hardware. Rather than that you should create a separate layer for your customizations where you can augment or override the original recipes.

This page describes how to add a custom layer to our NXP BSP. You will also get an idea how Yocto recipes work and how you can create your own image.

Your possibilities with Yocto are endless - if you know how to use it. The sections below shall just give common examples and an easier entry.

Further information can be found in the Yocto Project Documentation.


All commands listed below are examples and have to be fitted to your needs.

Set up your build-directory with the desired machine and distro like explained in BSP Setup.

DISTRO=karo-minimal MACHINE=tx8m-1610 source -b build-tx8m-1610

You may optionally define a baseboard in your environment setup:

DISTRO=karo-minimal MACHINE=tx8m-1610 KARO_BASEBOARD=mipi-mb source -b build-tx8m-1610

This will enable the following changes:

  • U-Boot will use the ${MACHINE}-${KARO_BASEBOARD}_env.txt file instead of ${MACHINE}_env.txt for the initial env configuration.

  • U-Boot will use ${SOC_PREFIX}-${MACHINE}-${KARO_BASEBOARD}.dtb instead of ${SOC_PREFIX}-${MACHINE}.dtb as the DTB for the U-Boot internal device configuration.

Kernel & Devicetree

The following steps describe how Kernel and Devicetree can be modified.
You can use these steps to develop Kernel and Devicetree fitted to your needs.
Once you’re done you can read further to persist your changes.

Create Custom Layer

To persist your developed changes and extend our BSP the best way is to create your own layer.


MACHINE = "tx8m-1610"
KARO_BASEBOARD = "myboard"

will result in the following changes in the U-Boot configuration:


Use bitbake-layers to create a new layer and add it to conf/bblayers.conf in your build-directory.

bitbake-layers create-layer ../sources/meta-custom
bitbake-layers add-layer ../sources/meta-custom

This creates an empty example layer for you:

├── conf
│   └── layer.conf
└── recipes-example
    └── example

3 directories, 4 files

Customizing the U-Boot Recipe


Add a custom DTB

Customizing the U-Boot configuration

Customizing the U-Boot Default Environment

To customize the U-Boot default environment, you can either use ‘KARO_BASEBOARD’ as described above or overwrite the environment file from the yocto distribution with your own file by creating the file
‘’recipes-bsp/u-boot/u-boot-karo-2022.04/env/${MACHINE}_env.txt’’ and adding
‘’recipes-bsp/u-boot/u-boot-karo_2022.04.bbappend’’ in your custom layer layer with something like:


This will make sure, that “${MACHINE}_env.txt” is taken from your custom layer rather than meta-karo-nxp.

Customizing the Linux Kernel Recipe

You can remove the recipes-example folder inside your custom layer. Instead add a folder recipes-kernel with different subdirectories.

rm -rf ../sources/meta-custom/recipes-example/
mkdir -p ../sources/meta-custom/recipes-kernel/linux/linux-karo/patches
mkdir ../sources/meta-custom/recipes-kernel/linux/linux-karo/mx8-nxp-bsp

Now create the *.bbappend file to extend the kernel recipe.

touch ../sources/meta-custom/recipes-kernel/linux/linux-karo_6.1.bbappend

The content of linux-karo_6.1.bbappend could be something like this:

 1FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}/patches:${THISDIR}/${PN}:"
 2SRC_URI:append = " \
 3    file://custom_defconfig \
 4    file://0001-custom-magic-kernel-source.patch \
 7SRC_URI:append:mx8-nxp-bsp = " \
 8    file://dts/freescale/imx8mm-tx8m-1610-customboard.dts;subdir=git/arch/arm64/boot \
11KBUILD_DEFCONFIG:tx8m-1610 = "custom_defconfig"
13KERNEL_DEVICETREE:append:tx8m-1610 = " \
14    freescale/imx8mm-tx8m-1610-customboard.dtb \

The files in your custom-layer then would look like this:

├── conf
│   └── layer.conf
└── recipes-kernel
    └── linux
        ├── linux-karo
        │   ├── mx8-nxp-bsp
        │   │   ├── custom_defconfig
        │   │   └── dts
        │   │       └── freescale
        │   │           └── imx8mm-tx8m-1610-customboard.dts
        │   └── patches
        │       └── 0001-custom-magic-kernel-source.patch
        └── linux-karo_6.1.bbappend

8 directories, 7 files


Build your modified Kernel Recipe.

bitbake linux

This will compile and deploy your modified Kernel and additionally the Devicetree you added.


The way you expanded our kernel recipe, you can customize any recipe inside the BSP. You can use our layers as a reference if unsure what you can do.
You may also add new recipes.

Create Custom Image

To add a custom image you can add a new recipe under recipes-core/images. Your custom layer will then look like this:

├── conf
│   └── layer.conf
├── recipes-core
│   └── images
│       └──
└── recipes-kernel
    └── linux
        ├── linux-karo
        │   ├── mx8-nxp-bsp
        │   │   ├── custom_defconfig
        │   │   └── dts
        │   │       └── freescale
        │   │           └── imx8mm-tx8m-1610-customboard.dts
        │   └── patches
        │       └── 0001-custom-magic-kernel-source.patch
        └── linux-karo_%.bbappend

10 directories, 8 files

The below would include the karo-image-weston as basis and additionally add the pip3 python package manager.

1SUMMARY = "A custom image with Weston desktop"
3require recipes-core/images/
5IMAGE_INSTALL:append = " \
6    python3-pip \


Build your custom image.

bitbake custom-image

With this example you would get the desired weston desktop image with pip3 included.