Artifact install failed - "No match between boot and root partitions"

Hi Mender community,

I’m working on integrating Mender OTA into a Toradex Apalis iMX8 board using the Yocto-based image tdx-reference-multimedia-image (Toradex Yocto 5.7 / kirkstone). The image builds successfully and I can deploy it via the Mender server, but the update fails during installation with the following log:
info: Running Mender client version: 3.5.3
info: State transition: update-fetch [Download_Enter] → update-store [Download_Enter]
info: No public key was provided for authenticating the artifact
info: Output (stderr) from command “fw_printenv”: Cannot read environment, using default
info: Output (stderr) from command “fw_printenv”: Cannot read default environment from file
error: Artifact install failed: Payload: can not install Payload: Apalis-iMX8_Reference-Multimedia-Image.ext4: No match between boot and root partitions.: exit status 243

What I have configured:

Enable Mender features

MENDER_FEATURES_ENABLE:append = " mender-uboot mender-image mender-image-sd"
MENDER_FEATURES_DISABLE:append = " mender-grub mender-image-uefi"

Mender Artifact info

MENDER_ARTIFACT_NAME = “scooter-v1.0”

Mender and Toradex Tezi integration

INHERIT += “mender-toradex”
IMAGE_CLASSES += “image_type_mender_tezi”
IMAGE_FSTYPES:append = " mender_tezi"
IMAGE_FSTYPES:remove = " teziimg"

Remove files from boot partition that are loaded by Mender

from the root partitions; this allows the files to be updated OTA

#IMAGE_BOOT_FILES:remove:mender-uboot = “zImage ${KERNEL_DEVICETREE} overlays.txt overlays/*;overlays/”

MENDER_IMAGE_BOOTLOADER_BOOTSECTOR_OFFSET = “0”
DISTRO_FEATURES:append = " systemd"
VIRTUAL-RUNTIME_init_manager = “systemd”
DISTRO_FEATURES_BACKFILL_CONSIDERED = “sysvinit”
VIRTUAL-RUNTIME_initscripts = “”

Settings for apalis-imx8

MENDER_IMAGE_BOOTLOADER_BOOTSECTOR_OFFSET:apalis-imx8 = “0”
MENDER_BOOT_PART_SIZE_MB:apalis-imx8 = “64”
OFFSET_SPL_PAYLOAD:apalis-imx8 = “”
MENDER_STORAGE_DEVICE:apalis-imx8 = “/dev/mmcblk0”
MENDER_STORAGE_TOTAL_SIZE_MB:apalis-imx8 = “4096”
KERNEL_DEVICETREE:apalis-imx8 = “freescale/imx8qm-apalis-v1.1-ixora-v1.2.dtb”
MENDER_BOOT_PART = “${MENDER_STORAGE_DEVICE_BASE}1”
MENDER_DATA_PART = “${MENDER_STORAGE_DEVICE_BASE}4”
MENDER_ROOTFS_PART_A = “${MENDER_STORAGE_DEVICE_BASE}2”
MENDER_ROOTFS_PART_B = “${MENDER_STORAGE_DEVICE_BASE}3”
MENDER_UBOOT_AUTO_CONFIGURE = “1”

Append the Mender provided bootargs to tdxargs

the Toradex boot.scr will overwrite bootargs so we stash the context in tdxargs

MENDER_UBOOT_POST_SETUP_COMMANDS:append = " ; setenv tdxargs ${tdxargs} ${bootargs}; "

Make sure the Toradex boot script finds the overlays and overlays.txt file in

the /boot directory of the rootfs partition

MENDER_UBOOT_POST_SETUP_COMMANDS:append = " ; setenv overlays_file /boot/overlays.txt ; setenv overlays_prefix boot/overlays/ "

serveur

MENDER_SERVER_URL = “https://eu.hosted.mender.io
MENDER_TENANT_TOKEN = “my-server-token”
MENDER_DEMO_HOST_IP_ADDRESS = “my-adress-ip”

bitbake -e confirms correct values:

MENDER_BOOT_PART="/dev/mmcblk0p1"

MENDER_ROOTFS_PART_A="/dev/mmcblk0p2"

MENDER_ROOTFS_PART_B="/dev/mmcblk0p3"

MENDER_DATA_PART="/dev/mmcblk0p4"

The problem:

When an OTA update is triggered, it downloads the artifact correctly.

But it fails during the installation step with this error:

Payload: can not install Payload: … No match between boot and root partitions.

Also, fw_printenv gives errors:

Cannot read environment, using default
Cannot read default environment from file

My goal:

Get artifact updates to apply correctly on the Apalis iMX8.

Ensure U-Boot is Mender-compatible and that fw_env.config is configured properly.

Resolve the “No match between boot and root partitions” error.

Any help or guidance would be greatly appreciated!

Hi @Rani13958,

The problem you first need to solve is

info: Output (stderr) from command “fw_printenv”: Cannot read environment, using default
info: Output (stderr) from command “fw_printenv”: Cannot read default environment from file

As long as reading the u-boot environment from the running Linux instance fails, doing A/B updates is not possible.

Things to check:

  • is /etc/fw_env.config file present? If yes, does the content match the u-boot configuration?
  • if you stop during the boot process to access the u-boot console, how does the environment look like? Can you show the output of printenv?
  • make sure that the mender-setup script within the u-boot environment runs before boot
  • make sure that the resulting boot partition is accordingly passed to the kernel command line.

Greetz,
Josef

hi @TheYoctoJester

-Yes, the file /etc/fw_env.config is present.

-here is the output of the printenv:
“board_rev=v1.0 boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr} boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}${boot_syslinux_conf} boot_net_usb_start=usb start boot_prefixes=/ /boot/ boot_script_dhcp=boot.scr boot_scripts=boot.scr.uimg boot.scr boot_syslinux_conf=extlinux/extlinux.conf boot_targets=mmc1 mmc2 mmc0 usb0 dhcp bootcmd=run distro_bootcmd bootcmd_dhcp=devtype=dhcp; run boot_net_usb_start; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi; bootcmd_mmc0=devnum=0; run mmc_boot bootcmd_mmc1=devnum=1; run mmc_boot bootcmd_mmc2=devnum=2; run mmc_boot bootcmd_usb0=devnum=0; run usb_boot bootcount=1 bootdelay=1 bootlimit=1 commit_atf=3c1583b commit_mkimage=3bfcfccb commit_scfw=6638c032 commit_secofw=c9de51c0 console=ttyLP1 cpu=armv8 distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done eth1addr=00:14:2d:fd:2e:a8 ethaddr=00:14:2d:ed:2e:a8 fastboot_dev=mmc0 fdt_addr_r=0x9d400000 fdt_board=eval fdtcontroladdr=fd676b30 fdtfile=imx8qm-apalis-v1.1-ixora-v1.2.dtb initrd_addr=0x83800000 initrd_high=0xffffffffffffffff ipaddr=192.168.10.2 kernel_addr_r=0x95400000 kernel_comp_addr_r=0xf0000000 kernel_comp_size=0x08000000 loadaddr=0x95400000 loadm4image_0=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${m4_0_image} loadm4image_1=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${m4_1_image} m4_0_image=m4_0.bin m4_1_image=m4_1.bin m4boot_0=run loadm4image_0; dcache flush; bootaux ${loadaddr} 0 m4boot_1=run loadm4image_1; dcache flush; bootaux ${loadaddr} 1 mender_altbootcmd=if test ${mender_boot_part} = 2; then setenv mender_boot_part 3; setenv mender_boot_part_hex 3; else setenv mender_boot_part 2; setenv mender_boot_part_hex 2; fi; setenv upgrade_available 0; saveenv; run mender_setup”

Hi @Rani13958,

Judging from that, the Mender setup scripts are not included in the boot process. See the documentation at Manual U-Boot integration | Mender documentation.

As inspiration you can look at the patches in meta-mender-community/meta-mender-toradex-nxp/recipes-bsp/u-boot-distro-boot at kirkstone · mendersoftware/meta-mender-community · GitHub, as from what I can tell the Toradex boards primarily use the boot.scr mechanisms.

Greetz,
Josef