Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

Part IX. System

41_system is the largest phase of the build. It installs every port that needs no graphics and no toolkit: the services the machine boots into, networking, storage and file systems, the command line, cryptography, the audio and image codecs, fonts, and the science, radio and hardware libraries. Read this part to find where a non-graphical package is built, or to decide where a new one belongs.

The phase also builds KDOS’s own artwork and the first of KDOS’s own programs to be built as ports. Two of KDOS’s programs come earlier: kpkg and kinstall are built by hand in Part III, and kinstall is built again here as the kdos-installer package.

This introduction covers:

The package pages follow, one chapter per shelf, in the order ports/shelves lists the shelves. Within a chapter the ports appear in the order kpkgdepends builds them.

What belongs here

A port’s dependency closure is the port together with everything it depends on, directly or through other ports. A port is installed here when nothing in that closure is graphical:

What the port is for does not matter. A terminal game, a text-mode browser or the data files of a graphical game is a 41_system port when its closure stays clear of that list, even though its shelf is an application shelf. That shelf’s other ports are then in Parts X to XII. The table of every phase and what puts a port in it is in Which phase lists a port.

The same rule explains a few chapters that look out of place in this part:

The list, by shelf

The phase’s list of ports is the directory script/phases/41_system/packages.d/. It holds:

The build reads the files in sorted order as one list. Which shelf file names a port decides the chapter it appears in; naming it in 00-order.txt also fixes when it installs (see Package lists). Almost every shelf of ports/shelves has a file here. Most of the chapters fall into these groups:

The machine itself
base (the D-Bus daemon, the system logger, snooze, the s6 tools, procps), auth (PAM, polkit, elogind, turnstile, sudo, Kerberos, fingerprint readers), boot (Limine, efibootmgr, the firmware and microcode), disk and filesystem (partitioning, LVM, RAID, LUKS, SMART, and the tools of every file system KDOS can create or read), containers (crun, conmon, netavark, passt and the other pieces podman runs on), and network (NetworkManager, wpa_supplicant, ModemManager, nftables, chrony, the VPN clients).
Libraries the later phases link
base-libs, devlibs, formats, database, archiver, crypto, net-libs and i18n: the C and C++ utility libraries, XML, JSON and protobuf, the database engines and stores (SQLite itself is built earlier, in 30_foundation), compression, GnuTLS, NSS and the smartcard stack, the networking libraries, and the Unicode, bidirectional-text and line-breaking libraries.
The command line
shells, cli, files, sysmon, editors, mail, chat, transfer, servers and net-diag: terminal programs and daemons, from tmux and zsh to Neovim, WeeChat, OpenSSH and the network diagnostics.
Codecs and media data
audio-io (ALSA and the PulseAudio client library; PipeWire itself is Part X’s), audio-codecs, audio-dsp, music-libs, video-libs and image-libs, and the fonts chapter, which carries FreeType and Fontconfig as well as the font packages.
Science and hardware
sci-libs, math, astronomy, bioscience, gis, eda, embedded, sdr-hw, sdr, hamradio, hardware, mobile, optical and ai: numerical libraries, cross toolchains for microcontrollers, radio drivers, and the device tools.
KDOS’s own
src-art (the theme generator kdos-theme, the KDOS icon themes, the wallpapers, the boot splash and the kdos-bb demo) and src-system (kdos-pack, kdos-boxinit, the two books, kdos-doc and kdos-kfs, and the installer package, kdos-installer). Their chapters come last in the part, after every shelf.

The other chapters, such as toolchain, security, printing and the game shelves, hold the ports of their subject whose closure reaches no graphics.

The order file

00-order.txt sorts ahead of every shelf’s file, so the ports it names are resolved first, in the order it gives. A group of ports written there in a fixed order is a run. The file’s header says what it is for:

#   41_system: System
# ---------------------------------
#   00-order — runs whose order a comment pins
# ---------------------------------
#
# Everything with no graphics and no toolkit in its dependency closure:
# services, networking, storage, the command line, codecs, and the science and
# hardware libraries.
#
# The files in packages.d are read in sorted order as one list. Together they
# name every port the phase installs and nothing it does not;
# testing/phaseclosure.py fails when a dependency pulls a port in from outside
# them, or when a shelf file names a port an earlier phase installs.
#
# This file sorts first, so its runs install before any shelf file's ports, in
# the order written. A run is here because a comment pins its order; everything
# else is in the file of its shelf.
#
# Under `kdosbuild --port-jobs` this file is also the phase's serial prefix:
# its ports, and every port the resolved order puts among them, build and
# install one at a time, and no other port of the phase starts before the last
# of them is installed. A pair whose order matters only because both install
# the same path is pinned here too; kdosbuild names such a pair when a level's
# commit moves a path the serial order would not have.
#
# It is also the one file that may name a port an earlier phase installs: kpkg
# skips that port while its recipe hash is current and rebuilds it here, in this
# order, when the recipe has changed.

script/phases/41_system/packages.d/00-order.txt

A run belongs here only when a comment beside it can say why its order matters and depends = cannot express it. Two such cases:

This file is also the only place in the phase’s list that may name a port an earlier phase installed.

Finally, the file is the phase’s serial prefix: the part of the phase that a parallel build still runs one port at a time. kdosbuild --port-jobs normally builds the ports of a phase level by level, several at once. The ports this file names, and every port the resolved order places among them, build and install one at a time instead, and no other port of the phase starts until the last of them is installed. Every run written here therefore makes the build slower. A file that names no port, like the one above, leaves the prefix empty, and the whole phase is built level by level.

When a parallel build commits a level and kdosbuild sees a path move from one package to another in an order the one-at-a-time build would have refused, it names the pair and asks for it to be pinned here; see Building a package phase by level.

Which ports have full pages

Each port gets one of three kinds of page, described in The three tiers.

Tier A ports have a full page with a hand-written note beside the recipe. In this phase they are the parts of the system KDOS is built around that need no graphics:

Tier B ports also have a full page, because something about them is unusual: a patch, a vendored bundle of dependencies, a build.sh longer than 30 lines, or 20 or more ports that depend on them. In this phase the last reason picks out the libraries much of the tree links, such as GLib, FreeType, Fontconfig, libpng, the audio codecs, libxcb, Boost and NumPy.

Every other port of the phase is shown on a compact card (Tier C).

See also