Partition layout issue with wic tool on yocto build image

Hi,

Im try to create the custom partition layout instead of default rootfs and bootfs generated by the toradex at bsp yocto build. Tired to set the custom .wic file and update the tezi image json and tdx image bbappend file for the yocto build. But never seen the custom partition after the build in the tar folder.

tdx info:

Software summary
------------------------------------------------------------
Bootloader:               U-Boot
Kernel version:           6.6.101-7.5.0-devel #1 SMP PREEMPT Mon Oct 27 12:24:20 UTC 2025
Kernel command line:      root=PARTUUID=f7e4900a-02 ro rootwait console=tty1 console=ttymxc2,115200 quiet loglevel=0 vt.global_cursor_default=0 vt.default_redraw=0
Distro name:              NAME="TDX Wayland with XWayland"
Distro version:           VERSION_ID=7.5.0-devel-20251114145026-build.0
Distro variant:           -
Hostname:                 verdin-imx8mp-15722244
------------------------------------------------------------
Hardware info
------------------------------------------------------------
HW model:                 Toradex Verdin iMX8M Plus WB on Verdin Development Board
Toradex version:          0070 V1.1A
Serial number:            15722244
Processor arch:           aarch64
------------------------------------------------------------

I need the help to correct the yocto build wic, wks file and recipes to update the custom partition detailed information about it to generate the custom partition?

Hi, I’m the Toradex AI Assistant.

I might make mistakes or occasionally get you wrong. Our support team will step in if needed.


To create custom partition layouts in your Yocto BSP build for Toradex modules, you’ll need to configure several components together. Here’s how to properly set up custom partitions:

Understanding Toradex Easy Installer Images

All Toradex modules use the Toradex Easy Installer which relies on configuration files named image.json that contain the partitioning scheme information(1). This is the key file that defines your custom partition layout.

Creating Custom Meta Layers

First, you’ll need to create a custom meta layer to contain your modifications(2). The directory structure should follow this pattern:

./
├── sources/
│   ├── meta-toradex-bsp-common/
│   ├── meta-toradex-demos/
│   ├── meta-toradex-distro/
│   └── your-custom-layer/
└── build/

(2)

Adding Custom Partitions via Yocto Variables

You can add custom partitions and formatting options using specific Yocto variables(3). For example, to add a partition with custom formatting options:

TEZI_DATA_FSOPTS = "-O verity"

(3)

or

TDX_TEZI_DATA_PARTITION_FSOPTS = "-O verity"

(3)

These variables will be included in the image.json under the data partition configuration(3).

Configuring the Data Partition Class

You can use the tdx-tezi-data-partition class to create additional data partitions. In your local.conf, add:

INHERIT += "tdx-tezi-data-partition"

This class supports several customization variables:

  • TDX_TEZI_DATA_PARTITION_TYPE - filesystem type (ext2, ext3, ext4, fat, ubifs)
  • TDX_TEZI_DATA_PARTITION_LABEL - partition label
  • TDX_TEZI_DATA_PARTITION_MOUNTPOINT - mount directory
  • TDX_TEZI_DATA_PARTITION_MOUNT_FLAGS - mount flags

Understanding Git Requirements for Torizon OS

Important: If you’re building Torizon OS, all custom layers must be version controlled by Git(2). Without this, you’ll encounter build errors during the OSTree commit process(2).

Verifying Your Custom Partitions

After building, check the generated files in your deploy directory. The partition layout should be reflected in the image.json file within your TEZI package(1).

For your Verdin iMX8M Plus setup, ensure your WIC and WKS files are properly configured to work with the Toradex Easy Installer format rather than standard Yocto image formats.

If your custom partitions aren’t appearing in the build output, verify that:

  1. Your custom layer is properly included in the build
  2. The Git requirements are met (for Torizon OS builds)
  3. Your partition variables are correctly set in the configuration files
  4. The image.json generation is including your custom partition definitions

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

Hi @ToradexAI,

I have tried the wic and recipes in the custom layer for the partition layout but changes doesn’t affect in the build success image,

Build Configuration:

Build Configuration:
BB_VERSION           = "2.8.1"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "ubuntu-22.04"
TARGET_SYS           = "aarch64-tdx-linux"
MACHINE              = "verdin-imx8mp"
DISTRO               = "tdx-xwayland"
DISTRO_VERSION       = "7.5.0-devel-20260120105605+build.0"
TUNE_FEATURES        = "aarch64 armv8a crypto"
TARGET_FPU           = ""
meta-toradex-nxp     = "HEAD:c8b1e7c44c930edd8ff889ad01ab4a5f636948d8"
meta-freescale       = "HEAD:7d83a350d8b28498321a481a2a1c51bb4afb48e9"
meta-freescale-3rdparty = "HEAD:70c83e96c7f75e73245cb77f1b0cada9ed4bbc6d"
meta-toradex-ti      = "HEAD:699cbb557f3c5e57dbdffa2c2023993ee081cf07"
meta-arm-toolchain
meta-arm             = "HEAD:a81c19915b5b9e71ed394032e9a50fd06919e1cd"
meta-ti-bsp
meta-ti-extras       = "HEAD:5b095d968eb225b72e44dc164683aa9157ec2b93"
meta-toradex-bsp-common = "HEAD:366aae1eecae26cf31d6f227217670a8245a93f1"
meta-oe
meta-filesystems
meta-networking
meta-multimedia
meta-python          = "HEAD:15e18246dd0c0585cd1515a0be8ee5e2016d1329"
meta-freescale-distro = "HEAD:b9d6a5d9931922558046d230c1f5f4ef6ee72345"
meta-toradex-demos   = "HEAD:4ba1cebc6909ee7a83d569e8cc748f69e6a0a24f"
meta-qt5             = "HEAD:e197839013fa2cfd59339508303bce91fef48928"
meta-tpm             = "HEAD:bc865c5276c2ab4031229916e8d7c20148dfbac3"
meta-toradex-distro  = "HEAD:71f3887a63d9b10b925afd75d6fb00085cd420b3"
meta-poky            = "HEAD:3ff7ca786732390cd56ae92ff4a43aba46a1bf2e"
meta                 = "HEAD:06d4981313ce67a8d53b1c14be9845b4b5a9f4cf"
meta-toradex-chromium
meta-custom          = "<unknown>:<unknown>"
meta-chromium        = "HEAD:dc31889c0899971def535dc1c040edf18bc16691"
meta-clang           = "scarthgap:731488911f55ebfe746068512b426351192f82f2"
meta-lokbest         = "<unknown>:<unknown>"

partition-image.wks File:

