"Error executing prepare script" when installing Tezi Image

Good evening,

Over the past year I have been developing a custom image for in-house hardware based on the imx8mm SOM. The image uses TorizonCore 5.7.0 and is built with Yocto Dunfell.

I have installed images with the Easy Installer probably 200 times at this point, but today we are stuck on a new issue:


The recent change that has caused this issue is the addition of Mender, using the steps found here: Toradex Verdin iMX8M Mini - Board Integrations / Yocto Project - Mender Hub

I have followed all of those steps exactly and made modifications to my .conf files and relevant recipes. The image builds with no abnormal warnings and no errors, but fails to install with Easy Installer.

Other images can be installed with no issues, as well as another image which uses Mender that was created for a separate project (by another company, meaning I don’t have access to their Yocto build environment).

Any advice or follow up questions are appreciated. Thank you.

These are the contents of prepare.sh (line numbers added by me):

1.  #!/bin/sh
2.  #
3.  # (c) Toradex AG 2016
4.  #
5.  # Empty in-field hardware update script
6.  #
9.  BOARD_REV=$2
10. SERIAL=$3
13. error_exit () {
14. 	echo "$1" 1>&2
15. 	exit 1
16. }
18. exit 0

It almost seems like it’s not using bash to execute the script, since it throws errors about whitespace and argument references.

We were able to successfully install the image by removing all extra whitespace lines and by commenting out the error_exit function. Extra whitespace also had to be removed from wrapup.sh

However, this image still does not boot, which means that the root cause of these scripts behaving weirdly might still be buried somewhere else. I will leave another comment if we come across anything that seems relevant.

Greetings @spencerarrasmith,

The original instructions from Mender were how to integrate their software with our reference BSP. But you say you’re integrating it with our TorizonCore images, is that correct?

In which case I’m not sure if the instructions apply or if additional steps would be required for a clean integration. Also on a side-note are you trying to integrate Mender for the OTA update capabilities?

Best Regards,

This ended up being two dumb issues. Because I am building the image on a Linux server that is essentially offline, I am forced to download dependencies like the meta-mender-community layer on my local machine and scp them over to the build server. Because Windows likes to screw with whitespace, I tried to be as diligent as I could to use WSL and MINGW when handling these files, but somehow the whitespace of the Mender layer files still got screwed up (classic nl → cr nl issue). Fixing the whitespace resolves the script errors.

The non-bootable image was due to a hard-coded .dtb file in the local.conf.append files provided by Mender (the instructions have you append these lines to your image’s local.conf), which attempted to load a .dtb that didn’t exist.

Lessons learned:

  • Windows is evil
  • Don’t blindly follow installation steps

Their setup steps work great, with that minor change to specify the correct .dtb. I am only integrating the offline (free) capabilities for now, and it seems to work perfectly in our image.