This content is part of the Essential Guide: Emerging data center workloads drive new infrastructure demands

Tips and tools to deploy Linux for IoT devices

As IoT adoption grows, more IT teams will consider running Linux for IoT devices. Learn the key steps and components involved, including the cross compiler toolchain.

As the internet of things market thrives, it's important to consider your options for working with internet of things devices. One option is to use a Linux OS -- but first, be aware of the differences between using Linux for the internet of things and using it for a server or desktop.

With the internet of things (IoT), you'll deal with specific devices that occasionally contain specific hardware components. Such devices require a highly-tuned version of Linux that you must set up manually, rather than a generic Linux distribution.

To get Linux for IoT devices, you'll need a development workstation. This is the computer you'll connect to the IoT device -- typically with a USB cable -- and from there, use to build the entire setup to then push to the device. There are no configuration files you can tune later on -- you'll need to do it all from the development PC and make sure you do it the right way.

Cross compiler tool set

One of the most important components when using Linux for IoT is the cross compiler tool set. This is the C compiler, together with the related utilities you'll need to build the boot loader, the kernel and the C library. It also includes the applications you will want your IoT device to offer, which will differ depending on its use. The cross compiler doesn't just compile source code to run on the local computer, but also allows you to compile code to run on the IoT device.

After you create the cross compiler toolchain, upload the different components of the IoT Linux operating system, starting with the boot loader. Since this component needs to integrate tightly with Linux, it often consists of different components that are written to different parts of the IoT device. While the device boots, a RomBOOT program is the first component that loads, followed by a bootstrap program, followed by the actual boot loader U-Boot. This is the component that loads the actual Linux kernel.

Raspberry Pi

While most embedded devices work best with a custom-made Linux distribution, generic IoT distributions such as Raspberry Pi can also work. Compared to the device configurations of custom distributions, Raspberry Pi resembles a real operating system. To start working with it, upload a ready-to-use image to the highly standardized device itself.

Raspberry Pi is different from hand-built OSes because it makes the device it is uploaded to behave more like a real Linux computer. For example, with Pi, admins have access to writable storage, which is not the case in a custom-built Linux IoT distribution. The Raspberry Pi's options are very useful in an IoT environment, but it addresses a different need. If you're looking for a minimal and optimized system, a cross compiler toolchain on a dedicated workstation is a better fit. Raspberry Pi works best when you build your own custom IoT device based on Raspberry hardware. That can be useful, but it less ideal in an environment where you'll need to deploy many devices with a similar, highly read-only and optimized configuration.

Compile the kernel

While desktop and server Linux systems use large modular kernels, you'll need to create a tailor-made kernel for IoT devices that uses minimal hardware resources in the most efficient way. That means you'll need to carefully configure and compile the kernel before you upload it to the device.

The next step is to upload the shell environment. On regular Linux OSes, this shell environment addresses many external commands, but on embedded Linux, you'll need a minimal shell. Busybox, the most common shell environment, contains minimal versions of all common Linux programs in the shell program itself. Once all of these are in place, you can address the root file system. This won't be a regular Linux file system, but a file system that is optimized to work with the flash media on the IoT device.

Managing IoT

Once you create the Linux distribution itself, manage and upload it to the IoT device. This requires specialized management software -- currently Yocto is one of the leading products. Yocto makes it easy to orchestrate embedded Linux for IoT among multiple devices and deploy configurations to them.

Next Steps

Explore big data challenges with IoT

Beef up your IoT data center infrastructure

Prepare your IoT infrastructure for the long term

Dig Deeper on Linux servers