Background
The Yocto Project is a popular project that helps you to build your own fully customized Embedded Linux distro. This flexibility comes with trade-offs: mastering this complex system takes time and properly implementing and maintaining a solution based on it is costly.
Toradex addresses the trade-offs with the Torizon Operating System. It is built by Toradex with Yocto but provided to our customers also as a binary ready-to-use distro. It is tailored for embedded use cases so you are not forced to learn Yocto unless you want or need it.
Guided by our core strategy of making embedded computing easy, Torizon has grown way beyond the OS into a comprehensive platform: it is comprised of a Cloud with features such as over-the-air updates (OTA), remote access, device monitoring, also known as telemetry, and an IDE environment, a customization tool, security by default, and Debian containers with hardware acceleration, among many other features.
The focus on the holistic concept of making embedded computing easy led us to adopt a container engine, Docker, in our case. It makes it possible for our customers to focus on application development while Toradex provides constant OS maintenance and updates. It also makes it easy for you to benefit from distros that are not inherently focused on embedded like Debian, while at the same time providing the expected reliability of an Embedded Linux distro. This makes it a perfect match so you easily maintain your software and dependencies always working over time.
This strategy of providing a ready-to-use binary OS image and relying on a container engine makes it unnecessary to use Yocto in most cases.
Even so, although there are misconceptions about the use of containers, there are also valid reasons for you to prefer Yocto. You may have an existing project already supported in Yocto and are looking to port it to a more modern platform or perhaps you find yourself in a rare corner case where you can’t leverage the full Torizon with containers.
If this is the case and you opt for Yocto, you may still want a solution for reliably and securely updating your products in the field, performing remote access, and monitoring your device fleet. Here is where the Torizon OS Reference Minimal Image shines. For simplicity, we’ll call it Torizon Minimal for the rest of this blog post.
Why Toradex Provides Torizon Minimal?
We acknowledge you may want or need to stay on Yocto and still use features of the Torizon Cloud.
Without Torizon Minimal, you would need to take one of two routes:
- Add the Torizon Cloud portion to a base image (such as Toradex Reference Images) or distro (like Poky)
- Remove the container engine from Torizon OS
Moreover, you’d need to carry on these modifications over time.
With Torizon Minimal, Toradex removed the integration burden from you, so it helps you bring your Yocto-based product faster to the market and maintain it with a lower total cost of ownership, as you skip this costly integration and maintenance.
What is Torizon Minimal?
From the OS perspective, Torizon Minimal is nothing more, nothing less than the “Full“ Torizon OS without a container engine. You can easily compare the image recipes torizon-docker.bb and torizon-minimal.bb.
There is more to it, though, because this seemingly simple change greatly impacts the features and workflows available to you.
How Does it Compare to Torizon (Full)?
To understand what is the impact of not using the container engine in relation to the Torizon platform features, let’s break down each of the features that depend on Docker to comprehend the impact on the related workflows
- Application Development
- Application development is not detached from the base OS updates and dependencies. Therefore you must take care of both as a single piece.
- An evaluation SDK is not available out of the box, and you must create your own SDK with Yocto.
- There is no IDE support out-of-the-box, therefore you must configure your IDE of choice to use the custom SDK you generated. It means that you will have to set up an IDE with your custom-built SDK and configure it for cross-debugging according to the language or framework you plan to use.
- By default, there will be no package manager and no package feed. Even if you install a package manager in your distro, you won’t get a package feed as complete as Debian’s. In addition, the partially read-only filesystem required by OStree will get in your way if you try to install packages during runtime. Furthermore, it is more likely you won’t find an OpenEmbedded recipe for a given package you need than a Debian package which you could install via containers, and then you will need to write a recipe for it.
- The application development will be coupled to the OS development, and whenever you need to install or update a dependency, you must wait for the Yocto developers in your team to find a solution for you. On the other hand, whenever the Yocto developers update the base OS, you will have to validate your application against the changes introduced.
- The templates for popular technologies such as C, C++, Python, .NET, and several other frameworks will not be available for use. The pre-configured CI scripts for GitHub and GitLab will not be available as well.
- OS Configuration and Deployment
- Binary OS images of Torizon Minimal are not very useful because they don’t come with development tools, a package manager, or anything that helps you quickly get started without building your custom distro and image with Yocto. This means you will need additional infrastructure and people dedicated for your Yocto builds.
- The simplified OS configuration provided by TorizonCore Builder (TCB) is limited. It may not even be a good idea to use TCB at all as you will split the OS configuration among two tools, increasing the overall complexity.
- Enabling your custom carrier board is not as easy as with TCB, as you must figure out the Yocto idiosyncrasies on adding and iterating custom device drivers and device trees development.
- Torizon Cloud Services Availability
- Regularly updating your application using the Application Updates feature won’t work, as it is built on top of container technologies. This should not be a big limitation though, as there are other ways to update your application which we’ll look at in the next section.
In summary, by choosing Torizon Mininal you won’t get the Application Development and OS Customization benefits that a Yocto user anyway already has a solution for, and you will have a near-zero impact on the Torizon Cloud services availability.
Updates With Torizon Minimal
We just learned that the Application Updates feature is the only Torizon Cloud feature unavailable for Torizon Minimal - at least as of this blog’s writing. Still, there are alternatives:
- OS Updates: under the hood, the OS Updates feature updates the root file system using OStree. Therefore, anything you install in the root file system with Yocto, including your application, can be updated with OS Updates. Install things in a directory managed by OSTree, meaning anywhere besides /var and /etc. Using this feature, you may leverage the low bandwidth requirement of OSTree’s static deltas, making your updates fast and efficient, orders of magnitude smaller than using an A/B partition method.
- Subsystem Updates: if you are after something more flexible, the Subsystem Updates feature may be worth evaluating. It provides a generic API for updates so that you write your own update logic. You can then update anything Linux has access to, including files and metadata, microcontrollers, and possibly your application. As a trade-off for the extra flexibility, you must guarantee your subsystem implementation is robust enough.
Conclusion
Using Yocto together with Torizon is entirely viable and endorsed by Toradex. While there are obvious limitations, these are inherent to the features built around containers. Ultimately, you can choose the workflow best aligned with your product development strategy: Yocto with Torizon Minimal or Docker with the regular Torizon variant.
In the Torizon Cloud, only the Application Updates feature is not available with Torizon Minimal, but you can still update your application with OS and Subsystem Updates. Remote Access, Device Monitoring, Fleet Management, and other features work out-of-the-box.
Are you feeling like getting started? Head over to the article Build Torizon OS from Source With Yocto Project/OpenEmbedded and start baking torizon-minimal!