# Custom update module for A/B partitioning, ArtifactCommit fails

**URL:** <https://hub.mender.io/t/custom-update-module-for-a-b-partitioning-artifactcommit-fails/6011>\
**Category:** General Discussions\
**Created:** [July 17, 2023, 9:18am UTC](https://hub.mender.io/t/custom-update-module-for-a-b-partitioning-artifactcommit-fails/6011 "2023-07-17T09:18:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mister\_kanister](https://avatars.discourse-cdn.com/v4/letter/m/8edcca/32.png) [@mister\_kanister](https://hub.mender.io/u/mister_kanister)\
**Post date:** [July 17, 2023, 9:18am UTC](https://hub.mender.io/t/custom-update-module-for-a-b-partitioning-artifactcommit-fails/6011/1 "2023-07-17T09:18:38Z")

</div>

Hello Friends!

Due to hardware choise, buildsystem (Buildroot) and the resulting complication I was not able to perform [Manual U-Boot integration](https://docs.mender.io/operating-system-updates-yocto-project/board-integration/bootloader-support/u-boot/manual-u-boot-integration#u-boot-features) 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](https://pastebin.com/vLt5Tihk) that are generated from the dashboard after the update fails.  
[Update module](https://pastebin.com/NTjgaCE6)

Thanks in Advance!