part /boot --source bootimg-efi --sourceparams "loader=u-boot" --ondisk mmcblk2 --fstype=vfat --label BOOT --size 64M
part / --source rootfs --ondisk mmcblk2 --fstype=ext4 --label rootfs_A --size 2048M
part /rootfsB --source blank --ondisk mmcblk2 --fstype=ext4 --label rootfs_B --size 2048M
part /factory --source blank --ondisk mmcblk2 --fstype=ext4 --label factory --size 2048M
part /recovery --source blank --ondisk mmcblk2 --fstype=ext4 --label recovery --size 512M
part /data --source blank --ondisk mmcblk2 --fstype=ext4 --label data --size 0
bootloader --ptable gpt

tdx-reference-multimedia-image.bbappend File:

# Add our kiosk launcher
IMAGE_INSTALL:append = " display-qr-launch"
# Remove Toradex auto-launch system entirely
APP_LAUNCH_WAYLAND = ""
IMAGE_INSTALL:remove = " wayland-qtdemo-launch-cinematicexperience"
IMAGE_INSTALL:remove = " wayland-qtdemo-launch-analogclock"
IMAGE_INSTALL:remove = " wayland-qtdemo-launch-qtsmarthome"
IMAGE_INSTALL:remove = " wayland-terminal-launch"
# Enable WIC formats
IMAGE_FSTYPES += " wic wic.bz2 teziimg"
# Override WIC to use Lokbest partition layout
WKS_FILE:${IMAGE_BASENAME} = "lokbest-partition-image.wks"
WKS_FILES:${IMAGE_BASENAME} = "lokbest-partition-image.wks"
WKS_FILES_DIR:${IMAGE_BASENAME} = "${LAYERDIR}/wic"
WKS_FILE_CHECKSUM:${IMAGE_BASENAME} = ""
# Override Tezi JSON to use raw WIC installer
TEZI_IMAGE_JSON:${IMAGE_BASENAME} = "${THISDIR}/images/lokbest-tezi-image.json"
# Turn off default rootfs/bootfs tarballs
TEZI_DEFAULT_BOOTFS = ""
TEZI_DEFAULT_ROOTFS = ""

I need to help for the changes to be done in the layer and wic file to affect the partition layout changes.

The issue is that you’re trying to use standard Yocto WIC files, but Toradex modules use the Toradex Easy Installer (TEZI) format instead(1). Your WIC configuration won’t directly affect the partition layout because Toradex uses image.json files to define partitioning(1).

Understanding Toradex Easy Installer Format

Toradex modules use the Toradex Easy Installer which has a configuration file named image.json that contains information about the image partitioning scheme(1). The partition configuration uses specific JSON properties to define the layout(2).

Required Changes for Custom Partitions

1. Create Custom TEZI JSON Configuration

You need to create a proper image.json file that defines your custom partitions. Based on the documentation, the structure should include(2):

{
    "config_format": "4",
    "name": "Custom Partition Layout",
    "description": "Custom image with multiple partitions",
    "supported_product_ids": [
        "0070"
    ],
    "blockdevs": [
        {
            "name": "emmc",
            "partitions": [
                {
                    "partition_size_nominal": 64,
                    "content": {
                        "filesystem_type": "fat",
                        "label": "BOOT"
                    }
                },
                {
                    "partition_size_nominal": 2048,
                    "content": {
                        "filesystem_type": "ext4",
                        "label": "rootfs_A"
                    }
                },
                {
                    "partition_size_nominal": 2048,
                    "content": {
                        "filesystem_type": "ext4",
                        "label": "rootfs_B"
                    }
                },
                {
                    "partition_size_nominal": 2048,
                    "content": {
                        "filesystem_type": "ext4",
                        "label": "factory"
                    }
                },
                {
                    "partition_size_nominal": 512,
                    "content": {
                        "filesystem_type": "ext4",
                        "label": "recovery"
                    }
                },
                {
                    "want_maximised": true,
                    "content": {
                        "filesystem_type": "ext4",
                        "label": "data"
                    }
                }
            ]
        }
    ]
}

(2)

2. Update Your bbappend File

Modify your tdx-reference-multimedia-image.bbappend to properly reference the TEZI configuration:

# Enable TEZI image format
IMAGE_FSTYPES += "teziimg"

# Use custom TEZI JSON configuration
TEZI_IMAGE_JSON = "${THISDIR}/files/custom-image.json"

# Disable default partitions if using fully custom layout
TEZI_DEFAULT_BOOTFS = ""
TEZI_DEFAULT_ROOTFS = ""

3. Using Yocto Variables for Partition Customization

You can also use specific Yocto variables to customize partitions. For example, to add custom formatting options to the data partition(3):

TEZI_DATA_FSOPTS = "-O verity"

(3)

or

TDX_TEZI_DATA_PARTITION_FSOPTS = "-O verity"

(3)

4. Ensure Git Repository for Custom Layer

Since you’re using BSP 7.x, ensure your custom layer is properly version controlled with Git(4):

cd meta-lokbest
git init
git add .
git commit -m "Initial commit with custom partition layout"

(4)

Key Points to Remember

  1. WIC files don’t directly control Toradex partition layouts - you need to work with TEZI image.json files(1)
  2. The image.json file defines the actual partitioning scheme that will be applied during installation(2)
  3. Custom layers must be Git repositories for BSP 7.x builds(4)
  4. Use TEZI-specific variables rather than standard Yocto WIC configurations for partition customization(3)

The reason your WIC changes aren’t affecting the build is because Toradex Easy Installer uses its own partitioning system defined in the image.json configuration file, not standard Yocto WIC files.

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

Hi @ToradexAI,

now I need the templates for the image.json, recipes folder structure, image bbappend file configurations and were need the changes for the custom partition layout instead of the default one start to end all file, folder structure, bbappend, image.json and anything need update in local.conf file and any other files which are the required params should be given based on the following config of custom partition layout mentioned below for the yocto image build.

Partition Layout:

part /boot_A --source bootimg-efi --sourceparams "loader=u-boot" --ondisk mmcblk2 --fstype=vfat --label boot_A --size 64M
part /boot_B --source bootimg-efi --sourceparams "loader=u-boot" --ondisk mmcblk2 --fstype=vfat --label boot_B --size 64M
part /      --source rootfs    --ondisk mmcblk2 --fstype=ext4 --label rootfs_A --size 2048M
part /rootfsB --source blank   --ondisk mmcblk2 --fstype=ext4 --label rootfs_B --size 2048M
part /factory --source blank   --ondisk mmcblk2 --fstype=ext4 --label factory  --size 2048M
part /recovery --source blank  --ondisk mmcblk2 --fstype=ext4 --label recovery --size 512M
part /data  --source blank      --ondisk mmcblk2 --fstype=ext4 --label data --size 0

bootloader --ptable gpt

