This is my first article for the IOTA community. It’s an introduction of my vision for the meta-iota OpenEmbedded layer, as well as a hands-on tutorial that acts as a proof-of-concept.

Introduction

The Yocto Project is an open source collaboration project that helps developers create custom Linux-based systems regardless of the hardware architecture. Meanwhile, OpenEmbedded is a build automation framework and cross-compile environment used to create Linux distributions for embedded devices.

Together, these projects provide a flexible set of tools and a space where embedded developers worldwide can share technologies, software stacks, configurations, and best practices that can be used to create tailored Linux images for embedded and IoT devices, or anywhere a customised Linux OS is needed.

There is an ever-growing movement of adoption of YP/OE tools inside the Embedded Linux community. This is mainly due to the flexibility and modularization they provide in terms of cross-compilation of different applications, customised kernels and Board Support Packages (BSPs). Bringing IOTA into YP/OE will potentially accelerate the adoption of IOTA by the Embedded Linux community since many different boards can now support IOTA tools.

The main tool used by YP/OE is called BitBake. Here is a short description borrowed from Wikipedia:

It’s also good to know a little bit about Poky. Here’s a description borrowed from it’s official page:

Poky is a reference distribution of the Yocto Project®. It contains the OpenEmbedded Build System (BitBake and OpenEmbedded Core) as well as a set of metadata to get you started building your own distro. To use the Yocto Project tools, you can download Poky and use it to bootstrap your own distribution. Note that Poky does not contain binary files — it is a working example of how to build your own custom Linux distribution from source.

If you want more information, the Yocto official documentation is known for its quality and extent. Here are some useful links:

The first IOTA project I ported into YP/OE was cIRI. It is a low level implementation of an IOTA node written in C. It is meant to be a lightweight alternative version of the IOTA Reference Implementation (IRI), which is originally written in Java and not really well suited for Embedded Systems with RAM restrictions.

The project cIRI originally uses the Bazel build system, which already supports a lot of cross-compilation possibilities. At first, I was a bit scared about integrating Bazel into BitBake. However, I soon found out that Mr. Hongxu Jia has already done a great job of porting Bazel into YP/OE on his meta-tensorflow layer. Nevertheless, a few adaptations were introduced into the cIRI recipe so the Bazel workspace would integrate well with BitBake and also so that snapshots, sql and config files were populated into the final package.

The BeagleBone Black is based on the AM335x 1GHz ARM® Cortex-A8. I chose the BBB for this tutorial because Poky supports it out-of-the-box and it is quite a popular SBC on the YP/OE community. However, the layering system of BitBake should apply to any other boards supported in the YP/OE space. Check if there is any manufacturer documentation or guides about using Yocto for your board. If you need help applying this tutorial to other SBCs or SOMs, feel free to write a comment below, DM me on Discord (Bernardo [IF]#8478) or send me an email (bernardo.araujo@iota.org).

The BeagleBone Black

Fun fact: I was able to run cIRI inside QEMUlated MIPS and PowerPC machines! That shows how exotic meta-iota allows you to go 😉

Anyways, that intro is already too lenghty. Let’s get our hands dirty!