Customize the image json and u-boot initial via yocto build for verdin imx8mp

Hi Toradex Team,

I need to customize my image.json file and u-boot-initial-env-sd file through the yocto build, not manually chane its configs in the build tar generated files, the changes needed like present in the path for the tar compressed files using the

/oe-core/build/deploy/images/verdin-imx8mp

Device-Info:

root@verdin-imx8mp-15722244:~# 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=0b174f47-4baf-4982-870b-593b25471a5d ro rootwait console=tty1 console=ttymxc2,115200 console=null quiet loglevel=0 vt.global_cursor_default=0 vt.default_redraw=0 consoleblank=0
Distro name:              NAME="TDX Wayland with XWayland"
Distro version:           VERSION_ID=7.5.0-devel-20260122114211-build.0
Distro variant:           -
Hostname:                 verdin-imx8mp-15722244
------------------------------------------------------------
Hardware info
------------------------------------------------------------
HW model:                 Toradex Verdin iMX8M Plus WB on Ivy
Toradex version:          0070 V1.1A
Serial number:            15722244
Processor arch:           aarch64
------------------------------------------------------------
root@verdin-imx8mp-15722244:~

The File’s has the default json and u-boot-env variables in the,

image-Reference-Multimedia-Image.json File:
hari@Administrator:~/oe-core/build/deploy/images/verdin-imx8mp$ cat image-Reference-Multimedia-Image.json
{
    "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-20260216065618+build.0",
    "release_date": "2026-02-16",
    "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.26171875
                    }
                },
                {
                    "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": 1568.5390625
                    }
                }
            ]
        },
        {
            "name": "emmc-boot0",
            "erase": true,
            "content": {
                "filesystem_type": "raw",
                "rawfiles": [
                    {
                        "filename": "imx-boot",
                        "dd_options": "seek=0"
                    }
                ]
            }
        }
    ]
}

u-boot-initial-env-sd File:
hari@Administrator:~/oe-core/build/deploy/images/verdin-imx8mp$ cat u-boot-initial-env-sd
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
fdtfile=imx8mp-verdin-wifi-ivy.dtb
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
setup=setenv setupargs console=${console}
setupargs=console=${console}
soc=imx8m
tdxargs=console=null quiet loglevel=0 vt.global_cursor_default=0 vt.default_redraw=0 consoleblank=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

Now I need to customize this image json and uboot initial env sd through the yocto build recipes in my custom layer as like below mentioned;

image.json (4.2 KB)
u-boot-initial-env-sd (6.1 KB)

These attached file changes need to be done by my custom layer recipes and which recipes is used to generate the custom image and uboot initial env instead of the default one detailed steps and flow for this to my board setup. please anyone suggest me to implement this setup through the yocto build.

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 image.json and u-boot-initial-env-sd files through Yocto build instead of manually modifying them post-build, you’ll need to create custom recipes in your meta layer. Based on the documentation, here’s how to implement this:

Create a Custom Meta Layer

First, create your custom meta layer if you haven’t already (1):

# Run `. export` or `source setup-environment` when building Torizon OS  
$ . export # will take you to the `build` directory  
$ bitbake-layers create-layer ../layers/meta-customer # inside the build directory  

Add the path to your newly created layer in conf/bblayers.conf (1):

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-customer \  
"  

Initialize Git Project

Initialize your custom layer as a Git project (mandatory for some builds) (1):

$ git init  
$ git commit -m "Initial Commit" -m "Add <meta-mylayer> from template"  

Customize Image.json

Create a directory structure in your meta layer for customizing the image configuration:

$ cd ../layers/meta-customer/  
$ mkdir -p recipes-core/images/files  

Create a bbappend file to customize your image recipe. The exact recipe name depends on your base image, but for Reference Multimedia Image:

$ touch recipes-core/images/reference-multimedia-image.bbappend  

In the bbappend file, add:

FILESEXTRAPATHS:prepend := "${THISDIR}/files:"  

SRC_URI += "file://custom-image.json"  

do_deploy:append() {  
    if [ -f ${WORKDIR}/custom-image.json ]; then  
        cp ${WORKDIR}/custom-image.json ${DEPLOYDIR}/image-${IMAGE_BASENAME}.json  
    fi  
}  

Place your custom image.json file in recipes-core/images/files/custom-image.json with your desired modifications.

Customize U-Boot Environment

For customizing U-Boot environment variables, you’ll need to modify the U-Boot recipe. The documentation shows how to deploy U-Boot binaries to images (2):

Create a U-Boot bbappend file:

$ mkdir -p recipes-bsp/u-boot/files  
$ touch recipes-bsp/u-boot/u-boot-toradex%.bbappend  

In the bbappend file (1):

FILESEXTRAPATHS:prepend := "${THISDIR}/files:"  

SRC_URI += "file://custom-u-boot-initial-env-sd"  

do_deploy:append() {  
    if [ -f ${WORKDIR}/custom-u-boot-initial-env-sd ]; then  
        cp ${WORKDIR}/custom-u-boot-initial-env-sd ${DEPLOYDIR}/u-boot-initial-env-sd  
    fi  
}  

Place your custom U-Boot environment file in recipes-bsp/u-boot/files/custom-u-boot-initial-env-sd.

Deploy Configuration

To deploy your custom configurations, the documentation shows the standard deployment process (2):

  1. Start from an existing sample image: Download and extract one of the Toradex prebuilt images appropriate for your SoM
  2. Integrate artifacts: Replace the configuration files with your custom ones
  3. Deploy the Toradex Easy Installer image: Deploy the modified package with Toradex Easy Installer

Build Process

After setting up your custom recipes, build your image:

$ cd build/  
$ bitbake reference-multimedia-image  

Your customized image.json and u-boot-initial-env-sd files will be generated in the deploy directory with your modifications applied during the build process.

This approach ensures your customizations are integrated into the build process rather than requiring manual post-build modifications.

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.