Hi,
we have 2 different NXP imx7 based projects, both are using mender. And we have the same issue with both of them:
When booting the devices initially, u-boot writes the environment to mmc. u-boot and uboot-env are outside a partition, directly in memory.
But it looks like the offset of the first partition ( in our case /uboot which is not used) is overwritten by the uboot-env.
This causes mount problems during linux boot as the partition is corrupted.
My workaround to patch this behaviour: adding parameter --offset 32768
to line meta-mender/mender-part-images.bbclass at dunfell · mendersoftware/meta-mender · GitHub
With this patch the partition layout changes from (output of fdisk -l)
Disk /dev/mmcblk0: 7.29 GiB, 7822376960 bytes, 15278080 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x33c68b61
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 * 32768 65535 32768 16M c W95 FAT32 (LBA)
/dev/mmcblk0p2 65536 1064959 999424 488M 83 Linux
/dev/mmcblk0p3 1064960 2064383 999424 488M 83 Linux
/dev/mmcblk0p4 2064384 4161535 2097152 1G 83 Linux
to
Disk /dev/mmcblk0: 7.29 GiB, 7822376960 bytes, 15278080 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xc5ed08c5
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 * 65536 98303 32768 16M c W95 FAT32 (LBA)
/dev/mmcblk0p2 98304 1097727 999424 488M 83 Linux
/dev/mmcblk0p3 1097728 2097151 999424 488M 83 Linux
/dev/mmcblk0p4 2097152 4194303 2097152 1G 83 Linux
As you can see, the starting point of the first partition is moved back.
Do you have any idea whats going wrong here? How to avoid conflicts between uboot-env and first partition?