Label for rootfs A & B partition

Hi,
I have a yocto build that use meta-mender-kernel layer. I want to set this variables like this:

MENDER_STORAGE_DEVICE = ""
MENDER_BOOT_PART = "/dev/disk/by-label/BOOT"
MENDER_ROOTFS_PART_A = "/dev/disk/by-label/rootfsa"
MENDER_ROOTFS_PART_B = "/dev/disk/by-label/rootfsb"
MENDER_DATA_PART = "/dev/disk/by-label/data"

If I set the variable like this:

MENDER_STORAGE_DEVICE = "/dev/sda"
MENDER_STORAGE_DEVICE_BASE = "${MENDER_STORAGE_DEVICE}"
MENDER_BOOT_PART = "${MENDER_STORAGE_DEVICE_BASE}1"
MENDER_ROOTFS_PART_A = "${MENDER_STORAGE_DEVICE_BASE}2"
MENDER_ROOTFS_PART_B = "${MENDER_STORAGE_DEVICE_BASE}3"
MENDER_DATA_PART = "${MENDER_STORAGE_DEVICE_BASE}4"

I’ve found that /dev/sda1 and /dev/sda4 have respectively BOOT label and data label How can I add a label for rootfs partitions?

I believe you can’t. The reason is that it’s not safe to refer to rootfs labels. They will be destroyed every time you make an update, and two partitions can even have the same label depending on what updates you have previously deployed.

Thanks @kacf for the reply. My goal is to make a build that can works with different disk type (sd, nvme, mmcblk, etc…). Using mender-partuuid is not a option because it is not supported in meta-mender-kernel.