How to say mender client that artifact contains ubi image?

Hello, I am trying to integrate mender with OpenWRT. I can’t understand where should I set parameter about ubi layout, because mender doesn’t understand artifact ubi image.ubiupdatevol command works normally.
I have nand flash, ubi layout and 5 ubi volumes:

  1. u-boot-env-1
  2. u-boot-env-2
  3. rootfsA(squashFS)+FIT image (kernel+dtb)
  4. rootfsB(squashFS)+FIT image (kernel+dtb)
  5. rootfs_data partition

It successfully connects to the mender server, can see mender-artifact and works well. But when I want to update it downloads artifact and tries to update it as a simple partition, not ubi:

time="2022-01-03T12:34:37Z" level=warning msg="Could not resolve path link: overlayfs:/overlay Attempting to continue"
time="2022-01-03T12:34:37Z" level=info msg="Opening device \"/dev/ubi0_3\" for writing"
time="2022-01-03T12:34:37Z" level=info msg="Native sector size of block device /dev/ubi0_3 is 126976 bytes. Mender will write in chunks of 2031616 bytes"
time="2022-01-03T12:34:38Z" level=error msg="Failed to write 37814784 bytes to the new partition"
time="2022-01-03T12:34:38Z" level=info msg="The optimized block-device writer wrote a total of 2 frames, where 2 frames did need to be rewritten (i.e., skippe
time="2022-01-03T12:34:38Z" level=error msg="Artifact install failed: Payload: can not install Payload: openwrt-layerscape-armv7-fsl_ls1021a-squashfs-aeration not permitted"

I create artifact with command:
mender-artifact write rootfs-image -n fsl_ls1021a-1641064824 -t fsl_ls1021a --software-version r51-bba1547a513 -f openwrt-layerscape-armv7-fsl_ls1021a-squashfs-artifact-1641064824.mender -o
openwrt-layerscape-armv7-fsl_ls1021a-squashfs-artifact-1641064824.mender - ubi volume image with rootfs(squashFS)+FIT image (kernel+dtb)

I found the problem, it is mender.conf file. There should be ubi0_2 or ubi0_3 without dev prefix.

1 Like