Custom update module for A/B partitioning, ArtifactCommit fails

Hello Friends!

Due to hardware choise, buildsystem (Buildroot) and the resulting complication I was not able to perform Manual U-Boot integration and decided to write custom update module for A/B partitioning. A mender artefact was created that contains only a working .ext4 rootfs.

On my board the eMMC and SSD seem to be on the same bus. This result in random device name change within reboots. One time its /dev/mmcblk0 and other times its /dev/mmcblk1. Additionally when using CONFIG_ENV_IS_IN_MMC I was not able to read the U-Boot environment with /etc/fw_env.config. Instead I use CONFIG_ENV_IS_IN_EXT4 and save the uboot.env on the data partition.

The update modules uses ddrescue to write rootfs.ext4 to the B partition and afterwards will resize the filesystem to fit the whole partition.

Working mender client 3.4.0 and update module with tools ddrescue, e2fsck, resize2fs, fw_printenv, fw_setenv

The update module is doing its work as expected. In the ArtifactCommit stage the mender client fails. and resulting in a INCONSISTENT update. It seems after reboot the mender client is creating a false negative. 2023-07-12 12:30:02 +0000 UTC error: Mender shut down in state: update-commit. Refer to the logs for more details. I left some comments there.

Mender client logs that are generated from the dashboard after the update fails.
Update module

Thanks in Advance!