building selo (selo-) Linux 01/11/2025

nasin-pipali-eselo-LINISU

selo (selo-) Linux began started as an idea for a Linux distribution that i'd come up with recently. it's born out of a distaste of the ideology of modern GNU/Linux distros, specifically for the usage of technically bloated and cumbersome software.

i'm not too sure whether this stems from a desire of preceived grandiosity, an accumulation of bad decisions, or something else enirely, but i felt sick of it all.

also, i am aware that creating a new Linux distro is a trite idea, but this isn't for you.

the "philosophy"


before i get started, i want to create a set of ground rules to prevent any irratation.

as with any set of rules, there are going to be exceptions. with this project that's the use of the Linux kernel and the gcc toolchain (the latter can be removed during stage 3).

inspiration


this project is heavily inspired by the suckless philosophy (which i had subconsciously ripped off while writing the first paragraph, apologies) and especially nyght's excellent Suckless From Scratch.

i also want to draw attention to glaucus Linux for its simple package repository system (i.e. core) as i want to implement something similar for the project's planned package manager, ante (ante-) (name probably not final).

departures from GNU/Linux


selo (selo-) Linux is fundamentally opposed to the usage of GNU software. this is due to a myriad of reasons, but it mainly boils down to a pattern of exceedingly long and complex code, superfluous and wordy documentation, and some of Richard Stallman's personal beliefs. this is not to discredit the amazing work that the people at his organisation has done, but GNU software simply isn't a fit for selo (selo-) Linux.

as a result of this (and some other factors), there are going to be major changes from your typical Linux-based operating system, the main one being the use of a Plan 9 user space, provided by plan9port.

Plan 9 userland


Plan 9 (Plan 9 from Bell Labs) is an operating system that iterates on the UNIX philosophy, but not as much as something like Inferno, therefore the commands provided should feel similar to most Linux users. its user space is used in this project as it's source code is of excellent quality, concise, and extension-free. however, one especially radical difference is the shell implementation, rc, which has a completely different syntax compared to typical Bourne-like shells such as sh, bash, or zsh.

if you're interested in a more true to form version of Plan 9, it lives on today as 9front, give it a go.

Plan 9 libc and musl libc


Plan 9's libc is the primary libc for selo (selo-) Linux and musl libc is used as a fallback. as a consequence, this eliminates the possibility of using the proprietary NVIDIA driver; besides, the Nouveau open source driver is a brilliant alternative and this distro isn't necessarily intended for graphically-intensive workloads/gaming.

simplified FHS (Filesystem Hierarchy Standard)


there is no /usr, /sbin, /media, /run, or /srv directories. this is because selo (selo-) Linux is primarily an exercise in minimalism and these directories are simply not necessary for the functionality of the system.

building the system - prerequisites


this is the portion of the article that's especially derivative of Suckless From Scratch and Linux From Scratch, where i'll start crafting a working operating system from the ground up. by the time you're reading this, you (probably) won't have to do this and a stage 3 tarball for your processor's architecture should be available somewhere for you to download.

as an aside, this section only really exists as a reference to my future self on how to build the system, but if you're curious, you're of course welcome to read (or even follow) along.

building the system - stage 1 (toolchain)


for this step, you'll need a few things:

for this installation, i'll be using Linux Mint as the bootstrapping environment because i'm lazy.

1.1 - configuring the disk(s)


as is true with any typical Linux installation, the first step will be to partition and format the disks. because this is Linux, you can go about this in a few ways; i'll trust that if you're reading this, you've done something like before and not bore you with the details.

once you've partitioned and formatted your disk(s), mount the root partition somewhere on your live environment (i'll be using /mnt).

1.2 - fleshing out the root directory


use the following shell command to recursively create the root subdirectories of the system:

mkdir -p /mnt/{proc,dev,sys,tmp,root,lib,include,bin,etc/ssl/certs} \
         /mnt/var/cache/ante/{recipes,sources}

since this distro doesn't use (e)udev, you'll need to create the character special device files yourself:

mknod -m 600 /mnt/dev/console c 5 1
mknod -m 666 /mnt/dev/null c 1 3
mknod -m 666 /mnt/dev/zero c 1 5
mknod -m 666 /mnt/dev/random c 1 8
mknod -m 666 /mnt/dev/urandom c 1 9

if you're curious about where exactly some of these magic numbers come from, see mknod(1), null(4), and random(4). as for console, i have no idea.

1.3 - getting a toolchain


W.I.P.

building the system - stage 2 (cross compilation)


W.I.P.

building the system - stage 3 (native compilation)


W.I.P.