site  news  contact

How to compile a Linux distribution from source

December 31, 2021 — BarryK

Most Linux distributions are built from the binary packages of another distribution. For example, Ubuntu is built from Debian binary packages. There are only a few distributions that are built with binary packages that they have compiled from source -- this list includes Debian, Arch and Slackware.

EasyOS belongs to this very exclusive group. And EasyOS is perhaps the only one that offers simple automated steps to cross-compile the entire suite of packages, currently over 860, for target architectures such as x86_64 and aarch64.

These simple steps are explained in a blog post:

https://bkhome.org/news/202112/how-to-cross-compile-850-packages-using-yoctoopenembedded.html

The blog post explains how to setup the build environment, perform the cross-compile, and import the binary packages into "woofQ", which builds an EasyOS drive image file, ready to upload and use.

The cross-compile environment is based on OpenEmbedded/Yocto, with "meta-quirky" layer developed by Barry Kauler, that adds an extra 340+ recipes.

Note, the reason for the name "meta-quirky" is historical. Before the EasyOS project commenced in 2017, Barry created an experimental Linux distribution named Quirky Linux -- now retired. The name does not matter, it is just a layer that compiles an extra 340+ packages suitable for creating a Linux distribution These are packages that OE either does not offer, or are recipes that enhance those in OE.

It is a complete cycle, from source packages to final released distribution. Is there any other distribution that offers this to developers? Linux From Scratch does, and then Beyond Linux From Scratch, but only targeting x86_64, and not automated.

There is one automated cross-compile tool, Buildroot, but it is a toy in comparison. OpenEmbedded/Yocto (OE) builds binary packages, with full meta-data such as dependencies. All development tools, such as gcc, autotools, cmake, etc., etc., can be built as binary packages that will work in the target environment.

Follow blog posts on cross-compiling here:

https://bkhome.org/news/tag_oe.html

Follow blog posts on EasyOS here:

https://bkhome.org/news/tag_easy.html   

Tags: dev