How to tell u-boot to use an alternative rootfs?

I am trying to change the active rootfs partition from userspace for my apalis-imx8. I modified the blockdevs section in the tezi configuration file image.json to include a second rootfs partition:

    "blockdevs": [
        {
            "name": "mmcblk0",
            "partitions": [
                {
                    "partition_size_nominal": 48,
                    "want_maximised": false,
                    "content": {
                        "label": "BOOT",
                        "filesystem_type": "FAT",
                        "mkfs_options": "",
                        "filename": "my-image-swupdate-apalis-imx8.bootfs.tar.xz",
                        "uncompressed_size": 12.67578125
                    }
                },
                {
                    "partition_size_nominal": 512,
                    "want_maximised": true,
                    "content": {
                        "label": "ROOTFS1",
                        "filesystem_type": "ext4",
                        "mkfs_options": "-E nodiscard",
                        "filename": "my-image-swupdate-apalis-imx8.tar.xz",
                        "uncompressed_size": 194.1328125
                    }
                },
                {
                    "partition_size_nominal": 512,
                    "want_maximised": true,
                    "content": {
                        "label": "ROOTFS2",
                        "filesystem_type": "ext4",
                        "mkfs_options": "-E nodiscard",
                        "filename": "my-image-swupdate-apalis-imx8.tar.xz",
                        "uncompressed_size": 194.1328125
                    }
                }            ]
        },
        {
            "name": "mmcblk0boot0",
            "erase": true,
            "content": {
                "filesystem_type": "raw",
                "rawfiles": [
                    {
                        "filename": "imx-boot",
                        "dd_options": "seek=0"
                    }
                ]
            }
        }
    ]

I edited the u-boot-initial-env-sd script and added the following lines :

rootfspart=2
bootargs=root=/dev/mmcblk0p${rootfspart} rdinit=/bin/kinit rw single

I am able to set the rootfspart variable to 3 using fw_setenv and can verify it is set, but the root partition isn’t changing after a reboot.
What am missing here?

I figured it out. No need to change the default uboot env file at all. There is already a variable called root_part that u-boot uses for that purpose.