Can I create my own embedded Linux project?
The Linux project is maybe the most successful open-source project so far for desktop and server applications. In recent years Linux has also gained traction as operating systems in embedded systems, especially IOT devices.
One of the first things that need to be decided in an embedded project is to select hardware platform and an operating system that fit the hardware platform. It is important to make sure that the chosen operating system has the necessary devices driver available for the hardware platform. Normally these device drivers are distributed in a so called BSP (board support package) that is provided by the semiconductor manufacturer.
When these things are set in the project it is time to decide on how to build the Linux distribution for the project. For some platforms there are commercial distributions but for those that want to create their own there are basically two systems available: Yocto Project and Buildroot.
The Yocto Project was announced by the Linux Foundation in 2010 and launched in March 2011. Its goal is to provide tools, templates, and methods to help users build embedded Linux systems independent of hardware platform.
The build tool used by Yocto is called bitbake and together with templates from Yocto and templates from OpenEmbedded a developer can choose exactly what Linux modules to include. The templates (called recipes) are organized in layers which means that one recipe also declares what other recipes it depends on. A recipe also includes information about how to download the source code and how to build it when it has been downloaded. The top-layer (recipe) is called an image and that recipe describes how to create a full image that can be downloaded to the hardware. All-in-all Yocto is a project that creates a complete Linux image by downloading, building, and packaging all that is needed for a project.
As an alternative to Yocto one can use Buildroot. When configured Buildroot can generate a cross-compilation toolchain, a root filesystem, a kernel image and a bootloader. Buildroot supports several boards and processor variants out-of-the box and on top of that there are several third-party projects to support even more boards. After downloading the Buildroot package you first create a configuration of your build by starting the included configuration system that can be run on several window managers. After the configuration the build is started from a command shell with a simple “make”.
The make command will then perform the following steps:
1. Download needed source files
2. Configure and build the cross-compilation toolchain
3. Configure and build the selected target packages
4. Build kernel image
5. Build bootloader image
6. Create root filesystem for target.
As described above both Yocto and Buildroot is complete systems for building customized Linux images. The main parameter for selecting one before the other is whether your hardware platform is supported or not.