Based on the above layout need the all the configuration setup in the yocto build once the build is succes the tar file contains these changes and while booting into the device via SD the changes need to be applied. and also give the bitbake layers which are all should be cleaned and build for OS image generate?

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:

  1. Git Repository: Your custom layer MUST be a Git repository for BSP 7.x builds(1)
  2. TEZI Format: Toradex uses TEZI format, not standard WIC files(2)
  3. Partition Definition: The image.json file defines the actual partition layout(2)
  4. 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? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

Hi @ToradexAI,

I have setup the partition layout configurations in the given folder structure and files, then while build the clean the tdx it where raising the error.

Partition Layout Configuration bbappend file:

IMAGE_INSTALL:append = " display-qr-launch"
APP_LAUNCH_WAYLAND = ""
IMAGE_INSTALL:remove = " wayland-qtdemo-launch-cinematicexperience"
IMAGE_INSTALL:remove = " wayland-qtdemo-launch-analogclock"
IMAGE_INSTALL:remove = " wayland-qtdemo-launch-qtsmarthome"
IMAGE_INSTALL:remove = " wayland-terminal-launch"
IMAGE_FSTYPES += "teziimg"
TEZI_IMAGE_JSON:${IMAGE_BASENAME} = "${THISDIR}/images/files/lokbest-tezi-image.json"
TEZI_DEFAULT_BOOTFS = "Reference-Multimedia-Image-${MACHINE}.rootfs.bootfs.tar.xz"
TEZI_DEFAULT_ROOTFS = "Reference-Multimedia-Image-${MACHINE}.rootfs.tar.xz"
TEZI_DATA_FSOPTS = "-E nodiscard"

local.conf file:

PREFERRED_VERSION_gstreamer1.0-plugins-ugly = "1.24.0.imx"
PREFERRED_VERSION_gstreamer1.0-plugins-ugly-dev = "1.24.0.imx"
PREFERRED_VERSION_gstreamer1.0-plugins-ugly-meta = "1.24.0.imx"
PREFERRED_VERSION_gstreamer1.0-plugins-ugly-asf = "1.24.0.imx"
PREFERRED_VERSION_gstreamer1.0-libav = "1.24.0.imx"
PREFERRED_VERSION_gstreamer1.0-libav-dev = "1.24.0.imx"
IMAGE_INSTALL:append = " test-suite"
IMAGE_INSTALL:append = " lokbest-project"
IMAGE_FSTYPES += "teziimg"
INHERIT += "tdx-tezi-data-partition"
TDX_TEZI_DATA_PARTITION_TYPE = "ext4"
TDX_TEZI_DATA_PARTITION_LABEL = "data"

Error Issue:

hari@Administrator:~/oe-core/build$ bitbake -c cleansstate tdx-reference-multimedia-image
ERROR: Unable to parse /home/hari/oe-core/layers/openembedded-core/bitbake/lib/bb/parse/parse_py/BBHandler.py
Traceback (most recent call last):
  File "/home/hari/oe-core/layers/openembedded-core/bitbake/lib/bb/parse/parse_py/BBHandler.py", line 71, in inherit
    raise ParseError("Could not inherit file %s" % (file), fn, lineno)
bb.parse.ParseError: ParseError in configuration INHERITs: Could not inherit file classes/tdx-tezi-data-partition.bbclass

give me the correct configurations for the yocto os image build for the custom partition layout.

The error indicates that the tdx-tezi-data-partition class is not available in your current BSP layer setup. This class is part of the meta-toradex-security layer, not the standard BSP layers.

Correct Configuration Setup

1. Remove Problematic Configuration from local.conf

Remove these lines from your local.conf file:

# Remove these lines - they require meta-toradex-security layer
INHERIT += "tdx-tezi-data-partition"
TDX_TEZI_DATA_PARTITION_TYPE = "ext4"
TDX_TEZI_DATA_PARTITION_LABEL = "data"

2. Fix Your bbappend File Path

Update your tdx-reference-multimedia-image.bbappend file path in the TEZI_IMAGE_JSON line:

# Change this line:
TEZI_IMAGE_JSON:${IMAGE_BASENAME} = "${THISDIR}/images/files/lokbest-tezi-image.json"

# To this:
TEZI_IMAGE_JSON = "${THISDIR}/files/lokbest-tezi-image.json"

3. Complete bbappend File Configuration

Your corrected tdx-reference-multimedia-image.bbappend should be:

# Add custom applications
IMAGE_INSTALL:append = " display-qr-launch"

# Remove default Wayland demos
APP_LAUNCH_WAYLAND = ""
IMAGE_INSTALL:remove = " wayland-qtdemo-launch-cinematicexperience"
IMAGE_INSTALL:remove = " wayland-qtdemo-launch-analogclock"
IMAGE_INSTALL:remove = " wayland-qtdemo-launch-qtsmarthome"
IMAGE_INSTALL:remove = " wayland-terminal-launch"

# Enable TEZI image format
IMAGE_FSTYPES += "teziimg"

# Use custom TEZI JSON configuration
TEZI_IMAGE_JSON = "${THISDIR}/files/lokbest-tezi-image.json"

# Keep default bootfs and rootfs for your A/B layout
TEZI_DEFAULT_BOOTFS = "Reference-Multimedia-Image-${MACHINE}.rootfs.bootfs.tar.xz"
TEZI_DEFAULT_ROOTFS = "Reference-Multimedia-Image-${MACHINE}.rootfs.tar.xz"

4. Updated image.json Configuration

Create your lokbest-tezi-image.json file with the correct structure(1):

{
    "config_format": "4",
    "autoinstall": false,
    "name": "Lokbest Custom Partition Layout",
    "description": "Custom multimedia image with A/B boot partitions",
    "version": "1.0.0",
    "supported_product_ids": [
        "0070"
    ],
    "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": ""
                    }
                },
                {
                    "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"
                    }
                }
            ]
        },
        {
            "name": "emmc-boot0",
            "erase": true,
            "content": {
                "filesystem_type": "raw",
                "rawfiles": [
                    {
                        "filename": "imx-boot",
                        "dd_options": "seek=0"
                    }
                ]
            }
        }
    ]
}

5. Simplified local.conf Configuration

Your local.conf should only contain:

# Machine and distro settings
MACHINE = "verdin-imx8mp"
DISTRO = "tdx-xwayland"

# Your custom applications
IMAGE_INSTALL:append = " test-suite"
IMAGE_INSTALL:append = " lokbest-project"

# Enable TEZI image format
IMAGE_FSTYPES += "teziimg"

# GStreamer preferences (keep your existing ones)
PREFERRED_VERSION_gstreamer1.0-plugins-ugly = "1.24.0.imx"
PREFERRED_VERSION_gstreamer1.0-plugins-ugly-dev = "1.24.0.imx"
PREFERRED_VERSION_gstreamer1.0-plugins-ugly-meta = "1.24.0.imx"
PREFERRED_VERSION_gstreamer1.0-plugins-ugly-asf = "1.24.0.imx"
PREFERRED_VERSION_gstreamer1.0-libav = "1.24.0.imx"
PREFERRED_VERSION_gstreamer1.0-libav-dev = "1.24.0.imx"

6. Build Commands

Clean and rebuild with these commands:

# Clean the image completely
$ bitbake -c cleanall tdx-reference-multimedia-image

# Build the image
$ bitbake tdx-reference-multimedia-image

Key Points:

  1. The tdx-tezi-data-partition class requires the meta-toradex-security layer(2), which is not included in your standard BSP build
  2. Use direct TEZI JSON configuration instead of relying on specialized classes(1)
  3. The partition layout is defined entirely in the image.json file(1), not through Yocto variables
  4. File paths in bbappend files should use ${THISDIR}/files/ format

This configuration will create your custom partition layout without requiring additional security layers.

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

Hi @ToradexAI,

I have setup the configuration given here, but afer the build the tar file image.json doesn’t have the updated partiton setup in that still it was using the default partition.

image_json.txt (2.0 KB)

My custom partition were not applied here why?

The issue is that your custom image.json file isn’t being used during the build process. Looking at your generated image.json, it shows the default Toradex partition layout, which means your custom configuration isn’t being applied.

Root Cause Analysis

The problem is likely in your file path or bbappend configuration. The Toradex Easy Installer uses JSON files for configuration(1), and when your custom JSON isn’t found, it falls back to the default layout.

Debugging Steps

1. Verify File Path Structure

Ensure your directory structure matches exactly:

meta-custom/
├── recipes-images/
│   └── images/
│       ├── tdx-reference-multimedia-image.bbappend
│       └── files/
│           └── lokbest-tezi-image.json

2. Check bbappend File Syntax

Your bbappend file should use the correct variable syntax(1):

# Use this format (without IMAGE_BASENAME)
TEZI_IMAGE_JSON = "${THISDIR}/files/lokbest-tezi-image.json"

# NOT this format
TEZI_IMAGE_JSON:${IMAGE_BASENAME} = "${THISDIR}/files/lokbest-tezi-image.json"

3. Verify Build Process

Check if your custom layer is being processed:

# Verify your layer is included
$ bitbake-layers show-layers | grep meta-custom

# Check if your bbappend is being found
$ bitbake-layers show-appends | grep tdx-reference-multimedia-image

# Verify the JSON file path resolves correctly
$ bitbake -e tdx-reference-multimedia-image | grep TEZI_IMAGE_JSON

4. Force Clean Build

Clean everything related to the image generation(2):

# Clean the image completely
$ bitbake -c cleanall tdx-reference-multimedia-image

