Production Programming for Linux
This article will go over the best practices on how to prepare your Linux-based product for production.
It aims to present details on how to install your software into multiple devices, using the most common recommended methods. If you have a specific use case that does not fit into our recommended methods feel free to contact Toradex to discuss it further.
Production programming refers to the at-scale methods and processes used to program multiple modules with your product’s unique software. It’s important to have a reliable and consistent method for this, as any issues at this stage will be scaled depending on how much product you ship.
The usage of the Easy Installer tool as a resource to achieve this goal have important advantages to highlight:
- Toradex makes sure that Tezi works and maintains compatibility with older images, so even if the modules are updated the production programming shouldn’t be affected.
- Production programming via Tezi is the easiest way to ensure that there won’t be any problems when versions change.
Production Programming with Toradex Easy Installer
The most usual ways to accomplish production programming are:
- Auto-install images in external media, such as SD cards and USB sticks.
- Usage of unattended ethernet auto-install for devices that don’t have external media access available.
So, after all, the objective of this section is to expose and explain some of those features that can be used to help with it.
Auto installation is very useful for production programming. To automatically install an image, the image can be marked as
auto-install image using the
autoinstall property in the
image.json file. If that property is set to true the image will be flashed to the module automatically and unattended. To set this property as true, go to the
image.json file in the image folder and change the line as follows:
--- "autoinstall": false,
+++ "autoinstall": true,
Any image can carry the
autoinstall property, so, if multiple regular images have the property set to
true the outcome will depend on the order of how images get processed. Because there is no guaranteed order, it is recommended to only use one local media with only one image having the
autoinstall property set to
Let's do a quick example of how to proceed with an image auto installation. The first step, as described before, is to set the
autoinstall property as
true on the
"name": "Toradex Embedded Linux Reference Multimedia Image",
"description": "Image for BSP verification with QT and multimedia features",
The next step is to put the image to be written on the external media. Usually, the image comes in tarball files. So, extract the
*.tar into the external media (SD Card, USB stick). For example, for a Reference Multimedia Image for Apalis i.MX8:
$ tar -xf ~/Apalis-iMX8_Reference-Multimedia-Image-Tezi_5.6.0+build.18.tar
$ cp ~/Apalis-iMX8_Reference-Multimedia-Image-Tezi_5.6.0+build.18 /media/<mounted-usb>
The third step is to boot the module, wait for Tezi to install the image and after that, reboot the board.
Unattended flashing over Ethernet
The Toradex Easy Installer can be used to flash images from an HTTP web server.
It is possible to provide the image, from the host PC, through a web server (e.g. Nginx). Together with the auto-install feature, the image is flashed as soon as the module connects to the local network and identifies the webserver.
To host the image, you can follow the steps provided for Unattended Flashing over Ethernet.
If you have a local media available on your device, you should configure the URL searched by the device to match the server you are providing.
If a local media is unavailable, you can utilize a workaround with DNS.
Another way is using TorizonCore Builder command
images serve. This lets you serve (via HTTP) Torizon OS images from a directory on your host machine. Any device running Toradex Easy Installer within the same network can then see this list of images and install one. Combined with images that have the auto-install property enabled this would allow for unattended flashing over Ethernet. Proper usage of this command can be seen in detail in the TorizonCore Builder commands manual.
Using the Toradex Easy Installer is the most straightforward way to flash an image to a module, in development or production.
However, if your module doesn't support it, the Legacy Method must be used instead.
Legacy flashing method does not imply that the embedded Linux image is legacy.
If possible you should use Toradex Easy Installer and not this legacy methods. In newer images, the legacy methods won't be available anymore.
It is possible to flash either through Ethernet or from an SD Card/USB Drive.
The following methods are suited for both development and production.
TFTP/NFS for automated flashing over Ethernet
An important article to read beforehand is How to Setup Networking for Embedded Linux Application Development. It explains the general concept, as well as sets up the TFTP/NFS server on your host computer to serve the client (module).
On a development environment, the Boot From a TFTP/NFS server article provides detailed information on how to setup U-Boot to boot from a server hosted on your development PC for rapid and dynamic prototyping.
Then, on the production environment, the Flashing Linux Over Ethernet article provides information on how to flash images from a TFTP server running on your local machine.
Using SD Card/USB Drive
This method uses bash script to flash the image from a USB drive or SD Card to a module. Instructions are specific to each SoC, the following links provide more information regarding each one: