There are a plethora of Linux distributions to choose from today. For the uninitiated, the process of selecting a “distro” can become a nightmare of trying to disentangle the distinguishing features from the web of names and market-speak. This article takes a look at the process of selecting a distribution for an embedded device; presents in the context of some of the more mainstream distributions; and considers the benefits and drawbacks of each given a typical set of project constraints.
Important to keep in mind when selecting a distribution is that, despite what the marketing material may say, they are all more similar than they are different. They all run Linux as the operating system kernel and, thus, all require the same skill set to get the software running on a new device. If your device requires a new hardware driver, that driver will be the same no matter which distribution you choose. If you are running on top of hardware that is already well-supported in the Linux kernel, then any distribution using a sufficiently up-to-date kernel will be equally capable of running on your device.
On top of the Linux kernel, distributions provide a system layer in which reside the usual requisite system libraries and the necessary utilities for configuration of system features such as network interfaces. Most distributions provide here the familiar set of utilities from the GNU stack. Exceptions, however, do exist; the Android distribution, for example, provides a system layer sufficient for the requirements of its Java runtime environment and chooses not to target generic applications.
Finally, the application layer of each distribution is where you will find the most variation, but also here variation is not something to fear as most probably an embedded device will be fitted with custom application software in any case. The variation at this level is more easily overcome than that of the lower-level distribution plumbing.
Selecting a distribution
When selecting a distribution, it is important to begin with a clear idea of what is to be achieved therewith. After all, the distribution is a just a small piece of the puzzle that is your product and will in most cases not even be visible to the user when the finished product is released. A set of fundamental questions should be put to yourself and your development team and the answers kept in mind when weighing the pros and cons of each distribution against each other. These answers constitute the fundamental criteria upon which your decision should be based.
Is your hardware already supported by the Linux kernel? Is standard hardware being used? New and non-standard hardware present a significant set of challenges that require a very specific skill-set to overcome. The contracting of professional assistance for the bring-up stage of your project should be taken into consideration as this can save you man-months of work and future headaches. Wind River offers such assistance for their own distribution, and consultancies such as South Pole can provide assistance for the distribution of your choice.
What are the strengths of your developers? An application programmer may not feel comfortable debugging a kernel or packaging system libraries. A Java programmer may not feel comfortable working within the differing set of constraints presented by lower-level languages such as C and C++. Select a distribution that allows your development team to play to its strengths, while leaving the dirty work to the distribution developers.
Do you have an existing application that will require certain platform characteristics in order to run? A typical POSIX application, for example, will expect a set of standard libraries to be present on the system; more specialized environments, like that offered by the Android distribution, do not provide all the components of a generic distribution and may fail to meet the requirements of your application.
What level of long-term support will you require from the distribution provider? Some distributions move quickly and provide short periods of support; some distributions provide no support at all. Support always comes at a cost, so the benefits of paid-for support needs to be weighed against the costs of possibly having to create and provide security updates yourself.
Given this set of criteria, one can begin evaluating the set of available distributions. This article will present three mainstream Linux distributions for embedded devices, considered from the point of view of the aforementioned criteria.
Android
Android is quickly becoming the distribution of choice for smartphone-type devices. This
distribution has been designed from the ground up to appeal to mobile telephone manufacturers; packaging, security model, and licensing decisions have all been based on the needs of this market segment. As such, Android is by no means a standard Linux distribution. Apart from the Linux kernel that it runs atop of, Android bears little resemblance to other Linux distributions.
Android’s strength lies primarily in two key attributes: the components of the underlying system are well defined and do not vary from device to device; the Java-based application layer presents a well-defined and limited view of the platform, presenting the application developer with only one way of doing things. The distribution is supported with security fixes from Google and the Android community.
On the downside, Android requires a set of patches to be applied to the Linux kernel. If your device already uses a non-standard kernel, these patches may not cleanly apply. Furthermore, applications are intended to run in a virtual machine and many common system libraries are not included, largely limiting application development to being done in Java (at least for the time being). If you have an existing application, it likely will require a lot of work to make it run on Android, including possibly requiring a rewrite in Java.
Why choose Android? You want the ease of application development that comes with Android’s Java API; you want access to the multitude of Android applications already available today; you are using hardware that is already supported by the Android Linux kernel.
Wind River Linux
Wind River Linux (WRL) is a commercial distribution for embedded development. This is a fully-fledged distribution that presents few constraints to the application developer: a large number of architectures and platforms are supported; a complete set of system libraries is provided; and the distribution is fully modularized allowing the slimmest possible build for minimal hardware requirements.
WRL comes with all the advantages of a fully paid-for development environment. Security audits are continuously performed by competent staffers and patches are promptly made available when vulnerabilities are discovered. Full integration with the Eclipse IDE is provided, complete with second-to-none profiling and debugging tools that should make the developer more productive. When all else fails, professional support is available in several forms ranging from email assistance to taking full charge of the development of your device.
Why choose WRL? You value the professional support and assistance in bringing up your device that a paid-for distribution can provide. Your customers put a premium on the security that comes with running a brand-name software stack. You are comfortable working with Eclipse and covet high-quality development tools for profiling and debugging.
OpenEmbedded and MontaVista Linux
OpenEmbedded is in many ways comparable to Wind River’s offering: it targets a multitude of devices on a multitude of architectures. What sets OpenEmbedded’s offering apart is that it is community developed and aligns closely with Open Source software development ideals. For the experienced developer, OpenEmbedded’s unofficial support via mailing lists and IRC is fully sufficient; the strength of Open Source software lies in the community and OpenEmbedded’s aim is to leverage it fully.
OpenEmbedded is a full Linux distribution, providing the standard set of system libraries that one expects in a Linux system. Components ranging from low-level utilities to full-blown desktop technologies are readily available, and components can easily be added for the case where you want to include your own proprietary offerings. Hardware support is extensive, especially for popular commodity hardware; however, be prepared to bring in a local kernel developer to help you get your specialized device running.
For those wary of “community” projects, comfort can be had in the fact that MontaVista Linux 6 is a derivative of OpenEmbedded. Added value is provided in the form of “recipes” for building typical configurations; pre-built binaries and toolchains; and mirrored source code repositories to ensure extended availability. MontaVista Linux fills a niche for when your customers want “brand-name” and you want “community.”
Why choose OpenEmbedded? You want a “free” distribution, both in terms of license and cost; you enjoy working with the community; and you value having a full Linux distribution at your disposal. OpenEmbedded can give you the feeling of “do-it-yourself” without having to sacrifice support in the form of a community to fall back on.
The selection of a distribution will not make or break your project; yet, the decision is one with which you will have to live for the lifetime of the product. The happiness of your developers, the support requirements of your organization, and the extensibility of your product are the parameters at stake in the decision. A professional assessment of your project may assist you in making the best decision that takes into account the interests and values of all implicated parties. This is where the services of consultancies such as South Pole find their niche in the distribution ecosystem!