# Clean deploy directory
$ rm -rf tmp/deploy/images/verdin-imx8mp/*

# Rebuild
$ bitbake tdx-reference-multimedia-image

Alternative Approach: Override Default JSON

If the file path approach isn’t working, try overriding the default JSON directly in your bbappend:

# In your tdx-reference-multimedia-image.bbappend
do_prepare_recipe_sysroot:append() {
    # Copy your custom JSON to override the default
    cp ${THISDIR}/files/lokbest-tezi-image.json ${WORKDIR}/image.json
}

# Then reference it
TEZI_IMAGE_JSON = "${WORKDIR}/image.json"

Verification Steps

After rebuilding, verify your custom partitions are applied:

  1. Check the generated TEZI package:

    # Extract and examine the TEZI tar file
    $ cd tmp/deploy/images/verdin-imx8mp/
    $ tar -tf Verdin-iMX8MP_Reference-Multimedia-Image-Tezi_*.tar | grep image.json
    $ tar -xf Verdin-iMX8MP_Reference-Multimedia-Image-Tezi_*.tar image.json
    $ cat image.json
    
  2. Look for your custom partitions in the JSON:

    • boot_A and boot_B partitions (64MB each)
    • rootfs_A and rootfs_B partitions (2048MB each)
    • factory, recovery, and data partitions

Common Issues

  • File not found: Ensure the path ${THISDIR}/files/lokbest-tezi-image.json is correct
  • Layer not included: Verify your custom layer is in BBLAYERS
  • Git repository: Ensure your custom layer is a Git repository(2)
  • JSON syntax: Validate your JSON file with a JSON validator

The key point is that Toradex uses the image.json file to define partitioning(1), and if your custom file isn’t being found during the build, it will use the default configuration instead.

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

Hi @ToradexAI,

After clean and remove the rm -rf tmp/deploy/images/verdin-imx8mp/*, the build get an error.

hari@Administrator:~/oe-core/build$ bitbake-layers show-layers | grep meta-custom
meta-custom           /home/hari/oe-core/build/../layers/meta-custom                          6
hari@Administrator:~/oe-core/build$ bitbake-layers show-appends | grep tdx-reference-multimedia-image
tdx-reference-multimedia-image.bb:
  /home/hari/oe-core/build/../layers/meta-custom/recipes-images/images/tdx-reference-multimedia-image.bbappend
  /home/hari/oe-core/layers/meta-lokbest/recipes-images/images/tdx-reference-multimedia-image.bbappend
hari@Administrator:~/oe-core/build$ bitbake -e tdx-reference-multimedia-image | grep TEZI_IMAGE_JSON
# $TEZI_IMAGE_JSON
TEZI_IMAGE_JSON="/home/hari/oe-core/build/../layers/meta-toradex-demos/recipes-images/images/files/lokbest-tezi-image.json"
hari@Administrator:~/oe-core/build$

meta-custom Layer:

hari@Administrator:~/oe-core/layers/meta-custom/recipes-images$ tree .
.
└── images
    ├── files
    │   └── lokbest-tezi-image.json
    └── tdx-reference-multimedia-image.bbappend

2 directories, 2 files
hari@Administrator:~/oe-core/layers/meta-custom/recipes-images$ cat images/tdx-reference-multimedia-image.bbappend
# Enable TEZI image format
IMAGE_FSTYPES += "teziimg"

# Use custom TEZI JSON configuration
TEZI_IMAGE_JSON = "${THISDIR}/files/lokbest-tezi-image.json"

# Keep default bootfs and rootfs for your A/B layout
TEZI_DEFAULT_BOOTFS = "Reference-Multimedia-Image-${MACHINE}.rootfs.bootfs.tar.xz"
TEZI_DEFAULT_ROOTFS = "Reference-Multimedia-Image-${MACHINE}.rootfs.tar.xz"
hari@Administrator:~/oe-core/layers/meta-custom/recipes-images$

Build Error Issue:

Sstate summary: Wanted 437 Local 432 Mirrors 0 Missed 5 Current 5741 (98% match, 99% complete)######         | ETA:  0:00:01
Initialising tasks: 100% |###################################################################################| Time: 0:00:12
NOTE: Executing Tasks
ERROR: tdx-reference-multimedia-image-1.0-r0 do_image_bootfs: Command 'install -m 0644 -D /home/hari/oe-core/build/deploy/images/verdin-imx8mp/Image.gz /home/hari/oe-core/build/tmp/work/verdin_imx8mp-tdx-linux/tdx-reference-multimedia-image/1.0/bootfs/Image.gz' returned 1:
b"install: cannot stat '/home/hari/oe-core/build/deploy/images/verdin-imx8mp/Image.gz': No such file or directory\n"
ERROR: Logfile of failure stored in: /home/hari/oe-core/build/tmp/work/verdin_imx8mp-tdx-linux/tdx-reference-multimedia-image/1.0/temp/log.do_image_bootfs.328131
ERROR: Task (/home/hari/oe-core/build/../layers/meta-toradex-demos/recipes-images/images/tdx-reference-multimedia-image.bb:do_image_bootfs) failed with exit code '1'
NOTE: Tasks Summary: Attempted 12659 tasks of which 12645 didn't need to be rerun and 1 failed.
NOTE: Writing buildhistory
NOTE: Writing buildhistory took: 5 seconds

Summary: 1 task failed:
  /home/hari/oe-core/build/../layers/meta-toradex-demos/recipes-images/images/tdx-reference-multimedia-image.bb:do_image_bootfs
    log: /home/hari/oe-core/build/tmp/work/verdin_imx8mp-tdx-linux/tdx-reference-multimedia-image/1.0/temp/log.do_image_bootfs.328131
Summary: There were 12 WARNING messages.
Summary: There was 1 ERROR message, returning a non-zero exit code.

(1), (2)

The error shows two issues: a missing kernel image (Image.gz) and a conflicting bbappend file. You have two bbappend files for the same recipe, which is causing conflicts.

Root Cause Analysis

  1. Missing Kernel Image: When you deleted tmp/deploy/images/verdin-imx8mp/*, you removed the kernel image that the bootfs creation process needs(1)
  2. Duplicate bbappend Files: You have two bbappend files for the same recipe:
    • /meta-custom/recipes-images/images/tdx-reference-multimedia-image.bbappend
    • /meta-lokbest/recipes-images/images/tdx-reference-multimedia-image.bbappend
  3. Wrong Path Resolution: Your TEZI_IMAGE_JSON is resolving to the wrong path in meta-toradex-demos instead of your custom layer

Solution Steps

1. Remove Duplicate bbappend Files

Remove one of the conflicting bbappend files:

# Keep only one bbappend file - remove the duplicate
$ rm /home/hari/oe-core/layers/meta-lokbest/recipes-images/images/tdx-reference-multimedia-image.bbappend

2. Build Dependencies First

Build the kernel and bootloader components that were deleted(1):

# Build kernel first
$ bitbake virtual/kernel

# Build bootloader
$ bitbake virtual/bootloader

3. Fix Your bbappend File Path

Update your meta-custom/recipes-images/images/tdx-reference-multimedia-image.bbappend:

# Add custom applications
IMAGE_INSTALL:append = " display-qr-launch"

# Remove default Wayland demos
APP_LAUNCH_WAYLAND = ""
IMAGE_INSTALL:remove = " wayland-qtdemo-launch-cinematicexperience"
IMAGE_INSTALL:remove = " wayland-qtdemo-launch-analogclock" 
IMAGE_INSTALL:remove = " wayland-qtdemo-launch-qtsmarthome"
IMAGE_INSTALL:remove = " wayland-terminal-launch"

# Enable TEZI image format
IMAGE_FSTYPES += "teziimg"

# Use absolute path to ensure correct file is found
TEZI_IMAGE_JSON = "${THISDIR}/files/lokbest-tezi-image.json"

# Keep default bootfs and rootfs
TEZI_DEFAULT_BOOTFS = "Reference-Multimedia-Image-${MACHINE}.rootfs.bootfs.tar.xz"
TEZI_DEFAULT_ROOTFS = "Reference-Multimedia-Image-${MACHINE}.rootfs.tar.xz"

# Add file dependency to ensure JSON is found
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"

4. Verify File Paths

Check that your JSON file exists:

$ ls -la /home/hari/oe-core/layers/meta-custom/recipes-images/images/files/lokbest-tezi-image.json

5. Clean and Rebuild Properly

Instead of deleting the entire deploy directory, clean specific recipes(1):

# Clean only the image recipe
$ bitbake -c cleanall tdx-reference-multimedia-image

# Rebuild the image
$ bitbake tdx-reference-multimedia-image

6. Verify Path Resolution

After the changes, verify the path resolves correctly:

$ bitbake -e tdx-reference-multimedia-image | grep TEZI_IMAGE_JSON

You should see your custom path, not the meta-toradex-demos path.

Alternative: Force Override Method

If the path issue persists, use this approach in your bbappend:

# Force copy your JSON during recipe preparation
do_prepare_recipe_sysroot:append() {
    install -d ${WORKDIR}
    cp ${THISDIR}/files/lokbest-tezi-image.json ${WORKDIR}/custom-image.json
}

# Reference the copied file
TEZI_IMAGE_JSON = "${WORKDIR}/custom-image.json"

The key issues were the duplicate bbappend files causing conflicts and the missing kernel artifacts from deleting the deploy directory. Build the dependencies first, then the image(1).

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

Hi @ToradexAI,

I have manually change the image.json with this update json fields for the custom partition layout but in the tezi installer says that the device can’t boot with more than 4 partition, why?

I have attached the image json in the txt file and need the suggestion for the partition layout issue in the tezi installer,

image_json.txt (3.1 KB)

The issue you’re encountering is related to the MBR (Master Boot Record) partition table limitations. Based on the Toradex Easy Installer configuration documentation(1), you have several options to resolve this.

Understanding the 4 Partition Limitation

The error occurs because you’re using the default DOS/MBR partition table, which only supports 4 primary partitions(1). Your current configuration has 7 partitions, which exceeds this limit.

Solution 1: Use GPT Partition Table

Update your image.json to use GPT (GUID Partition Table) instead of MBR(1):

{
    "config_format": "4",
    "autoinstall": false,
    "name": "Custom Partition Layout with GPT",
    "description": "Custom multimedia image with A/B boot partitions using GPT",
    "version": "1.0.0",
    "supported_product_ids": [
        "0070"
    ],
    "blockdevs": [
        {
            "name": "emmc",
            "table_type": "gpt",
            "partitions": [
                {
                    "partition_size_nominal": 64,
                    "content": {
                        "label": "boot_A",
                        "filesystem_type": "fat",
                        "filename": "Reference-Multimedia-Image-verdin-imx8mp.rootfs.bootfs.tar.xz",
                        "uncompressed_size": 8.671875
                    }
                },
                {
                    "partition_size_nominal": 64,
                    "content": {
                        "label": "boot_B",
                        "filesystem_type": "fat"
                    }
                },
                {
                    "partition_size_nominal": 2048,
                    "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,
                    "content": {
                        "label": "rootfs_B",
                        "filesystem_type": "ext4",
                        "mkfs_options": "-E nodiscard"
                    }
                },
                {
                    "partition_size_nominal": 2048,
                    "content": {
                        "label": "factory",
                        "filesystem_type": "ext4",
                        "mkfs_options": "-E nodiscard"
                    }
                },
                {
                    "partition_size_nominal": 512,
                    "content": {
                        "label": "recovery",
                        "filesystem_type": "ext4",
                        "mkfs_options": "-E nodiscard"
                    }
                },
                {
                    "want_maximised": true,
                    "content": {
                        "label": "data",
                        "filesystem_type": "ext4",
                        "mkfs_options": "-E nodiscard"
                    }
                }
            ]
        },
        {
            "name": "emmc-boot0",
            "erase": true,
            "content": {
                "filesystem_type": "raw",
                "rawfiles": [
                    {
                        "filename": "imx-boot",
                        "dd_options": "seek=0"
                    }
                ]
            }
        }
    ]
}

(1)

Key Changes Made:

  1. Added "table_type": "gpt" to the blockdev configuration(1)
  2. GPT supports unlimited partitions (practically up to 128 partitions)(1)
  3. Maintained your 7-partition layout with proper GPT support

Configuration Format Requirements

Ensure you’re using configuration format 2 or newer for GPT support(1):

  • Your current "config_format": "4" already supports this feature(1)
  • GPT partition table type requires configuration format 2 or newer(1)

Alternative Solution: Reduce Partitions

If you prefer to stay with MBR, you could consolidate some partitions:

  • Combine factory and recovery into a single partition
  • Use subdirectories within partitions instead of separate partitions

Verification Steps

After updating your image.json:

  1. Test the configuration with Toradex Easy Installer
  2. Verify all 7 partitions are created during installation
  3. Check partition table after installation using fdisk -l /dev/mmcblk2

The GPT partition table approach is the recommended solution as it removes the 4-partition limitation while maintaining your desired A/B boot partition layout(1).

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

Hi @ToradexAI,

After modify the image.json tezi installer works well but after the boot the device is connected with the network but I cant enter into the ssh some thing at boot time it went not perform well as the normal booting in the device affects something I think the bootfs and rootfs is not set well in the device after the boot, as the default json contains only two partition it working well I have 7 partition check the image json file attached here verify and give the correct feedback suggestion for the boot the device properly, I have no uart console, u-boot console, only im entering the device with ssh so I need the correct configuration for the boot the device.

image_json.txt (3.7 KB)

Looking at your image.json configuration, the issue is that the boot process doesn’t know which partition to boot from with your custom 7-partition layout. The problem is in the U-Boot environment configuration and partition references.

Root Cause Analysis

Your device is failing to boot properly because:

  1. Missing U-Boot Environment Configuration: Your image.json doesn’t specify the U-Boot environment file needed for custom partition layouts(1)
  2. Incorrect Boot Partition References: The default boot arguments expect partition 2 for rootfs, but your layout has changed this(2)
  3. Missing Boot Scripts: Custom partition layouts require proper boot script configuration(2)

Solution: Add U-Boot Environment Configuration

Update your image.json to include the U-Boot environment configuration(1):

{
    "config_format": "4",
    "autoinstall": false,
    "name": "Custom Partition Layout with GPT",
    "description": "Custom multimedia image with A/B boot partitions using GPT",
    "version": "1.0.0",
    "u_boot_env": "u-boot-initial-env-sd",
    "prepare_script": "prepare.sh",
    "wrapup_script": "wrapup.sh",
    "supported_product_ids": [
        "0070"
    ],
    "blockdevs": [
        {
            "name": "emmc",
            "table_type": "gpt",
            "partitions": [
                {
                    "partition_size_nominal": 64,
                    "content": {
                        "label": "boot_A",
                        "filesystem_type": "fat",
                        "filename": "Reference-Multimedia-Image-verdin-imx8mp.rootfs.bootfs.tar.xz",
                        "uncompressed_size": 8.671875
                    }
                },
                {
                    "partition_size_nominal": 64,
                    "content": {
                        "label": "boot_B",
                        "filesystem_type": "fat"
                    }
                },
                {
                    "partition_size_nominal": 2048,
                    "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,
                    "content": {
                        "label": "rootfs_B",
                        "filesystem_type": "ext4",
                        "mkfs_options": "-E nodiscard"
                    }
                },
                {
                    "partition_size_nominal": 2048,
                    "content": {
                        "label": "factory",
                        "filesystem_type": "ext4",
                        "mkfs_options": "-E nodiscard"
                    }
                },
                {
                    "partition_size_nominal": 512,
                    "content": {
                        "label": "recovery",
                        "filesystem_type": "ext4",
                        "mkfs_options": "-E nodiscard"
                    }
                },
                {
                    "want_maximised": true,
                    "content": {
                        "label": "data",
                        "filesystem_type": "ext4",
                        "mkfs_options": "-E nodiscard"
                    }
                }
            ]
        },
        {
            "name": "emmc-boot0",
            "erase": true,
            "content": {
                "filesystem_type": "raw",
                "rawfiles": [
                    {
                        "filename": "imx-boot",
                        "dd_options": "seek=0"
                    }
                ]
            }
        }
    ]
}

(1)

Key Configuration Requirements

1. U-Boot Environment Variables

Your custom partition layout requires specific U-Boot environment variables(2). The u_boot_env property should point to a file containing:

# Boot device configuration
boot_targets=mmc1 mmc2 dhcp
devnum=1
devtype=mmc

# Root filesystem configuration - pointing to partition 3 (rootfs_A)
root_part=3
rootfsargs_set=run uuid_set && env set rootfsargs root=PARTUUID=${uuid} ro rootwait

# Boot arguments assembly
bootcmd_args=run rootfsargs_set && env set bootargs ${defargs} ${rootfsargs} ${setupargs} ${vidargs} ${tdxargs}

(2)

2. Partition Index Mapping

With your 7-partition layout:

  • Partition 1: boot_A (FAT)
  • Partition 2: boot_B (FAT)
  • Partition 3: rootfs_A (ext4) ← This should be your root partition
  • Partition 4: rootfs_B (ext4)
  • Partition 5: factory (ext4)
  • Partition 6: recovery (ext4)
  • Partition 7: data (ext4)

3. Required Files in TEZI Package

Ensure your TEZI package includes(1):

  • u-boot-initial-env-sd - U-Boot environment file
  • prepare.sh - Pre-installation script (can be empty)
  • wrapup.sh - Post-installation script (can be empty)

Alternative: Simplified 4-Partition Layout

If the 7-partition approach continues to cause issues, consider this simplified layout that maintains A/B functionality:

{
    "blockdevs": [
        {
            "name": "emmc",
            "table_type": "gpt",
            "partitions": [
                {
                    "partition_size_nominal": 128,
                    "content": {
                        "label": "boot_AB",
                        "filesystem_type": "fat",
                        "filename": "Reference-Multimedia-Image-verdin-imx8mp.rootfs.bootfs.tar.xz"
                    }
                },
                {
                    "partition_size_nominal": 4096,
                    "content": {
                        "label": "rootfs_A",
                        "filesystem_type": "ext4",
                        "filename": "Reference-Multimedia-Image-verdin-imx8mp.rootfs.tar.xz"
                    }
                },
                {
                    "partition_size_nominal": 4096,
                    "content": {
                        "label": "rootfs_B",
                        "filesystem_type": "ext4"
                    }
                },
                {
                    "want_maximised": true,
                    "content": {
                        "label": "data",
                        "filesystem_type": "ext4"
                    }
                }
            ]
        }
    ]
}

Verification Steps

  1. Test with minimal partition layout first to ensure basic boot functionality
  2. Gradually add partitions once basic boot is working
  3. Verify partition numbering matches U-Boot expectations
  4. Check that rootfs content is properly deployed to the correct partition

The key issue is that your custom partition layout needs corresponding U-Boot environment configuration to tell the bootloader which partition contains the root filesystem(2).

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

Hi @ToradexAI,

What are the changes and where need to be change the u-boot-initial-env-sd has been update for my custom partition layout,

arch=arm
baudrate=115200
board=verdin-imx8mp
board_name=verdin-imx8mp
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
boot_efi_binary=load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} efi/boot/bootaa64.efi; if fdt addr -q ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r};else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi
boot_efi_bootmgr=if fdt addr -q ${fdt_addr_r}; then bootefi bootmgr ${fdt_addr_r};else bootefi bootmgr;fi
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}${boot_syslinux_conf}
boot_net_usb_start=usb start
boot_pci_enum=pci enum
boot_prefixes=/ /boot/
boot_script_dhcp=boot.scr.uimg
boot_script_dhcp=boot.scr
boot_scripts=boot.scr.uimg boot.scr
boot_syslinux_conf=extlinux/extlinux.conf
boot_targets=mmc1 mmc2 dhcp 
bootcmd=run distro_bootcmd
bootcmd_dhcp=devtype=dhcp; run boot_net_usb_start; run boot_pci_enum; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi;setenv efi_fdtfile ${fdtfile}; setenv efi_old_vci ${bootp_vci};setenv efi_old_arch ${bootp_arch};setenv bootp_vci PXEClient:Arch:00011:UNDI:003000;setenv bootp_arch 0xb;if dhcp ${kernel_addr_r}; then tftpboot ${fdt_addr_r} dtb/${efi_fdtfile};if fdt addr -q ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r}; else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi;fi;setenv bootp_vci ${efi_old_vci};setenv bootp_arch ${efi_old_arch};setenv efi_fdtfile;setenv efi_old_arch;setenv efi_old_vci;
bootcmd_mmc1=devnum=1; run mmc_boot
bootcmd_mmc2=devnum=2; run mmc_boot
bootdelay=0
console=ttymxc2
cpu=armv8
distro_bootcmd=setenv nvme_need_init; for target in ${boot_targets}; do run bootcmd_${target}; done
efi_dtb_prefixes=/ /dtb/ /dtb/current/
ethprime=eth0
fdt_addr_r=0x50200000
fdt_board=dev
initrd_addr=0x43800000
initrd_high=0xffffffffffffffff
kernel_addr_r=0x48200000
kernel_comp_addr_r=0x40200000
kernel_comp_size=0x08000000
load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${efi_fdtfile}
loadaddr=0x48200000
mmc_boot=if mmc dev ${devnum}; then devtype=mmc; run scan_dev_for_boot_part; fi
nvme_boot=run boot_pci_enum; run nvme_init; if nvme dev ${devnum}; then devtype=nvme; run scan_dev_for_boot_part; fi
nvme_init=if ${nvme_need_init}; then setenv nvme_need_init false; nvme scan; fi
preboot=test -n ${fdtfile} || setenv fdtfile imx8mp-verdin-${variant}-${fdt_board}.dtb
ramdisk_addr_r=0x50300000
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;run scan_dev_for_efi;
scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then part uuid ${devtype} ${devnum}:${distro_bootpart} distro_bootpart_uuid ; run scan_dev_for_boot; fi; done; setenv devplist
scan_dev_for_efi=setenv efi_fdtfile ${fdtfile}; for prefix in ${efi_dtb_prefixes}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${efi_fdtfile}; then run load_efi_dtb; fi;done;run boot_efi_bootmgr;if test -e ${devtype} ${devnum}:${distro_bootpart} efi/boot/bootaa64.efi; then echo Found EFI removable media binary efi/boot/bootaa64.efi; run boot_efi_binary; echo EFI LOAD FAILED: continuing...; fi; setenv efi_fdtfile
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${boot_syslinux_conf}; then echo Found ${prefix}${boot_syslinux_conf}; run boot_extlinux; echo EXTLINUX FAILED: continuing...; fi
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done
scriptaddr=0x50280000
soc=imx8m
tdxargs=quiet loglevel=0 vt.global_cursor_default=0 vt.default_redraw=0
update_uboot=askenv confirm Did you load flash.bin (y/N)?; if test "$confirm" = "y"; then setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200; mmc dev 2 1; mmc write ${loadaddr} 0x0 ${blkcnt}; fi
usb_boot=usb start; if usb dev ${devnum}; then devtype=usb; run scan_dev_for_boot_part; fi
usb_ignorelist=0x1050:*,
vendor=toradex

Looking at your current U-Boot environment, you need to modify several key variables to support your custom 7-partition layout. The main issue is that the default configuration expects a 2-partition layout (boot + rootfs), but your custom layout has changed the partition numbering(1).

Key Changes Required

1. Root Filesystem Configuration

Your custom layout has rootfs_A as partition 3, so you need to update the root filesystem arguments(1):

# Add these new variables for custom partition layout
root_part=3
rootfsargs_set=part uuid mmc ${devnum}:${root_part} uuid && env set rootfsargs root=PARTUUID=${uuid} ro rootwait

2. Boot Target Configuration

Update your boot targets to handle the custom partition layout(1):

# Modified boot targets - keep your existing ones
boot_targets=mmc1 mmc2 dhcp

# Update MMC boot commands to use correct partitions
bootcmd_mmc1=devnum=1; run custom_mmc_boot
bootcmd_mmc2=devnum=2; run custom_mmc_boot

3. Custom MMC Boot Script

Add a new custom boot script that handles your partition layout(1):

# Custom MMC boot script for 7-partition layout
custom_mmc_boot=if mmc dev ${devnum}; then devtype=mmc; run custom_scan_dev_for_boot_part; fi

# Custom scan that looks for bootable partitions in your layout
custom_scan_dev_for_boot_part=setenv distro_bootpart 1; run scan_dev_for_boot; if test "${kernel_loaded}" != "1"; then setenv distro_bootpart 2; run scan_dev_for_boot; fi

4. Boot Arguments Assembly

Update the boot arguments to include your custom rootfs configuration(1):

# Modified boot command arguments
bootcmd_args=run rootfsargs_set && env set bootargs ${tdxargs} ${rootfsargs} console=${console},${baudrate}

# Add this before bootcmd
preboot=test -n ${fdtfile} || setenv fdtfile imx8mp-verdin-${variant}-${fdt_board}.dtb; run bootcmd_args

Complete Updated U-Boot Environment File

Here’s your updated u-boot-initial-env-sd file with the necessary changes:

arch=arm
baudrate=115200
board=verdin-imx8mp
board_name=verdin-imx8mp
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
boot_efi_binary=load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} efi/boot/bootaa64.efi; if fdt addr -q ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r};else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi
boot_efi_bootmgr=if fdt addr -q ${fdt_addr_r}; then bootefi bootmgr ${fdt_addr_r};else bootefi bootmgr;fi
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}${boot_syslinux_conf}
boot_net_usb_start=usb start
boot_pci_enum=pci enum
boot_prefixes=/ /boot/
boot_script_dhcp=boot.scr.uimg
boot_script_dhcp=boot.scr
boot_scripts=boot.scr.uimg boot.scr
boot_syslinux_conf=extlinux/extlinux.conf
boot_targets=mmc1 mmc2 dhcp
bootcmd=run distro_bootcmd
bootcmd_dhcp=devtype=dhcp; run boot_net_usb_start; run boot_pci_enum; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi;setenv efi_fdtfile ${fdtfile}; setenv efi_old_vci ${bootp_vci};setenv efi_old_arch ${bootp_arch};setenv bootp_vci PXEClient:Arch:00011:UNDI:003000;setenv bootp_arch 0xb;if dhcp ${kernel_addr_r}; then tftpboot ${fdt_addr_r} dtb/${efi_fdtfile};if fdt addr -q ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r}; else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi;fi;setenv bootp_vci ${efi_old_vci};setenv bootp_arch ${efi_old_arch};setenv efi_fdtfile;setenv efi_old_arch;setenv efi_old_vci;
bootcmd_mmc1=devnum=1; run custom_mmc_boot
bootcmd_mmc2=devnum=2; run custom_mmc_boot
bootdelay=0
console=ttymxc2
cpu=armv8
distro_bootcmd=setenv nvme_need_init; for target in ${boot_targets}; do run bootcmd_${target}; done
efi_dtb_prefixes=/ /dtb/ /dtb/current/
ethprime=eth0
fdt_addr_r=0x50200000
fdt_board=dev
initrd_addr=0x43800000
initrd_high=0xffffffffffffffff
kernel_addr_r=0x48200000
kernel_comp_addr_r=0x40200000
kernel_comp_size=0x08000000
load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${efi_fdtfile}
loadaddr=0x48200000
nvme_boot=run boot_pci_enum; run nvme_init; if nvme dev ${devnum}; then devtype=nvme; run scan_dev_for_boot_part; fi
nvme_init=if ${nvme_need_init}; then setenv nvme_need_init false; nvme scan; fi
preboot=test -n ${fdtfile} || setenv fdtfile imx8mp-verdin-${variant}-${fdt_board}.dtb; run bootcmd_args
ramdisk_addr_r=0x50300000
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;run scan_dev_for_efi;
scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then part uuid ${devtype} ${devnum}:${distro_bootpart} distro_bootpart_uuid ; run scan_dev_for_boot; fi; done; setenv devplist
scan_dev_for_efi=setenv efi_fdtfile ${fdtfile}; for prefix in ${efi_dtb_prefixes}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${efi_fdtfile}; then run load_efi_dtb; fi;done;run boot_efi_bootmgr;if test -e ${devtype} ${devnum}:${distro_bootpart} efi/boot/bootaa64.efi; then echo Found EFI removable media binary efi/boot/bootaa64.efi; run boot_efi_binary; echo EFI LOAD FAILED: continuing...; fi; setenv efi_fdtfile
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${boot_syslinux_conf}; then echo Found ${prefix}${boot_syslinux_conf}; run boot_extlinux; echo EXTLINUX FAILED: continuing...; fi
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done
scriptaddr=0x50280000
soc=imx8m
tdxargs=quiet loglevel=0 vt.global_cursor_default=0 vt.default_redraw=0
update_uboot=askenv confirm Did you load flash.bin (y/N)?; if test "$confirm" = "y"; then setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200; mmc dev 2 1; mmc write ${loadaddr} 0x0 ${blkcnt}; fi
usb_boot=usb start; if usb dev ${devnum}; then devtype=usb; run scan_dev_for_boot_part; fi
usb_ignorelist=0x1050:*,
vendor=toradex

# Custom variables for 7-partition layout
root_part=3
rootfsargs_set=part uuid mmc ${devnum}:${root_part} uuid && env set rootfsargs root=PARTUUID=${uuid} ro rootwait
bootcmd_args=run rootfsargs_set && env set bootargs ${tdxargs} ${rootfsargs} console=${console},${baudrate}
custom_mmc_boot=if mmc dev ${devnum}; then devtype=mmc; run custom_scan_dev_for_boot_part; fi
custom_scan_dev_for_boot_part=setenv distro_bootpart 1; run scan_dev_for_boot; if test "${kernel_loaded}" != "1"; then setenv distro_bootpart 2; run scan_dev_for_boot; fi

Key Points

  1. Root Partition: Set to partition 3 (rootfs_A in your layout)(1)
  2. Boot Partitions: Will scan partitions 1 and 2 (boot_A and boot_B)(1)
  3. PARTUUID: Uses partition UUID for reliable root filesystem identification(1)
  4. Custom Boot Flow: Handles the non-standard partition layout(1)

The most critical change is setting root_part=3 and updating rootfsargs_set to use the correct partition for your root filesystem(1). This ensures U-Boot knows where to find the root filesystem in your custom 7-partition layout.

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.