Working on Lelux Mark II
About 2 years ago, I made a Linux distribution that runs on initramfs, consisting of 16 files. The ideal of this project was to provide a portable and well-documented Linux distribution, mainly for purpose of studying them. I called it Lelux.
Lelux taught me a lot about Linux distributions. Unfortunately lelux were partially built from the system files and used prebuilt kernel. But most importantly: It did not posses a toolchain or package manager to become a self-standing distribution.
Traditional Linux package management means to let programs install themselves into root or
/usr, one after another. To check whether there's a new version of the program in worst case means manual check into sourceforge -website. Most of the software does not easily support alternative methods for installation, so it is default that software is expected where it wants to go in the Linux system.
I intend to use the user namespaces and overlayfs to combat package management issues in linux: The software will be built and run in constrained environments.
To build anything that traditionally runs on linux, you need a compiler toolchain. It must be cross-compiled to your platform, with correct search paths. The goal of having a C toolchain is to be able to compile your own linux kernel.
I've used to criticize Linux From Scratch -project for its wtf galore of steps that nearly seem superfluous. In case of GCC these steps aren't superfluous. GCC simply doesn't have proper control over which files it uses for compiling - The implicit state during command invocation to compile a C program is truly implicit when you use GCC.
After a quick mailing-list exchange, it seems the task of cross-compiling GCC is outside of interest of GCC maintainers. They think it's all right that getting a compiler toolchain for your system means for hundred lines long hard-to-debug-and-maintain build scripts. I consider abandoning the idea of bootstrapping my distribution with GCC.
LLVM & Clang seem to have built-in cross-compiling support. Although clang might not compile linux kernel it has been shown to successfully compile GCC. Compiling Clang feels considerably slower and memory consuming than compiling gcc though.
I've seen another project called metta, which uses a clang compiler toolchain. And there's a third system called Aboriginal which is providing musl as a standard library.
Why do I bother?
The release of Vulkan API is just around the cornel, therefore non-X11 -based distributions might become plausibly useful on the desktop. That's the optimistic reason to dig up Lelux. Another reason is that I did my first kernel hack last week and used Lelux as a testbed.
It might be that Lelux Mk. II will still trip on it's face. I would rather let Linux From Scratch keep their eye-gouging wtf-esque kilometer buildscripts.