First steps with Torizon

Hello,
I and my team worked in 2 past projects with Toradex building a Linux distribution with Yocto Project.
Currently we started to work in a new project with verdin imx8m-plus SOM.
We are thinking in use Torizon instead of Yocto, for that reason we are learn about Torizon and try to compare both and select the right one for us.
I followed the steps in quick start to use and get an aproach about Torizon. I could customize Torizon Os image with Trizon build tool follwing TorizonCore Builder Tool - Customizing Torizon OS Images | Toradex Developer Center
I could set a custom splashscreen and change display output to Mezzanine lvds.
I could running our own qt5 app building a Docker image based on qt5-wayland-vivante.
I have a list of questions about TorizonOs and Yocto selection:

1- Customize kernel and u-boot: Which is the way to do the kernel and u-boot cutomization? In Yocto we changed the sources and apply patches with recipes, with Torizon build tool is possible to do this? With the kernel I think that is not rocker science due to that we can add a dts custom file.
With u-boot how can I do that?
2- For the documentation that I read the concept of TorizonOS is to run apps dockerized, is that correct?
Which is the correct way to add qt app in the docker image?
3- Which version of qt libraries are installed in qt5-wayland-vivante docker image? I think that if doesnt give the version the latest version is installed, is that correct?

For your opinion if we have really good Yocto skills is necesary to change with TorizonOS.

Greetings @emmaperea

First of all glad to hear you’re giving Torizon a try despite already having experience with Yocto.

Which is the way to do the kernel and u-boot cutomization? In Yocto we changed the sources and apply patches with recipes, with Torizon build tool is possible to do this? With the kernel I think that is not rocker science due to that we can add a dts custom file.
With u-boot how can I do that?

This is a bit complex but the general answer is “no”. But let me explain. As you noted device trees can be customized though this is a bit different than the kernel since device trees produce their own binary separate from the kernel binary. However if you actually want to modify the kernel sources itself and then compile a completely new kernel, that is not possible with TorzionCore Builder, same with U-Boot.

Now it wouldn’t be completely impossible to make the TorizonCore Builder tool do this. That said, we are not trying to re-invent the wheel with what Yocto already does. Yocto is already a powerful build system and in many cases it’s probably more “proper” to edit the kernel and such there then try to edit these outside of the build system.

Out of curiosity what kind of kernel/u-boot customizations are you trying to make?

For the documentation that I read the concept of TorizonOS is to run apps dockerized, is that correct?
Which is the correct way to add qt app in the docker image?

Correct. For adding apps to a docker image, well there’s a couple of ways you can do this. We do provide an IDE extension for Visual Studio Code that can help in this process: IDE Extension | Toradex Developer Center

If you want to tackle this more manually, the idea would be to add your application dependencies to a container image, build the application in the container image. Ship a container image with your application built in. If you want more kind of raw examples of how you would construct a container for an application you can look at our repository of samples here: GitHub - toradex/torizon-samples: All sample code related to TorizonCore project.

There are many samples here each with their own Dockerfile to build the container image for that containerized application.

Which version of qt libraries are installed in qt5-wayland-vivante docker image? I think that if doesnt give the version the latest version is installed, is that correct?

If you are using our container images, then we base our container images on Debian. For Torizon 6.X we’re using Debian bookworm. Therefore you can just check what the Debian package feeds provide for Debian bookworm, which looks like version 5.15.8: Debian -- Details of package qtbase5-dev in bookworm

For your opinion if we have really good Yocto skills is necesary to change with TorizonOS.

I would say it’s not “necessary” at all. Really this would be like asking should I boil water on the stove or with an electric kettle. Sure the process might differ here and there but in the end you get to the same end result. Obviously Torizon would have more appeal if one didn’t have any knowledge of Yocto whatsoever, though that is not the case for you. That said we have customers who like you are knowledgeable about Yocto, but still use Torizon OS. It’s more of a preference than anything I would say.

Now just to turn the question back on you. For what reason are you and your team considering Torizon if you are already good with Yocto?

Best Regards,
Jeremias

Hello @jeremias.tx ,
Thank you very much for response.

Out of curiosity what kind of kernel/u-boot customizations are you trying to make?

In past projects we had to change pins functionality, these changes we made It in device-tree so I supossed that as you said we could use TorizonBuilder.

Also we had to modify a driver source, for example ad7879 touchscreen driver to make a sound when press the display. Another change in kernel source was adding a custom driver as a kernel module.

In u-boot we had to change u-boot source to turn on gpios when the system is power-up, adding code in int board_init(void) function.

Yocto is already a powerful build system and in many cases it’s probably more “proper” to edit the kernel and such there then try to edit these outside of the build system.

Those changes that I said previously in kernel and u-boot sources is better to make with Yocto as the same way that we just already made in the past projects?

Now just to turn the question back on you. For what reason are you and your team considering Torizon if you are already good with Yocto?

We wanted to compare the use of TorizonOS and Yocto to detect the pros and cons.

In past projects we had to change pins functionality, these changes we made It in device-tree so I supossed that as you said we could use TorizonBuilder.

