How to build dev-image for torizon-minimal

Hello

We have started to make a torizon-minimal image using the toradex-manifest.

We want to build a devevelopment image, where we can add stuff that will only be used for our development workflow, but should not be available in the production image.

Using Yocto I would create two image files os-prod.bb and os-dev.bb, but since we are building the torizon-minimal.bb we can’t use that approach.

I tried using a :dev override, but find it quite convoluted and difficult to use.

What approach would you suggest for building these two images?

Hi, I’m the Toradex AI Assistant.

I might make mistakes or occasionally get you wrong. Our support team will step in if needed.


Creating Development and Production Images for Torizon OS

Based on the Torizon OS build documentation, I recommend creating custom image recipes that inherit from the base torizon-minimal image rather than trying to modify the original recipe directly (1).

Recommended Approach

Create two separate image recipes in your custom layer:

  1. Development Image: Create torizon-minimal-dev.bb that includes additional development tools
  2. Production Image: Create torizon-minimal-prod.bb that maintains the minimal footprint

Implementation Steps

  1. Set up your custom layer structure as described in the customization documentation (1):

    • On Torizon OS, all your custom layers must be version controlled by Git, due to how layer revision information is included with OSTree (1)
  2. Create your development image recipe (torizon-minimal-dev.bb):

    require recipes-images/images/torizon-minimal.bb
    
    IMAGE_INSTALL:append = " development-tools debugging-packages"
    
  3. Create your production image recipe (torizon-minimal-prod.bb):

    require recipes-images/images/torizon-minimal.bb
    
    # Keep minimal - only add production-specific packages if needed
    

Available Base Images

The Torizon OS build system provides several base images you can inherit from (1):

Image Description
torizon-minimal Torizon OS reference minimal image without a container engine
torizon-docker Default image with Docker container engine
torizon-podman Experimental image using Podman instead of Docker

Build Process

You can then build either image using the standard bitbake commands:

bitbake torizon-minimal-dev

or

bitbake torizon-minimal-prod

This approach gives you clean separation between development and production builds while leveraging the existing Torizon OS infrastructure and maintaining compatibility with OSTree-based updates (1).

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

Greetings @i.staehli,

In our Yocto meta-layer we actually do have a “dev” image of sorts. As you can see here: meta-toradex-torizon/recipes-images/images/torizon-minimal-dev.bb at scarthgap-7.x.y · torizon/meta-toradex-torizon · GitHub

You could do something like this. Just have a recipe for your dev image with all the development tools you need. Then in that image require the non-dev image.

Best Regards,
Jeremias

Thanks!

We were using a .bbappend and I thought it would not be possible to include the torizon-minimal recipe in our own image.

Glad we were able to provide a suggestion.

We were using a .bbappend and I thought it would not be possible to include the torizon-minimal recipe in our own image.

Yeah as shown, you can actually include other *.bb recipe files. It might not be “traditional” in the Yocto-sense, but it should work.

Best Regards,
Jeremias