Application update in i.MX8M Mini

Hi Mender Team,

I was validating and going through the mender update module in i.MX8M Mini EVK. I am following https://docs.mender.io/artifact-creation/create-a-custom-update-module for an application update. I have uploaded the artifact in the hosted server and then I got below error in the Update stage.

“error: update install failed: installer: failed to read and install update: reader: unsupported version: 3”

Can anyone help me with this?

Regards,
Kunal

Hi @Kunal, what module type did you create? Do you have an appropriate update module installed in your EVK board to handle the chosen payload type?

What Mender client version do you have running on the target?

What OS/Distro are you running?

Drew

Hi @drewmoseley,

I have used this link to create a web-file type module. I have done the setup from this link. Do I explicitly need to install the update module after doing the yocto setup?

Below is the mender client version output in my imx8mmevk.
"root@imx8mmevk:~# mender --version
INFO[0000] Configuration file does not exist: /var/lib/mender/mender.conf module=config
INFO[0000] Loaded configuration file: /etc/mender/mender.conf module=config
INFO[0000] Mender running on partition: /dev/mmcblk1p3 module=main
1.7.1
runtime: go1.9.7
"

Regards,
Kunal

Yes, you need to ensure that the /usr/share/mender/modules/v3/web-file file exists on your target and is executable.

However, in your case the first issue is that you are using Mender v1.7 which does not have support for Update modules. The sumo branch was released before Mender v2.0 so the default version of Mender in that branch is still 1.7. You need to add the following to your local.conf to build with newer versions:

PREFERRED_VERSION_pn-mender-client = “2.2.1”
PREFERRED_VERSION_pn-mender-artifact = “3.3.1”
PREFERRED_VERSION_pn-mender-artifact-native = “3.3.1”

Drew

Yes, I have already added /usr/share/mender/modules/v3/web-file and made it executable as mentioned in mender steps.

Regarding the mender client version, I found that i.MX8M Mini has a mender_version.bb recipe file for a mender client. So, I added PREFERRED_VERSION_pn-mender = “2.1.2”.

Similarly, for mender-artifact the I added 3.1.1 version, as it is the latest available, I added PREFERRED_VERSION_pn-mender-artifact = “3.1.1”.

But while compiling there is an error. I don’t understand why there is a difference of names in mender and mender client and why the compilation is showing error. Below are the error logs that might be helpful.
"
ERROR: ExpansionError during parsing /home/ota/mender-imx/sources/meta-mender/meta-mender-core/recipes-mender/mender-artifact/mender-artifact_git.bb

Traceback (most recent call last):
File “/home/ota/mender-imx/sources/poky/bitbake/lib/bb/data_smart.py”, line 412, in DataSmart.expandWithRefs(s="{@mender_version_from_preferred_version(d, '{SRCPV}’)}", varname=‘PV’):
try:
> s = expand_var_regexp.sub(varparse.var_sub, s)
try:
File “/home/ota/mender-imx/sources/poky/bitbake/lib/bb/data_smart.py”, line 111, in VariableParse.var_sub(match=<_sre.SRE_Match object; span=(45, 53), match=’${SRCPV}’>):
else:
> var = self.d.getVarFlag(key, “_content”)
self.references.add(key)
File “/home/ota/mender-imx/sources/poky/bitbake/lib/bb/data_smart.py”, line 794, in DataSmart.getVarFlag(var=‘SRCPV’, flag=’_content’, expand=True, noweakdefault=False, parsing=False):
cachename = var + “[” + flag + “]”
> value = self.expand(value, cachename)

File “/home/ota/mender-imx/sources/poky/bitbake/lib/bb/data_smart.py”, line 436, in DataSmart.expand(s=’${@bb.fetch2.get_srcrev(d)}’, varname=‘SRCPV’):
def expand(self, s, varname = None):
> return self.expandWithRefs(s, varname).value

File “/home/ota/mender-imx/sources/poky/bitbake/lib/bb/data_smart.py”, line 426, in DataSmart.expandWithRefs(s=’${@bb.fetch2.get_srcrev(d)}’, varname=‘SRCPV’):
except Exception as exc:
> raise ExpansionError(varname, s, exc) from exc

bb.data_smart.ExpansionError: Failure expanding variable SRCPV, expression was ${@bb.fetch2.get_srcrev(d)} which triggered exception FetchError: Fetcher failure: The SRCREV_FORMAT variable must be set when multiple SCMs are used.
"

Regards,
Kunal

You need to add PREFERRED_VERSION_pn-mender-artifact-native = “3.1.1” as well.

Also, make sure the quotes are regular " quotes, it looks like here on Mender Hub some fancy “” style quotes have been used.

Yes, Thank you. I was writing the native artifact with a different versions and so is the version difference gives error. I verified a simple application update.

I have more query with partition layout. Why we have a bootloader image in the first partition? I mean updating bootloader is not possible,so why have we kept the binary of bootloader in 1st partition and removed the zImage and dtb from that partition?

Thank you very much in advance.

Regards,
Kunal

Indeed, updating the bootloader is not possible. Mender never updates anything on the 1st partition, that’s why it’s a good place for the bootloader. The kernel, on the other hand, is stored on the dual rootfs partitions, the 2nd and 3rd partitions, and hence can be updated by Mender.

Understood. But I do believe it is not required to keep them in the first partition. Though it is again design choice. That is okay. I was facing an application update that you resolved earlier and I am thankful to that. So, the issue was version difference for mender client. Does this mean we won’t be able to update the mender client itself using OTA? I saw there is a version file in the artifact which is comparing the version of the mender in workstation with version mender in the device. Is it correct?

Regards,
Kunal

If you have not already come across this, there is some useful information here on how to plan such upgrades.