Title: What is the recommended way to customize the TEZI partition layout (image.json) for Verdin iMX8MP?

Add custom applications

IMAGE_INSTALL:append = " lokbest-project"
IMAGE_INSTALL:append = " display-qr-launch"
IMAGE_INSTALL:append = " chromium-ozone-wayland"

Default Mask the systemctl remount recovery file system (// Optional do not use for Normal Rootfs )

IMAGE_INSTALL:append = " systemd-remount-fs-mask"

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:”

this is my multimedia bbappend file

{
“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”
}
]
}
}
// this is my lokbest tezi image.json file
{
“config_format”: “4”,
“autoinstall”: false,
“name”: “Toradex Embedded Linux Reference Multimedia Image”,
“description”: “Image for BSP verification with QT and multimedia features”,
“version”: “7.5.0-devel-20260710085056+build.0”,
“release_date”: “2026-07-10”,
“u_boot_env”: “u-boot-initial-env-sd”,
“prepare_script”: “prepare.sh”,
“wrapup_script”: “wrapup.sh”,
“marketing”: “marketing.tar”,
“icon”: “toradexlinux.png”,
“license”: “LA_OPT_NXP_SW.html”,
“supported_product_ids”: [
“0058”,
“0061”,
“0063”,
“0064”,
“0065”,
“0066”,
“0070”
],
“blockdevs”: [
{
“name”: “emmc”,
“partitions”: [
{
“partition_size_nominal”: 48,
“want_maximised”: false,
“content”: {
“label”: “BOOT”,
“filesystem_type”: “FAT”,
“mkfs_options”: “”,
“filename”: “Reference-Multimedia-Image-verdin-imx8mp.rootfs.bootfs.tar.xz”,
“uncompressed_size”: 8.29296875
}
},
{
“partition_size_nominal”: “512”,
“want_maximised”: true,
“content”: {
“label”: “RFS”,
“filesystem_type”: “ext4”,
“mkfs_options”: “-E nodiscard”,
“filename”: “Reference-Multimedia-Image-verdin-imx8mp.rootfs.tar.xz”,
“uncompressed_size”: 1005.98046875
}
}
]
},
{
“name”: “emmc-boot0”,
“erase”: true,
“content”: {
“filesystem_type”: “raw”,
“rawfiles”: [
{
“filename”: “imx-boot”,
“dd_options”: “seek=0”
}
]
}
}
]
} // this is my final image .json

there my problem is I’m not getting the custom partitions after the final build I’m getting the default toradex

Hi Toradex Team,

I’m working on a custom Yocto image for the Verdin iMX8MP (BSP 7.5.x).

My goal is to implement an A/B partition layout (boot_A , boot_B , rootfs_A , rootfs_B , factory , recovery , data ) for OTA, Secure Boot, dm-verity, and dm-crypt.

I created a custom lokbest-tezi-image.json with my desired partition layout. However, after building the image, the generated deploy/images/verdin-imx8mp/image.json still contains the default partition layout (BOOT and RFS only).

After reviewing image_type_tezi.bbclass , I noticed that it generates image.json by calling rootfs_tezi_emmc() and rootfs_tezi_json() , rather than reading an external JSON file.

My questions are:

  1. What is the recommended and supported way to customize the TEZI partition layout?
  2. Is it possible to provide a custom image.json , or is the expected approach to extend/override rootfs_tezi_emmc() ?
  3. If overriding is the recommended approach, what is the best way to do it without modifying image_type_tezi.bbclass directly, so that BSP updates remain easy?

Any guidance or examples for implementing a custom A/B partition layout would be greatly appreciated.

Thank you.

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 customize the TEZI partition layout for Verdin iMX8MP, you need to understand how the image_type_tezi.bbclass generates the image.json file. The class uses the rootfs_tezi_emmc() and rootfs_tezi_json() functions to programmatically create the partition layout rather than reading an external JSON file(1).

Recommended Approach

Based on the available documentation and community discussions, there are two primary methods:

1. Override the TEZI Class Functions (Recommended for Complex Layouts)

The most flexible approach is to create a .bbappend file for your image recipe and override the relevant functions from image_type_tezi.bbclass. This allows you to define custom partitions without modifying the core BSP files(2).

In your image recipe’s .bbappend file, you can override rootfs_tezi_emmc() to define your custom partition layout programmatically. This approach maintains compatibility with BSP updates since you’re extending rather than modifying the base class.

2. Use TEZI Variables for Simple Customizations

For simpler modifications, you can use the variables provided by the image_type_tezi class(2):

  • TEZI_ROOT_FSOPTS - for rootfs mkfs options
  • TEZI_DATA_FSOPTS - for data partition mkfs options (when using the tdx-tezi-data-partition class)

However, these variables are limited to basic filesystem options and won’t allow you to create the complex A/B partition layout you need.

Why Your Current Approach Isn’t Working

The issue with setting TEZI_IMAGE_JSON = "${THISDIR}/files/lokbest-tezi-image.json" is that the image_type_tezi.bbclass doesn’t use this variable to read an external JSON file. Instead, it generates the JSON programmatically through its internal functions(1).

Implementation Guidance

Before providing specific implementation details for your A/B partition layout with OTA, Secure Boot, dm-verity, and dm-crypt, I need to clarify your setup:

  1. Which exact BSP version are you using? (You mentioned 7.5.x - please provide the full version)
  2. Are you building a Yocto-based custom image or using TorizonCore?
  3. Have you considered using TorizonCore Builder for implementing OTA with A/B updates, as it provides built-in support for this use case?

For complex partition layouts like yours, you may need to apply patches to the BSP layer or significantly extend the TEZI class functions. The community discussion suggests that for advanced customization beyond the standard TEZI data partition, patching the BSP layer is often the most practical approach(2).

