Home

Ingo
Attachments
wharfie-terminal.gif (269734 bytes)

Build Embedded Linux

Wharfie is a modern build system for embedded devices. The concept is very similar to "docker". Both, "docker" and "wharfie", are using a simple format to describe custom linux system configurations and rebuild those easily. Wharfie uses basically the same syntax, while it is not fully compatible.

While "docker" is focusing on scalable web services, "wharfie" is focusing on embedded linux systems.

With "wharfie" you can easily build a root filesystem, based on the Debian distribution from scratch. To configure the system for your needs, you just write all necessary configuration steps into a configuration file. You don't do this configuration at the live system.

Those configuration files are called Dockerfile in the docker eco-system. It's pendent in the world of wharfie is called Wharfile.

Automate Building of Image

When you install linux on an embedded target, it is very common, that you are first faced with a preconfigured system, which you have to configure manually. Doing this multiple times can become really anoying. Wharfie helps you in this process, as it can repeat all the configuration steps for you.

...
# Set the locale
RUN locale-gen en_US.UTF-8

RUN git clone https://github.com/pyload/pyload.git /opt/pyload \
        && cd /opt/pyload \
        && git checkout stable \
        && echo "/opt/pyload/pyload-config" > /opt/pyload/module/config/configdir

ADD pyload-config/ /opt/pyload/pyload-config
ADD ../common/files/pyload.service /etc/systemd/system/pyload.service
...

Role out up-to-date images

Because the building process can be highly automated, you can easily just rebuild the images on a regular basis, and keep the images which you role out to new targets always up-to-date.

# rebuild
$ wharfie --clean
$ wharfie

Get Cross-Toolchains

Wharfie supports armhf, armel, i386 and amd64 from debian. At least for ARM it is always difficult to get cross-toolchains, which can be easily archived and reused on different hosts. But also for x86 it makes fully sense to archive a cross toolchain for the systems, which you are roling out somewhere. Otherwise it can become difficult to rebuild programs for your systems in a few years.

FROM debian_armhf_stretch
TOOLCHAIN toolchain_debian_armhf_stretch.tar

Legal concerns

When using the linux OS for embeddded systems, a lot of legal issues have to be respected. Wharfie contains two additional commands to face these issues:

  • LICENSE <filename></filename>
  • SOURCE <filename></filename>

These commands are creating tarballs, containing all the source packages, or all the licenses of your system, which where installed through debian packages. This feature makes it very easy to prepare yourself for distributing such an image.

You will need to be able to provide such packages when you plan to distribute the image as part of a product, as well as when you share it with others in form of a download on the internet. When you publish anything, which contains code that was released under a third party license, you are often forced to provide a list of all those licenses, containing the license text.


Related

Home: IndexMain