How to provision a device with an existing artifact

Hi.

I’m planning to move from Balena to Mender now. Then I’m looking for how to provision a device with an existing artifact.

I’m using Raspberry Pi 4 and Yocto for building OS. What I want to do is run our application code soon after I insert the flashed SD card. The following command is what I do in Balena.

balena preload balena-rpi4.img --fleet my-fleet --commit my-commit

I was thinking I could integrate my existing artifact into my custom image which I built with Yocto somehow but I couldn’t find the way.

Any help would be useful. Thank you in advance.

Hi @atsss,

Why not just add your application to the Yocto build? Write a recipe for it, so it is integrated straight away. No magic needed. :slight_smile:

Greetz,
Josef

Hi @TheYoctoJester

Thank you for your response.

I was expecting any solution provided by Mender because I guess it’s a common issue for embedded systems.

Are there any ways prepared by Meneder itself like passing a parameter or things like that?

Thanks

Ats

Hi @atsss,

No, there are no means for an Artifact to be magically Pre-installed. The artifact format is extremely versatile, it can

  • include arbitrary scripts that execute, including network calls and hardware dependent operations
  • be of a type that the Mender client does not handle itself, for example if you use an Update Module

Hence we do not provide a way to do an offline install. If you are Yocto based and your Artifact is so simple that it does allow an offline install, then writing a recipe to unpack and install the files is very easy, and offers the additional benefit of reproducibility. If you need to add information for dependency tracking, then you can also pass that to the final artifact creation by using https://docs.mender.io/operating-system-updates-yocto-project/variables#mender_artifact_extra_args

Alternatively, you can automate the first installation through the device authorization webhook

Greetz,
Josef

Hi @TheYoctoJester

Thank you for your answer.

Sounds like adding my custom layer is a simple way.

Thank you so much

Ats

1 Like