How to Make a Linux Distribution
I am told that creating one's own Linux distribution is, in some circles, a rite of passage akin to building one's own JavaScript framework, yet even though I've been using Linux since 2006 (ah, Dapper Drake 🦆...), it's not something that ever interested me. Even though I had a good understanding of the components of a distro (kernel, userspace, desktop environment, package manager...), it wasn't until I installed Arch for the first time that I realized just how much was involved in setting up a working desktop (that process also made me realize that Arch is just about my limit in terms of the lengths I'd go to customize my Linux experience, that is to say: in no way am I brave--or patient--enough to try Gentoo!).
Now technically, once I got my Arch installation configured how I wanted it (Pantheon desktop environment, most apps flatpak and configured with the latest AMD Vulkan and OpenCL software stacks) I could claim I had successfully built my own Linux distro. To wit--the way I'd set up my desktop was through trialing a bunch of setups and configurations in a VM, then exporting my package lists and configuration files to install onto a fresh system. Similarly, the most straightforward way of declaring victory with this HoloShed project would be to do the same:
- Set up a system in a VM, tweak with it and futz with it until I was ready to try it on the Deck
- Export the package lists and configuration files
- Run the Arch installer on the Deck,
pacstrap
all the packages I had listed, copy over my configuration files - Validate that everything was working
- Post these steps, configuration files and package lists to reddit.
- Rake in the karma
But that seemed like a cop-out. ChimeraOS, Endeavour and my beloved elementaryOS are more than just blog posts. Now, part of that is that each of those projects has developed their own apps for use on their distro, and (I think) each additionally maintain their own package repositories, but the more critical difference that makes these projects proper distros is that they each have guided installers.
Enter Calamares 🐙
When Googling "How to make a Linux distribution," Calamares comes up pretty quick.
It's the installer framework used by Endeavour, KaOS, Manjaro and even non-Arch distros like Lubuntu and Peppermint. While there are other installer frameworks out there, Calamares seemed like the best place to start.
What is Calamares?
Calamares provides a customizable graphical installer that you--the distro author--can customize so that a user can run that graphical installer and set up their Linux desktop exactly how you--again, the distro author--want it. It does this through an extendable collection of modules that a distro author can customize to their heart's content.
What isn't Calamares?
What took me far too long to grok was that Calamares does not create the entire LiveCD or installation ISO. It is just the GUI installer itself, and even after you're done configuring it, you still need to create your own installation medium.
(I mean, you don't really--you could, say, build Calamares as an AppImage, run it from a full desktop, and install your distro to an external drive or, for the Deck explicitly, a microSD, but that's not the road I want to go down)
Building a LiveCD, or, Making a Linux to Make Your Linux
So I started this project with the intention of building my own Linux distribution. What I didn't realize is that I'd be making two. Luckily, there are plenty of tools for making bootable ISOs either from scratch or from an existing installation, so the only question now is whether to start with the chicken or the egg?