Could you please provide these details so I can give you more specific guidance?

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.

Thanks for your response.

I’m building a custom Yocto-based image, not using TorizonCore.

The project is based on Toradex BSP 7.5.0 (Scarthgap) for the Verdin iMX8MP, and we have our own custom applications, U-Boot modifications, OTA logic, and security features.

The reason I’m not using TorizonCore Builder is that our product has custom requirements. We are implementing our own secure boot chain, A/B partition layout, OTA update mechanism, dm-verity, and dm-crypt on top of the Yocto BSP rather than using the Torizon OTA framework.

My current question is specifically about the supported way to customize the TEZI partition layout. I found that image_type_tezi.bbclass generates image.json programmatically using rootfs_tezi_emmc(), so I’d like to know the recommended way to create a custom A/B partition layout without modifying the BSP’s image_type_tezi.bbclass directly.

Thank you for the clarification. Based on your custom Yocto BSP 7.5.0 setup for Verdin iMX8MP, here’s the recommended approach to customize the TEZI partition layout without modifying the core BSP files.

Recommended Approach: Override TEZI Functions in Your Custom Layer

Since image_type_tezi.bbclass generates image.json programmatically, the supported way to customize the partition layout is to override the relevant functions in your custom meta-layer(1).

Step 1: Create a BBClass in Your Custom Layer

In your meta-customer layer (or equivalent), create a custom class that overrides the TEZI partition generation functions:

$ cd ../layers/meta-customer
$ mkdir -p classes
$ touch classes/custom-tezi-layout.bbclass

Step 2: Override the rootfs_tezi_emmc() Function

In custom-tezi-layout.bbclass, override the rootfs_tezi_emmc() function to define your A/B partition layout. This function is responsible for generating the partition structure in the image.json file(2).

Here’s a skeleton example showing the structure:

# Override the partition layout generation
rootfs_tezi_emmc() {
    # Define your custom partitions here
    # This replaces the default BOOT + RFS layout
    
    cat >> ${IMAGE_ROOTFS}/../${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.json << EOF
{
    "config_format": "4",
    "autoinstall": false,
    "name": "Custom A/B Partition Layout",
    "description": "Custom image with A/B boot and rootfs partitions",
    "version": "${IMAGE_VERSION}",
    "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": "${TEZI_DEFAULT_BOOTFS}",
                        "uncompressed_size": ${BOOTFS_SIZE}
                    }
                },
                {
                    "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": "${TEZI_DEFAULT_ROOTFS}",
                        "uncompressed_size": ${ROOTFS_SIZE}
                    }
                },
                {
                    "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"
                    }
                ]
            }
        }
    ]
}
EOF
}

Step 3: Inherit the Custom Class in Your Image Recipe

In your image recipe (e.g., recipes-images/images/custom-multimedia-image.bb), inherit both the standard TEZI class and your custom class(1):

inherit core-image
inherit image_type_tezi
inherit custom-tezi-layout

IMAGE_FSTYPES += "teziimg"

Step 4: Configure TEZI Variables

Set the necessary TEZI variables in your image recipe or local.conf:

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

Important Considerations for Your Use Case

1. Secure Boot Integration

Since you’re implementing secure boot with dm-verity and dm-crypt, you may want to review the meta-toradex-security layer, which provides classes for these features(3):

  • tdxref-signed class implements full chain of trust including dm-verity rootfs integrity verification(3)
  • tdx-tezi-data-partition class for creating additional encrypted data partitions(3)

While you mentioned implementing your own secure boot chain, the meta-toradex-security layer demonstrates how to integrate these features with TEZI partition layouts(3).

2. Partition Properties

According to the TEZI configuration format, each partition supports the following key properties(2):

  • partition_size_nominal: Minimal partition size in megabytes(2)
  • want_maximised: Maximize partition size if multiple partitions share this setting(2)
  • content: Dictionary containing filesystem type, label, and files to write(2)
  • filesystem_type: Options include ext2, ext3, ext4, fat, ubifs, or raw(2)

3. A/B Update Boot Logic

For your A/B partition scheme to work with OTA updates, you’ll also need to:

  1. Modify U-Boot environment variables to support A/B boot selection
  2. Implement boot counter and rollback logic
  3. Ensure your OTA mechanism updates the inactive partition and switches boot targets

The U-Boot customization can be done through a .bbappend file as documented in the custom meta-layers guide(1).

Alternative: Use TEZI Data Partition Class as Reference

If you want to see a working example of extending TEZI partitions, examine the tdx-tezi-data-partition class in meta-toradex-security(3). This class demonstrates how to add an additional encrypted data partition to the standard layout and can serve as a reference for your A/B implementation.

Summary

The recommended approach is:

  1. Create a custom BBClass in your meta-layer that overrides rootfs_tezi_emmc()
  2. Inherit this class in your image recipe alongside image_type_tezi
  3. Define your partition layout programmatically within the override function
  4. Set TEZI variables to point to your bootfs and rootfs archives

This approach keeps your customizations in your own layer, making BSP updates manageable while giving you full control over the 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.

How do you actually override the image_type_tezi.bbclass in my custom-layer. Can you please guide me on this as well. I seem to keep getting
ERROR: ParseError at /home/vinoth/oe-core/build/../layers/meta-lokbest/recipes-images/images/tdx-reference-multimedia-image.bbappend:24: unparsed line: ’ #TEZI_DEFAULT_BOOTFS = “Reference-Multimedia-Image-${MACHINE}.rootfs.bootfs.tar.xz”’
ERROR: Parsing halted due to errors, see error messages above
/// which is the line right below the inherit custom-image-tezi… line and no CRLF issues were found or anything due to the copy paste. Unable to actually triangulate on the root cause and ensure my overriden function is actually being used.