Generate multiple images at the same time in Yocto

A common task when using Yocto is to create multiple Linux images for a single target’s load. A very simple example is an emergency partition for fallback.

The easiest way is to go to your image recipe and add:

do_rootfs[depends] += "my-other-image:do_image_complete

In plain English, this means the task do_rootfs now depends on my-other-image recipe’s image_complete task. All images that inherit the image.bbclass will have the do_rootfs and do_image_complete task, so it is safe for you to depend on it.

Now every time you build your main image you also build “my-other-image“.

PS: A kind of top-level “meta” image recipe could be created that installs nothing and just depends on images so that IMAGE_CMD or wic takes the images and generates a target readable blob. Maybe one day I will post an example of such a recipe.

PSS: If your are thinking of fallback do not invent the wheel and have a look at RAUC.

2 thoughts on “Generate multiple images at the same time in Yocto

  1. How to sequence the tasks in a recipe in YOCTO?

    I want to first clean an image and then install it using another image.

    I first want my recipe to do this,

    do_rootfs[depends] += ” my-image:do_clean”

    and then move on to do this, in this order,

    do_rootfs[depends] += ” my-image:do_image_complete”

    In simple, how can I sequence tasks in bb files


    1. Hey redpineapplesite. You do not need to manage the cleaning of recipes or images manually unless you are doing something in a way bitbake does not keep track of. By default bitbake will clean things if it needs. Is there a case where you only see your desired output after you run the steps you mention? If so something else is wrong. I suggest you to come to the #yocto IRC chat room where you can expose your issues in more detail. You can reach us Cheers


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s