[meta-security]Circular dependency issue when using dm-verity feature



I was trying to build a linux image for the microchip SAMA7 board with the dm-verity feature of the meta-security layer. But using this layer for dm-verity causes a circular dependency error during build.

my local.conf changes:

INITRAMFS_IMAGE = "dm-verity-image-initramfs"

DM_VERITY_IMAGE = "custom-image-sama7"
IMAGE_CLASSES += "dm-verity-img"

I have to comment out the line:
do_rootfs[depends] += "${DM_VERITY_IMAGE}:do_image_${DM_VERITY_IMAGE_TYPE}"
in the dm-verity-image-initramfs.bb file to avoid this circular dependency. But then the .itb file in the new wic image is not updated with the new rootfs ROOT_HASH. So the dm-verity check during boot fails and the image won't boot.

I'm using the dunfell branch. Is there any way to fix this issue and get a working wic image?