I’m new to mender and trying to run it in conjunction with a demo server on an avnet imx8 board. After following the instructions in the docs and fixing some other build errors, the build is completing and the built image boots on the board. However, whenever I try to perform an update or mender setup or mender bootstrap I receive the following error:
Failed to read the current active partition: No match between boot and root partitions.
In following the steps from the integration checklist, I noticed that in my /etc/fw_env.config the wrong device is referenced. It initially referenced /dev/mmcblk0 so I changed it to reference the proper device which is /dev/mmcblk1 (this device is shown in the first line of output after running mount). After this change the error expands to the following:
ERRO[0000] Failed to read the current active partition: No match between boot and root partitions.: Failed mender_saveenv_canary check. There is an error in the U-Boot setup. Likely causes are: 1) Mismatch between the U-Boot boot loader environment location and the location specified in /etc/fw_env.config. 2) ‘mender_setup’ is not run by the U-Boot boot script: exit status 1
I am suspecting that it is cause number 2. When I interrupt the board’s boot to enter u-boot config, the printenv command yields entirely different variables than those that appear when I run fw_printenv in the linux environment. So I don’t think that the system is using the mender-modified version of u-boot or it for some reason isn’t getting modified.
It’s somewhat ‘hidden’ in the last paragraph, but this is a Yocto build that you set up, right? So I would suggest to start out by diagnosing the bootloader in use. An idea on how to get going would be bitbake -e virtual/bootloader | less and see which u-boot is being put to use. If you do not see the Mender integration kicking in there, then this is probably the culprit.
If you can link to the BSP/Documentation you used for the integration build then I can also have a look.
Thanks for the reply. I realize now I didn’t make this very clear but yes this is a yocto build using the zeus branches of the meta-mender-core and meta-mender-demo layers. I followed this guide to integrate mender with the build in addition to these steps for u-boot.
That bitbake command you gave gives a lot of output but from what I can glean from it the build is using the u-boot-imx bootloader which is the one we made a bbappend for so that it would use mender. Is there something in there I can look at so make sure it is specifically doing the mender stuff to the bootloader?
I would probably check if the mender layers are patching the necessary uboot related recipes. You can use bitbake-layers show-appends command and/or bitbake -c patch <recipe> and check the patched sources to make sure mender integration is inplace.
Use bitbake -vn virtual/bootloader to check which bootloader recipe your build is using.
The other recipe of note of u-boot-distro-boot as there’s some mender specific setup there as well
And according to bitbake -vn virtual/bootloader | grep boot, the right bootloader is being used:
NOTE: selecting u-boot-imx to satisfy virtual/bootloader due to PREFERRED_PROVIDERS
NOTE: selecting u-boot-imx to satisfy runtime u-boot-imx-dev due to PREFERRED_PROVIDER_virtual/bootloader = u-boot-imx
NOTE: selecting u-boot-imx to satisfy runtime u-boot-imx due to PREFERRED_PROVIDER_virtual/bootloader = u-boot-imx
And bitbake couldn’t find anything when I searched that last recipe you mentioned. Maybe that is my issue? Also for clarity, this is the patch I am applying to u-boot-imx:
So is there something wrong with my append file or is there more I need to add to it? Or should I try to track down why I don’t have the u-boot-distro-boot recipe? Thanks again for any help here.