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

3. The fs/ overlay

Most of a KDOS root is installed by packages, but some 260 files and links belong to no package: the boot scripts, the account databases, the shell profile, the skeleton of a new user’s home, the firewall rules, the desktop’s default settings. They are kept in the repository under fs/, laid out as they sit in the root, and copied into build/fs by the first step of 10_bootstrap, 000_file_system.sh. This chapter says what is in fs/, what that step does with it, and what does not belong there; read it before you add or change a file under fs/.

What fs/ holds

fs/ mirrors the root filesystem. A file at fs/etc/inittab becomes /etc/inittab in the root, and one at fs/usr/local/sbin/kdos-dm becomes /usr/local/sbin/kdos-dm. The main areas are:

fs/etc/
The system’s own configuration: inittab, which sysvinit reads, and the boot scripts under init.d/, numbered scripts that rcS runs in order at boot, one per service or boot task, with service.disabled/ naming those that must not start; passwd, group and shadow with the accounts every machine has; profile, bash.bashrc and profile.d/; fstab, hostname, hosts, nsswitch.conf and resolv.conf; the firewall in nftables.conf and nftables.d/; KDOS’s own settings under kdos/, such as xkb.conf and zram.conf, the per-user services under kdos/user-services/, and the directories of trusted signing keys under kdos/keys/; and configuration for udev, polkit, PipeWire, ALSA, SDDM (sddm.conf.d/), turnstile and the XDG menus and autostart entries.
fs/etc/skel/
The skeleton of a user’s home directory, copied into each home when the image phase creates the users. fs/root/ holds root’s own .bashrc and .bash_profile.
fs/usr/local/
KDOS’s own scripts that belong to no port:
  • sbin/kdos-dm, which starts the display manager, SDDM, on tty1, and falls back to a password prompt there when SDDM cannot run;
  • bin/kdos-session-wrapper, the command SDDM starts the Plasma session through;
  • three helpers beside it: kdos-openarchive, which unpacks an archive no desktop application opens, kdos-updatedb, which rebuilds a user’s own file-name index, and xdg-terminal-exec, which opens a command in Konsole;
  • under lib/kdos/: session-common.sh, the shell functions the wrapper and Plasma’s environment script share; timers.sh, the one parser of every timer table, the system’s under /etc/kdos/timers.d/ and each user’s; and user-timers, which runs a user’s own timers.
fs/usr/share/
Data files:
  • under kdos/: the boot menu’s pictures (boot/), the logo, and the desktop’s default settings, the files under xdg/ with extra layers for the live medium (xdg-live/) and for a virtual machine (xdg-vm/), and data-live/, desktop entries that take the place of the image’s own in the live session alone;
  • the GSettings override in glib-2.0/schemas/;
  • bash completion for kdos, kdos-appbox, kdos-bootctl, kdos-box, kinstall, kpkg and ksvc, and a startup file, startup/ksvc.bash, that gives service the same completion as ksvc;
  • the desktop entries of KDOS’s own tools under applications/, and the menu folder for boxed applications under desktop-directories/;
  • the firmware-update remote under fwupd/remotes.d/.
fs/usr/lib64
A symbolic link to lib, so that the root has one library directory. Anything that installs into /usr/lib64 lands in /usr/lib.
fs/etc/mtab
A symbolic link to ../proc/self/mounts, the kernel’s list of mounts, for the programs that read or write /etc/mtab: lvm2’s lvextend -r and mount.nfs4 fail without it; see Mount points that must be right.

To see the whole of it, list it from the top of the repository on your machine:

find fs -type f -o -type l | sort

What the copy does with it

000_file_system.sh copies fs/ into the root on every run of 10_bootstrap, with no “already done” marker, so an edit to fs/ reaches the tree the next time the step runs. Because it runs over a tree that packages have already filled, the copy is more than a cp -r, and four things follow for whoever edits fs/:

Each of these is shown line by line, with what goes wrong without it, in The file system, the chapter on that step.

Running the step on its own

After changing anything under fs/, copy it into an existing tree and rebuild the image, without re-running the rest of the bootstrap, with a build plan. From the top of the repository on your machine:

make build BUILD_ARGS="--phases 10_bootstrap,70_image --steps 10_bootstrap:000_file_system.sh"

--phases runs only 10_bootstrap and 70_image, and --steps limits 10_bootstrap to this one script; the image phase runs whole. Narrowing a build explains both.

What does not belong in fs/

fs/ holds what no package installs. A few rules follow from how the copy works and from the system’s own principles:

See also