Here’s a complete template setup for your custom partition layout in Yocto BSP 7.x build:
Directory Structure
Create your custom layer with this structure(1):
layers/
├── meta-custom/
│ ├── conf/
│ │ └── layer.conf
│ ├── recipes-images/
│ │ └── images/
│ │ ├── tdx-reference-multimedia-image.bbappend
│ │ └── files/
│ │ └── custom-image.json
│ └── README
(1)
1. Layer Configuration File
Create meta-custom/conf/layer.conf(1):
# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
LCONF_VERSION = "7"
BBPATH = "${TOPDIR}"
BBFILES ?= ""
BBLAYERS ?= " \
${TOPDIR}/../layers/meta-toradex-nxp \
${TOPDIR}/../layers/meta-freescale \
${TOPDIR}/../layers/meta-freescale-3rdparty \
${TOPDIR}/../layers/meta-toradex-bsp-common \
${TOPDIR}/../layers/meta-openembedded/meta-oe \
${TOPDIR}/../layers/meta-openembedded/meta-filesystems \
${TOPDIR}/../layers/meta-openembedded/meta-gnome \
${TOPDIR}/../layers/meta-openembedded/meta-xfce \
${TOPDIR}/../layers/meta-openembedded/meta-networking \
${TOPDIR}/../layers/meta-openembedded/meta-multimedia \
${TOPDIR}/../layers/meta-openembedded/meta-python \
${TOPDIR}/../layers/meta-freescale-distro \
${TOPDIR}/../layers/meta-toradex-demos \
${TOPDIR}/../layers/meta-qt5 \
${TOPDIR}/../layers/meta-toradex-distro \
${TOPDIR}/../layers/meta-yocto/meta-poky \
${TOPDIR}/../layers/openembedded-core/meta \
${TOPDIR}/../layers/meta-custom \
"
(1)
2. Initialize Git Repository (Mandatory)
Initialize your custom layer as a Git repository(1):
$ cd ../layers/meta-custom/
$ git init
$ git add .
$ git commit -m "Initial Commit" -m "Add custom partition layout"
(1)
3. Custom Image JSON Configuration
Create meta-custom/recipes-images/images/files/custom-image.json(2):
{
"config_format": "4",
"autoinstall": false,
"name": "Custom Partition Layout Image",
"description": "Custom multimedia image with A/B boot partitions",
"version": "1.0.0",
"supported_product_ids": [
"0070"
],
"prepare_script": "prepare.sh",
"wrapup_script": "wrapup.sh",
"u_boot_env": "u-boot-initial-env-sd",
"blockdevs": [
{
"name": "emmc",
"partitions": [
{
"partition_size_nominal": 64,
"want_maximised": false,
"content": {
"label": "boot_A",
"filesystem_type": "FAT",
"mkfs_options": "",
"filename": "Reference-Multimedia-Image-verdin-imx8mp.rootfs.bootfs.tar.xz",
"uncompressed_size": 8.671875
}
},
{
"partition_size_nominal": 64,
"want_maximised": false,
"content": {
"label": "boot_B",
"filesystem_type": "FAT",
"mkfs_options": "",
"filename": "Reference-Multimedia-Image-verdin-imx8mp.rootfs.bootfs.tar.xz",
"uncompressed_size": 8.671875
}
},
{
"partition_size_nominal": 2048,
"want_maximised": false,
"content": {
"label": "rootfs_A",
"filesystem_type": "ext4",
"mkfs_options": "-E nodiscard",
"filename": "Reference-Multimedia-Image-verdin-imx8mp.rootfs.tar.xz",
"uncompressed_size": 1272.7109375
}
},
{
"partition_size_nominal": 2048,
"want_maximised": false,
"content": {
"label": "rootfs_B",
"filesystem_type": "ext4",
"mkfs_options": "-E nodiscard"
}
},
{
"partition_size_nominal": 2048,
"want_maximised": false,
"content": {
"label": "factory",
"filesystem_type": "ext4",
"mkfs_options": "-E nodiscard"
}
},
{
"partition_size_nominal": 512,
"want_maximised": false,
"content": {
"label": "recovery",
"filesystem_type": "ext4",
"mkfs_options": "-E nodiscard"
}
},
{
"want_maximised": true,
"content": {
"label": "data",
"filesystem_type": "ext4",
"mkfs_options": "-E nodiscard"
}
}
]
}
],
"rawfiles": [
{
"filename": "imx-boot",
"dd_options": "seek=0"
}
]
}
(2)
4. Image bbappend File
Create meta-custom/recipes-images/images/tdx-reference-multimedia-image.bbappend(1):
# Add custom applications if needed
IMAGE_INSTALL:append = " your-custom-app"
# Enable TEZI image format
IMAGE_FSTYPES += "teziimg"
# Use custom TEZI JSON configuration
TEZI_IMAGE_JSON = "${THISDIR}/files/custom-image.json"
# Keep default bootfs and rootfs for A/B layout
# These will be used for both boot_A and rootfs_A partitions
TEZI_DEFAULT_BOOTFS = "Reference-Multimedia-Image-${MACHINE}.rootfs.bootfs.tar.xz"
TEZI_DEFAULT_ROOTFS = "Reference-Multimedia-Image-${MACHINE}.rootfs.tar.xz"
# Set custom partition variables for additional partitions
TEZI_DATA_FSOPTS = "-E nodiscard"
(1)
5. Local.conf Updates
Add these lines to your build/conf/local.conf(1):
# Add custom layer to build
BBLAYERS += "${TOPDIR}/../layers/meta-custom"
# Ensure TEZI image generation
IMAGE_FSTYPES += "teziimg"
# Machine configuration
MACHINE = "verdin-imx8mp"
DISTRO = "tdx-xwayland"
# Optional: Enable data partition class for additional customization
INHERIT += "tdx-tezi-data-partition"
TDX_TEZI_DATA_PARTITION_TYPE = "ext4"
TDX_TEZI_DATA_PARTITION_LABEL = "data"
TDX_TEZI_DATA_PARTITION_FSOPTS = "-E nodiscard"
(1)
6. Build Commands and Layer Cleaning
Clean and rebuild specific layers(1):
# Navigate to build directory
$ cd build/
# Clean specific layers that affect partitioning
$ bitbake -c cleanall tdx-reference-multimedia-image
$ bitbake -c cleanall virtual/bootloader
$ bitbake -c cleanall virtual/kernel
# Clean deploy directory for fresh artifacts
$ rm -rf tmp/deploy/images/${MACHINE}/*
# Build the image
$ bitbake tdx-reference-multimedia-image
(1)
7. Build Artifacts Location
After successful build, check these locations(1):
# Images and TEZI packages
build/deploy/images/${MACHINE}/
# Look for files like:
# - Verdin-iMX8MP_Reference-Multimedia-Image-Tezi_*.tar
# - image.json (within the TEZI package)
# - Reference-Multimedia-Image-verdin-imx8mp.rootfs.bootfs.tar.xz
# - Reference-Multimedia-Image-verdin-imx8mp.rootfs.tar.xz
(1)
8. U-Boot Environment Variables
If you need custom U-Boot environment variables, modify the u-boot-initial-env-sd file(2):
# Example additions for A/B boot support
bootdelay=3
boot_targets=mmc1 mmc2 mmc0 usb0 dhcp
# Add your custom boot logic here
(2)
Key Points:
- Git Repository: Your custom layer MUST be a Git repository for BSP 7.x builds(1)
- TEZI Format: Toradex uses TEZI format, not standard WIC files(2)
- Partition Definition: The
image.json file defines the actual partition layout(2)
- File Naming: Keep consistent naming between JSON and actual generated files(2)
After building, copy the generated TEZI tar file to your SD card and use Toradex Easy Installer to apply the custom partition layout to your device.
Best regards, Toradex AI Assistant.
Did you like my answer?

If I answered your question, please tick the “Solution” checkbox.
For follow-up questions to me, please use @ToradexAI in your post.