Correct. If it’s purely device tree changes then that can be easily captured and integrated by Torizon Builder.

Also we had to modify a driver source, for example ad7879 touchscreen driver to make a sound when press the display.

Okay this part is tricky, since you’re modifying existing driver code in the kernel. Torizon Builder can compile and integrate external code as kernel modules: Building External Kernel Modules With Torizon | Toradex Developer Center

Though this is usually for things like out of kernel code and such. Using this to modify code that already exists in the kernel is pretty messy. Since you’d need a way to tell the system to use your modified driver and not the default driver.

In u-boot we had to change u-boot source to turn on gpios when the system is power-up, adding code in int board_init(void) function.

For U-Boot there’s no way to make modifications with Torizon Builder unfortunately.

Those changes that I said previously in kernel and u-boot sources is better to make with Yocto as the same way that we just already made in the past projects?

In my opinion yes. Torzion Builder is not a build system like Yocto. You’d have a hard time maintaing such changes outside of the build system, especially if you need to update the version and everything needs to be re-based and re-synced.

Torizon Builder is more for minor changes that can be easily maintained standalone from the build system. Things like device trees are simple since they’re somewhat separate.

We wanted to compare the use of TorizonOS and Yocto to detect the pros and cons.

I see, well thank you for taking the time to experiment.

Best Regards,
Jeremias

Ok,
For that I understand we can use TorizonOS and if We need to make a u-boot or kernel source change we could use Yocto to customize and if we need other change we could use torizon builder, is that ok?

I have some questions about qt5 app and how to add in OS image:
I know that Torizon offer tools for app develop, for example the IDE extension that helps to run and debbug the app directly in the target. I could follow the documentation and I coud set the targen in VS and run the python app example but I couldn’t find a c++ qt5 template to build and run my custom app so I cross compiled the app manauly and then copy the binary in the target. As I said in the first post I build a Docker image with qt5-wayland-vivante as base and I added the dependecies that Our app need. Inside the target I run my custom docker image could execute my app succesfully.
My question here es how can I add the docker image with my app and its dependecies in my Custom TorizonOS image to flash the system in SOMs production?

For that I understand we can use TorizonOS and if We need to make a u-boot or kernel source change we could use Yocto to customize and if we need other change we could use torizon builder, is that ok?

Yeah that should be okay. As I said before our goal isn’t to replace Yocto in it’s entirety. In fact Yocto can be complimentary to what we do with Torizon.

I could follow the documentation and I coud set the targen in VS and run the python app example but I couldn’t find a c++ qt5 template to build and run my custom app so I cross compiled the app manauly and then copy the binary in the target.

The templates we use for our extension are open-source and community driven: GitHub - toradex/vscode-torizon-templates: VS Code Torizon Integrated Development Environment Templates

As you can see while we do provide and maintain some templates personally, many were created through community contributions.

My question here es how can I add the docker image with my app and its dependecies in my Custom TorizonOS image to flash the system in SOMs production?

If you have your custom docker image created you can pre-load it onto Torizon OS via the Torzion Builder tool: Pre-provisioning Docker Containers onto a Torizon OS image | Toradex Developer Center

This will bake your container images into the OS image by default. That way when you flash the image the container images will already be available on the system without the need for an initial download. As a side-note for this process to work you need to push your container images to some container registry like Docker Hub or something similar.

Best Regards,
Jeremias

Hello,
I still learning about Torizon and its tools and features that can help in our projects.
I follow this thread to ask about Torizon but if you think that is better to create a new thread please tell me and I create a new one.

First, as I said previously we consider necessary to learn and understand what is Torizon and what things can Torizon offers us.

One of the features that Torizon offer is the use of docker images to run our app. If we decide to don’t use dockerized app we can use TorizonOS anyway?

One of the things that we seriously consider is packages os updater, offline and OTA updates. I know that Torizon images uses meta-updater layer to add OTA support and toradex makes some customization in the layer. I learn all the docs in toradex files about the update process but where can I found more information about the process that are runnning in the target to check for an update, downoald and apply the updates? I know that Torizon uses ostree and aktualizr to do this proceess.
Can we use meta-updater layer but using or own server to manage the updates instead of using TorizonCloud?

Toradex and Torizon provides torizon-builder to do system customizations but if we need to change u-boot and kernel sources we must use Yocto. To upload updates packages we need to unpack and push our custom image to TorizonCloud then TorizonCloud have the new package to be update and (I dont have very clear how is works) the target check every a certain time to the server for the update avilables and then download it and starts the update proceess but only apply the diff between the new and installed system (this diff is managed for ostree). If I use Yocto instead torizon builder to system customization can upload the packages with torizon-builder as the same way? and the system makes de diff between the old and new filesystem?

I build a Torizon image with yocto. I builded a torizon-core-docker image without any change, the build was succesfuly but print some warnings:

Time: 0:00:06
Sstate summary: Wanted 890 Local 190 Mirrors 0 Missed 700 Current 1543 (21% match, 71% complete)
NOTE: Executing Tasks
WARNING: torizon-core-docker-1.0-r0 do_image_ostree: Data in 'var/lib' directory is not preserved by OSTree. Consider moving it under '/usr'
var/lib/udisks2
var/lib/systemd
var/lib/sudo
var/lib/sudo/lectured
var/lib/NetworkManager
var/lib/misc
var/lib/plymouth
var/lib/dbus
var/lib/arpd
WARNING: torizon-core-docker-1.0-r0 do_image_ostree: Data in 'var/cache' directory is not preserved by OSTree. Consider moving it under '/usr'
var/cache/fontconfig
WARNING: torizon-core-docker-1.0-r0 do_image_ostree: Data in 'var' directory is not preserved by OSTree. Consider moving it under '/usr'
var/log
var/backups
var/spool
var/spool/mail
var/spool/plymouth
var/run
var/tmp
var/lock
var/volatile
WARNING: torizon-core-docker-1.0-r0 do_image_ostree: Data in 'home' directory is not preserved by OSTree. Consider moving it under '/usr'
home/root
home/torizon
home/torizon/.bashrc
home/torizon/.profile
WARNING: torizon-core-docker-1.0-r0 do_image_ostreepush: SOTA_PACKED_CREDENTIALS not set. Please add SOTA_PACKED_CREDENTIALS.
NOTE: Tasks Summary: Attempted 5923 tasks of which 4449 didn't need to be rerun and all succeeded.
NOTE: Writing buildhistory
NOTE: Writing buildhistory took: 66 seconds

For that I understand var/ and home/ directories are not persevered by OSTree. I have to configure something to persevered these directories? is necessary?

SOTA_PACKED_CREDENTIALS not set. Please add SOTA_PACKED_CREDENTIALS

Here I think that I have to add SOTA_PACKED_CREDENTIALS, where? what happened if I don’t add It?

One of the features that Torizon offer is the use of docker images to run our app. If we decide to don’t use dockerized app we can use TorizonOS anyway?

In short yes. There’s nothing that demands the use of docker images. Torizon OS is built with Yocto so you can still use Yocto if you so desire. Though if you’re not planning to use containers you might as well use the Torizon OS Reference Minimal Image: Torizon OS Reference Minimal Image Technical Overview | Toradex Developer Center

It’s essentially the same thing as the normal Torizon OS image, it just doesn’t have docker or anything container related.

but where can I found more information about the process that are runnning in the target to check for an update, downoald and apply the updates?

Depends what kind of information and how in-depth are you looking to go? We do have this technical overview regarding our updates: Torizon Updates Technical Overview | Toradex Developer Center

But if you want something more in-depth then know that we follow Uptane for our update framework. Uptane has a very detailed standard as defined here: Uptane Standard 2.1.0 | Uptane

Can we use meta-updater layer but using or own server to manage the updates instead of using TorizonCloud?

Well if you want to develop and spin up your own server there’s nothing we can really do to stop you.

If I use Yocto instead torizon builder to system customization can upload the packages with torizon-builder as the same way? and the system makes de diff between the old and new filesystem?

Torizon Builder is simply just uploading the OSTree of the filesystem. But Torizon Builder is meant to work with our Easy Installer format so you can’t just plug anything into that tool.

For that I understand var/ and home/ directories are not persevered by OSTree. I have to configure something to persevered these directories? is necessary?

Depends do you want these files and directories preserved by OSTree? If the answer is yes then move them somewhere else in the filesystem, otherwise you don’t have to do anything.

Here I think that I have to add SOTA_PACKED_CREDENTIALS, where? what happened if I don’t add It?

This is optional. If you supply these credentials which correspond to an OTA server, then the build will automatically upload the OSTree of your build to the server as designated by the credentials. For example if you supply the credentials for Torizon Cloud for your account then your OSTree from the build gets automatically uploaded to your account similar to what Torizon Builder does.

Let me ask you now. It sounds like you want to develop your own OTA service is that true, or what are your plans here?

Best Regards,
Jeremias

Hello @jeremias.tx , thank you very much for your response.

Let me ask you now. It sounds like you want to develop your own OTA service is that true, or what are your plans here?

Currently we are learning and try to understand what Torizon offers. As said before we have been working with Yocto building our custom images in base of reference images. We are trying to know what are the limitations if we decide to use Torizon but for that I understand we could build a TorizonOS image with our customization using Yocto adding our own layer and if we dosn’t need to use a certain package we just can exclude It.
One of the features that we think that is very useful for us is the update process. We just are trying to understand how works and searching for different alternatives. We dont have very clear what OTA service we will apply in our project because we are in the firsts project stages. Currently we are not thinking in develop own OTA we just are learning about how works to understand and have clear how can I apply It in our project.

I see, well if you are really interested about our Platform cloud services we could organize a call to go more in-depth with people here at Toradex if that’s what you would like. Is this something you would want?

Hi,
Yes, I am very interested. An employee from the sales department of Toradex has already contacted me to arrange a meeting. The date is still pending, and I am still waiting.

Delete

Hi @emmaperea ,

Sorry for the delay in answering here.

We entered in contact with you by personal e-mail to discuss better this subject.

Best regards,
Daniel Morais