Skip to the text
KDOS
Menu

Getting started

This chapter takes you from a download to a running KDOS desktop. It covers getting the live ISO from the releases page and checking it, booting it in a virtual machine or from a USB stick, the live session, keeping a live session’s changes, installing to a disk and the first commands to try. Its last section is for developers: building the ISO yourself from the source repository. It assumes you can type commands in a shell; it assumes nothing about KDOS itself. If you want to know what KDOS is before you try it, read Why KDOS and How KDOS differs first. The installer has a chapter of its own, Installation.

The desktop you arrive at is KDE Plasma 6.8 with the core KDE applications, compiled from KDOS’s own recipes like everything else on the medium and dressed in the KDOS look. The desktop describes it as KDOS ships it.

The chapter follows these steps in order:

  1. Download the ISO and check it.
  2. Boot it in a virtual machine to see that it works.
  3. Write it to a USB stick.
  4. Boot the stick and arrive at the desktop.
  5. Optionally, create a persistence store so that a live session keeps its changes.
  6. Install to a disk.
  7. Try the first commands on the running desktop.

What the ISO carries

A release is a live ISO: a disc image that starts a complete KDOS desktop without installing anything, and installs KDOS from there. It carries the base, the set of software every KDOS machine has:

It carries no compiler. The toolchain is the build-tools group: sudo kdos update install build-tools installs a working cc with the C library’s and the kernel’s headers. The Chinese, Japanese and Korean input methods are the lang-zh, lang-ja and lang-ko groups. Everything else is one download away, in three ways, described in full in Applications:

Way What it is
Native, prebuilt Any other of the about 2,400 ports, compiled for the release and downloaded from its signed package host, the binhost: KDE Gear (all but five modules that cannot run here), LibreOffice, GIMP, Blender, Thunderbird, Wine and the rest, one at a time or in groups
Native, built on this computer The same port compiled on the machine from its recipe
Boxed A Debian application from KDOS’s catalogue, built on demand into a rootless container of its own (a box)

Every program on the ISO and in the binhost was compiled from KDOS’s recipes, apart from a short, named list of exceptions: firmware, bootstrap seeds, compiled font files, data with no other source form and built JavaScript (see What is not built from source).

Download

The current release is on the releases page of kunaldawn/kdos, marked Latest. It carries:

File What it is
kdos-<tag>.iso (for example kdos-v0.2.iso), or kdos-<tag>.iso.part01, .part02, … The live ISO, named by the release’s tag. GitHub holds no file of 2 GiB or more, so a larger ISO is cut into parts
SHA256SUMS, SHA256SUMS.sig SHA256SUMS lists the checksums of the whole ISO and each of its parts, sources.sha256, the recipe tree, the update index, their two signatures and the release key. SHA256SUMS.sig is that list’s signature by the release key. The list does not cover its own signature, or the book files below, which are attached after it is made
kdos-release.pub The public half of the release key, key id ccb53bac7fdba3cd
kdos-ports.tar.xz, kdos-ports.tar.xz.sig The release’s recipe tree and its signature: what kdos update fetch installs as /ports
kdos-update.idx, kdos-update.idx.sig The signed index of where the release’s prebuilt packages and update image are
sources.sha256 Every upstream source file the release’s recipes name, by hash
kfs.pdf, kfs-html.tar.zst KDOS from Scratch, the book of how every part is built, attached by the books workflow a few minutes after the release is published

The release’s prebuilt packages and its update image sit in pre-releases beside it (binhost-<tag>-NN and image-<tag>). They are not downloaded by hand: a KDOS machine finds them through the release’s signed index. The sources-<N> pre-releases are the archive of upstream sources the build uses.

When the release carries the ISO in parts (.part01, .part02 and on, and no whole kdos-<tag>.iso), download every part and join them in order. Run this only for a release in parts: the shell empties kdos-<tag>.iso before cat reads anything, so on a release with one whole ISO it destroys the file you downloaded.

cat kdos-<tag>.iso.part?? > kdos-<tag>.iso

Then check the ISO:

sha256sum -c SHA256SUMS --ignore-missing

It must print kdos-<tag>.iso: OK, with the tag, for example kdos-v0.2.iso: OK.

A checksum list downloaded beside the file proves only that the two agree, not who made them. Its signature, SHA256SUMS.sig, proves the release key made it. On a machine that does not run KDOS, download SHA256SUMS.sig and kdos-release.pub too and check the signature with OpenSSL 3 and xxd:

cut -d' ' -f2 kdos-release.pub | xxd -r -p | sha256sum | cut -c1-16     # must print ccb53bac7fdba3cd
{ printf 302a300506032b6570032100; cut -d' ' -f2 kdos-release.pub; } | xxd -r -p > kdos-release.der
awk '$2=="ccb53bac7fdba3cd"{print $3}' SHA256SUMS.sig | xxd -r -p > SHA256SUMS.sig.bin
openssl pkeyutl -verify -pubin -keyform DER -inkey kdos-release.der -rawin \
    -in SHA256SUMS -sigfile SHA256SUMS.sig.bin

The first line prints the id of the key in kdos-release.pub, which must be the one in the table above. The rest wraps the raw Ed25519 key in the header OpenSSL reads, takes that key’s signature out of SHA256SUMS.sig, and prints Signature Verified Successfully when it matches. On a machine already running KDOS, kdos verify kdos-<tag>.iso checks the list and its signature against the release key the system trusts.

What you need to use it:

Need Notes
An x86-64 machine with UEFI or BIOS firmware Secure Boot must be off: KDOS’s boot loader is unsigned and KDOS enrols no keys (see Known gaps)
4 GB of memory The live system runs from memory, so what you install on it takes memory too
A USB stick at least as large as the ISO Writing it erases the whole stick. The release page gives the ISO’s size
A network, for anything outside the base Native ports and boxed applications are downloaded when you install them
A target disk for an installed system It holds two copies of the system and your home; the installer’s Welcome page reports the install size, and the Disk page offers only disks large enough (see Installation)

Try it in a virtual machine first

KDOS is developed and tested in QEMU with KVM, which virt-manager and GNOME Boxes drive as well: give the machine 4 GB of memory and UEFI or BIOS firmware. With QEMU and the OVMF firmware, at the path Debian and Ubuntu install it to:

qemu-img create -f qcow2 kdos.qcow2 192G     # sparse: it uses only what is written
qemu-system-x86_64 -enable-kvm -cpu host -smp 4 -m 4G \
    -bios /usr/share/ovmf/OVMF.fd -cdrom kdos-<tag>.iso \
    -drive file=kdos.qcow2,format=qcow2 -device virtio-vga -device virtio-net-pci,netdev=n \
    -netdev user,id=n -usb -device usb-tablet

Other distributions keep OVMF elsewhere: Arch at /usr/share/edk2/x64/OVMF.4m.fd, Fedora under /usr/share/edk2/ovmf/. Where only the split code file is installed, replace -bios <file> with -drive if=pflash,format=raw,readonly=on,file=<path>/OVMF_CODE.fd.

The disk is only needed to try the installer. From a clone of the repository, make run boots the ISO the build wrote in the same way, and make rundisk the disk once you have installed to it (see Running the result).

A plain virtio-vga adapter puts KWin, the compositor, on Mesa’s software renderer. The desktop works, but Phosphor mode, KDOS’s optional CRT look, cannot be turned on there: its full-screen effect refuses software rendering, because a pass over every pixel of every frame would take the whole processor. A guest with hardware OpenGL through virgl runs it; make run-hw boots the ISO that way from a clone. See Phosphor mode.

In a virtual machine the screen never dims, blanks or locks by itself, and the guest never goes to sleep: KDOS puts a set of virtual-machine defaults in front of its usual ones when the session finds it is a guest (see Locking, idle and power). On QEMU’s virtio-vga the Sleep action is not offered at all, because the kernel’s virtio-gpu driver does not survive a resume and leaves the console and a restart hanging after one.

On VirtualBox 7, choose the type by hand in the New VM wizard: Linux, version Other Linux (64-bit). VirtualBox cannot identify the ISO and guesses from the machine’s name, and a name containing DOS, such as KDOS, picks its DOS type, a 32 MB machine with no 64-bit mode. Give it 4096 MB of memory, keep the VMSVGA graphics controller (VBoxVGA and VBoxSVGA leave the desktop frozen on the session splash or black), and give a SATA controller no more ports than it has devices: one made with VBoxManage storagectl --add sata has 30, and probing the empty ones adds about 25 seconds to the boot. EFI is optional. Turn on 3D acceleration for Phosphor mode. KDOS ships no VirtualBox guest additions, so the screen does not follow the window and there is no shared clipboard; set the resolution in System Settings → Display Configuration. More is in Virtual machines.

A machine with too little memory stops right after the boot menu with the boot loader’s PANIC: High memory allocator: Out of memory or PANIC: linux: Failed to allocate memory for kernel and a stack trace; QEMU’s default of 128 MiB does, which is why the command above passes -m 4G. One with enough to boot but clearly less than the 4 GB the table asks for shows a failed MEMORY stage on the boot splash, naming how much it has, and boots on; the desktop may come up with the memory guard closing applications to keep it up, or stall before it draws.

Write the medium

The ISO is a hybrid image. Write it to a USB stick as a raw byte stream, replacing /dev/sdX with your stick. Everything on that device is lost:

sudo dd if=kdos-<tag>.iso of=/dev/sdX bs=4M status=progress conv=fsync

On Windows or macOS, any tool that writes a raw disk image does the same (Rufus in DD mode, balenaEtcher). Turn Secure Boot off in the firmware before booting the stick. A Ventoy stick boots the ISO copied onto its data partition: choose Boot in normal mode in Ventoy’s menu. A stick that holds copies of the ISO’s files, as Rufus’s ISO mode or a copy onto a FAT stick makes, does not boot: Limine and the kernel start, and the boot stops at “Failed to find the KDOS live medium.” with a line saying to write the whole ISO.

The stick must be at least as large as the ISO. The same image boots four ways: with BIOS or UEFI firmware, from an optical drive or from a stick. It carries two El Torito boot records for optical drives, one for each firmware, and for a stick a partition table with an EFI System Partition plus BIOS boot code in its first sector. The dd above is therefore the whole job: there is no separate step to make the stick bootable.

On a machine already running KDOS, ISO Image Writer does the same from a window. Two things to know about it:

The ISO fits a DVD too. Burn it as a disc image, not as a file on a data disc: on Linux, growisofs -dvd-compat -Z /dev/sr0=kdos-<tag>.iso; on Windows, the ISO’s Burn disc image menu entry.

Once you have one working stick, a running KDOS system can copy itself to another without a second computer:

sudo kdos clone            # list the devices it may write to
sudo kdos clone /dev/sdb   # copy this boot medium onto /dev/sdb

kdos clone takes the image’s length from the image itself rather than from the device, so a small image on a large stick copies only the image. It refuses the medium it booted from and any device that is mounted or named in /etc/fstab. When f3probe is installed it tests the target for a counterfeit capacity first, and after the copy it verifies the target by reading it back with the page cache dropped. --yes skips the confirmation, --no-probe and --no-verify skip the two checks, and --source <path> clones an image file or another device instead of the boot medium. See Copying and rebuilding the medium.

Boot

KDOS boots on BIOS and UEFI alike through the Limine bootloader, so the menu looks the same either way. Select the stick in your firmware’s boot menu and the KDOS menu appears.

The menu counts down for ten seconds and then boots the first entry, so an ordinary boot needs no keystroke. Press Up or Down during the countdown to stop it; the menu then waits for you to choose. Enter, Space and Right boot the highlighted entry at once, even during the countdown.

Entry Boots
KDOS Live The normal live session
KDOS Live (clean session) The same, ignoring the persistence store for one boot (the kernel argument nopersist)
KDOS Live (verbose) The same, with no splash: every kernel message and every line of the boot scrolls by on the screen (loglevel=7 in place of quiet loglevel=3, and the screen named last of the consoles)
Memory Test (memtest86+) memtest86+ instead of the kernel. UEFI only: the entry is hidden on a BIOS boot, and absent from an image built without the memtest86+ port

Every KDOS Live entry names both console=tty0 and console=ttyS0,115200n8, so kernel messages also reach a serial line, at 115200 baud, 8 data bits, no parity and one stop bit.

Reading the splash

What you see during boot is the KDOS splash, drawn directly to the screen: the KDOS mark, a penguin, fading in, the release it boots under it (Kool Desktop Operating System 0.2, in the form kdos version gives), and a progress bar with the name of each stage as it starts. With Phosphor mode on it plays a CRT power-on instead (see Phosphor mode). The initramfs, the small early filesystem the kernel starts from, runs the first stages; the service scripts of the real system run the rest. The bar never moves backwards: the first 15% is the initramfs’s and the rest the service scripts’. If a boot stops, the last stage named tells you where:

Stage If it stops here
DEVICE MANAGER udev did not come up
RAID Software RAID assembly. Shown only when mdadm is in the initramfs; finding no array is normal
FILESYSTEM MODULES Loads the loop, ISO 9660, squashfs and overlay modules. This stage never stops the boot itself: a module it could not load shows up as a failure at SYSTEM IMAGE or OVERLAY ROOT
BOOT SLOT An installed system reads its boot state from the EFI System Partition. It waits up to ten seconds for that partition, and when it cannot read the state it keeps the root named on the kernel command line, so this stage does not stop the boot
VOLUME GROUPS An LVM volume group would not activate. Not fatal by itself; the root lookup says whether the root was in it
UNLOCKING The encrypted root’s passphrase was refused three times
ROOT DEVICE An installed system’s root partition did not appear within ten seconds
BOOT MEDIA No device carrying the KDOS image appeared within ten seconds
SYSTEM IMAGE The system image on the medium would not mount
MOUNTING ROOT, OVERLAY ROOT The installed root filesystem, or the live overlay, would not mount
SWITCHING ROOT The handover to the real root failed
MEMORY Shown only on a machine with less than 2.75 GiB of memory, marked FAIL with the size in the stage’s name, such as MEMORY 442 MIB, NEEDS 4 GB. A 4 GB machine reports 2.9 to 3.8 GiB, depending on what its firmware and graphics keep back, and passes. The boot carries on, and the desktop may stall before it appears
MOUNTING FILESYSTEMS onward The boot is in the service scripts, and the failing service names itself: its stage is marked FAIL, and the last lines of its output appear under WHY:. Both stay on the splash for the rest of the boot, so you can photograph them

The boot splash during the service scripts, with the progress bar and the current stage

When the initramfs cannot continue, it does not reboot. It shows the reason on the splash, then leaves you at a shell on the first console (tty1) with the reason printed above it, so you can look around. The screen also says that Ctrl+Alt+Del restarts the computer at once, and to run sync first if you changed a disk. The serial line gets a shell too, beside the full boot log.

The progress bar stops one segment short of full, so a boot never shows 100% before it has finished; it fills only on a boot that ends at a text console, and a boot that ends at the login screen hands over at that hold. Boot and init describes what happens at each stage.

Log in

When the service scripts have finished, the splash holds its last picture until it hands the screen to the login screen, SDDM, in the KDOS look. The live medium logs in by itself. An installed machine shows the login screen and asks for a password, unless it was installed with automatic login (see 6. Accounts). After the login, Plasma’s own splash, KSplash, shows the same penguin in the same place while Plasma starts. Its bar picks up where the boot splash’s stopped, at 99%, one segment short of full, rather than starting again, so the boot, the login and the desktop read as one continuous start.

The image ships one human account:

User name kdos
Password kdos
Groups wheel (which grants sudo and the administrator’s actions in System Settings), plus tty, dialout, audio, video, cdrom, render, input, kvm, users, lpadmin and brlapi (which lets Orca and other programs write to a braille display through BRLTTY)

On the live image the root password is also kdos. The installer asks for your own user name and password, locks the root account by default, and never carries the live image’s root password over.

The consoles are laid out like this:

Console What it gives you
tty1 The login screen, and the desktop of an automatic login
tty2 An ordinary text login prompt: the recovery console
tty3 and on A desktop started from the login screen takes the next free console, normally tty3
ttyS0 On the live medium, root logged in on the serial line, with no password. An installed system asks for a login there

From the desktop, Ctrl+Alt+F2 reaches the recovery console; Ctrl+Alt+F1 returns to the login screen, or to the desktop when it was an automatic login, and Ctrl+Alt+F3 to a desktop the login screen started. At a text console, Alt+F1 to Alt+F3 do the same.

How the desktop starts

/etc/inittab gives tty1 to kdos-dm, which starts SDDM once the boot scripts have finished. SDDM’s login screen (its greeter) runs on KWin, with no X server anywhere on the path. When you log in, SDDM runs the KDOS session wrapper as you: it reads your login shell’s profile, checks that your session bus answers, and starts Plasma.

If SDDM cannot start, or exits three times within a minute, kdos-dm puts a text password prompt on tty1 instead, so the machine can still be repaired. That prompt never logs anyone in automatically, and SDDM is tried again after you log out of it once the minute has passed. tty2 is a plain text login whatever tty1 does. Boot and init describes the console and the handover, and The session everything that starts after the login.

A text-console login opens with the KDOS banner, drawn one line of pixels at a time. Only the first shell of a terminal prints it (SHLVL 1): a nested shell, or a shell inside a container, does not repeat it. Any keypress skips the rest of the animation, and setting KDOS_NO_ANIM prints it without one.

The KDOS banner at a text-console login

The text console uses the KDOS console font, ter-kdos32n, at 16x32 pixels, in the colours of the machine’s accent (see The boot menu, the splash and the text consoles).

The first session

The first login of an account opens Welcome Center on the KDOS tour. Its pages cover:

Make It Yours lists the groups (games, office, graphics, the KDE collections, Chinese, Japanese and Korean input, and more), each with what it downloads. Tick some and press Install: after your password, each is downloaded ready-made, one at a time. The page ends with a button to Discover for everything else.

Until the computer has the release’s package list, the page shows no sizes and offers nothing to install. Connect to a network, open Discover, press Refresh on its Updates page, then press Look Again. When no package host can be found for this release (the last refresh found none, the recipe tree published online is older than this computer’s, or the computer has one system slot, whose refresh takes no newer tree), the page says that no group can be installed ready-made and offers only Discover, which can build programs on this computer.

Make It Yours is the last KDOS page; Plasma’s own Enjoy It! page follows it and ends the tour. Every choice on the tour takes effect at once and can be changed later.

On the live medium the tour opens at every login, on a page with a large Install KDOS button, and a second page offers to keep the session’s changes on the stick. Starting Welcome Center again from the application launcher opens the same live tour, with both pages; its Privacy page says the live session keeps no wallet.

What’s New is not part of the tour. It shows the release notes of the version now running, and opens by itself at most once per version, when the version running differs from the one this account was last shown:

It waits until the login is confirmed, about a minute in, once the desktop has stayed up: a boot that is not confirmed may be rolled back at the next start, so it shows nothing. It does not open:

To read the notes at any other time, open Release Notes in the application menu (type release notes there or in KRunner), or run kdos update notes. Release Notes opens the same page, as plasma-welcome --pages 90-WhatsNew.qml. On a fresh install it names the version running and points at System Settings → System Versions, which shows the versions on this computer. On the live medium it names only the version running and says it is running from the live medium, with no System Versions button, since the live medium has no system slots. While the tour is open, Release Notes brings the tour’s window forward with the notes over it, and Back returns to the tour.

Adding software to the live session

The live session installs software the way an installed machine does, into its writable layer, which is memory unless the session has a persistence store (see Keep what you change). A native port comes from the release’s binhost, whose signed index the first install takes:

kdos update groups                       # every group, whether it is installed, and its download
sudo kdos update install gimp            # one port, prebuilt
sudo kdos update install office          # a group: LibreOffice, Calibre and TeXstudio

Discover does the same from a window, and lists the catalogue’s boxed applications beside the native ports. What a live session installs takes memory, and without a persistence store it is gone at the restart. The downloaded package files take memory only while they install: on the live medium each one is deleted once it is installed. An install whose downloads do not fit in the room left is refused before anything is downloaded, naming what it needs and what is free. Applications describes the three ways to get software.

Keep what you change

A live session’s changes are held in RAM and are gone when the machine powers off. To keep them, create a persistence store: an ext4 filesystem labelled KDOS_PERSIST, which the initramfs uses as the writable layer of the live system instead of RAM.

sudo kdos persist create            # on the stick you booted from
sudo kdos persist create /dev/sdb   # on another device
kdos persist                        # does a store exist, and is this session using it?

The live Welcome tour’s persistence page runs the same command, and lets you pick another USB stick when one is plugged in. kdos persist create adds one partition in the free space after the last partition on the device, by default the stick you booted from. Nothing already on the device is moved or rewritten; a blank stick is given a partition table first. It asks you to type yes before it writes; --yes skips the question. It refuses to make a second store when one already exists. A DVD cannot hold changes, and neither can a Ventoy stick, whose KDOS is a file inside Ventoy’s own partition. Started from a DVD, or from a Ventoy stick under UEFI or BIOS, kdos persist says so, and kdos persist create refuses the boot medium. Either way, kdos persist create and the Welcome page need another USB stick or a disk to put the store on, named as sudo kdos persist create /dev/sdX.

The store is found by its label rather than by a device name, so it can equally live on a second stick or an internal disk, and it keeps working when USB devices come up in a different order. kdos persist create makes it ext4. A store made by hand may use another Linux filesystem, but not NTFS: overlayfs cannot use it as its writable layer, and the initramfs refuses such a store by name, which kdos persist reports as refused. FAT and exFAT cannot carry the 12-character label at all, so a store on either is never found.

A new store is used from the next boot, not the one that created it; kdos persist reports whether the running session is writing to it. If a change ever stops the desktop coming up, the KDOS Live (clean session) menu entry ignores the store for one boot without deleting it. From that session, remove the bad change:

sudo kdos persist reset --home     # forget the changes to home directories
sudo kdos persist reset --system   # forget everything else, keeping home directories
sudo kdos persist reset            # forget everything the store holds

reset refuses while the running session is writing to the store.

Install to disk

A live session is enough to try the desktop, and boxed applications from the catalogue install there too, but it keeps less of what they write:

An installed system keeps both. It also boots faster, and by default it is laid out for A/B updates: two root slots, where an update is written to the one not running and a boot that fails returns to the one known to work (see A/B root slots).

Start the installer from the Install KDOS icon on the live desktop, the Welcome tour’s live page or the application launcher (Kickoff). It is a window that asks for the time zone, the keyboard, the disk, encryption, your account, the look and the applications, shows what it will do, and then does it. The same installer runs full-screen on a text console, a serial line or unattended from an answer file:

sudo kinstall

The installer partitions a disk, copies the system, writes the bootloader, creates your account and offers groups of applications of two kinds (see Installation, 8. Applications):

The installer is described in full in Installation, and the program itself in kinstall.

First things to try

Open a terminal with Meta+Return or Ctrl+Alt+T (Konsole; Meta is the key with the Windows or Command logo) and run:

kdos help                # the system's commands, and where each kind of software lives
kdos doctor              # checks for the things that commonly break on this system
kdos status              # packages, boxes, exported applications and the session
kdos theme amber         # retint the entire machine, live
kdos desk dock           # lay the panels out as the Dock desk; `kdos desk undo` puts them back

kdos theme amber shows the colour system at work. Plasma, every KDE application, the open Konsole windows, the wallpaper and the lock screen take the amber accent at once. The login screen and the text consoles take it the next time each is shown (a console at its next login prompt), and the splash and the boot menu at the next boot. The live medium’s boot menu is on the read-only medium and keeps its colours. kdos theme bone restores the default. The same choice is a swatch on System Settings’ KDOS Look page, and picking a KDOS global theme on the Global Theme page carries it to the rest of the machine as well. Theming lists all eight accents.

Meta+Space (or Alt+Space) opens KRunner, which is also KDOS’s command palette: type accent amber, desk tiling, doctor, previous version or keys tile and press Enter. Meta+F1 opens the key card, every global shortcut the session holds, read from the live bindings each time, so it matches what you have rebound. The desktop describes both.

When you chose boxed applications in the installer, which records them on the new disk, your first session shows a notification saying they are ready to install rather than starting a long build unannounced. Run kdos app install --pending when you are ready, or open Discover (see Applications). Native groups chosen in the installer and not installed yet wait for sudo kdos update install --pending (su -c 'kdos update install --pending' from an account that is not an administrator), and the first login says so; kdos update groups shows what is installed.

Everything else is installed from Discover or kdos update install, prebuilt or built on the machine; Applications says which to choose.

Building the ISO yourself

The release ISO is built by the same make build anyone can run from a clone, and a developer works from an image of their own. The build compiles every port, writes the base ISO, and can also write the binhost a release publishes. How KDOS is built follows the build from git clone to the finished ISO, The build system describes its orchestrator in depth, and Developing lists every target and the narrow rebuilds that avoid a full one.

Plan for the cost before you start:

Wall time, first build Many hours; budget a day or more. Every port is compiled, whatever the ISO carries, including GCC several times over, the kernel, Qt, KDE Frameworks, Plasma and every Gear application. The build container uses every thread the host leaves idle; make build KDOS_JOBS=N caps it
Disk Tens of gigabytes of upstream source archives, fetched by make fetch; make fetch-check reports what is still missing. The build tree under build/ needs room of its own, and a complete set of phase snapshots more again, the tree compressed once plus a layer per phase. Snapshots are optional
Network Needed to clone, to run make fetch, and for the first make build on a machine, which builds its container image from Alpine Linux packages. The compile itself runs with networking switched off
Software on your machine Docker, plus a few small tools listed in the next section. Every compiler runs inside a container

Later builds are much shorter. The build runs in phases, stages that each run in order (see The build system); after each one it can save a snapshot of the tree, when asked to, so a later build can resume from that point. Most changes need only a narrow rebuild of one port or one phase. Developing describes those targeted loops.

What you need

Need Used by Notes
A Linux machine with Docker make build make build runs docker directly, in privileged mode. The build image carries the whole toolchain
git, curl, sha256sum Cloning, make fetch Ordinary downloading happens on your machine
A C compiler ($CC, default cc) make fetch, make fetch-check Optional for make fetch, which compiles a small recipe reader on the host. Without a compiler, make fetch hands the whole fetch to a container of its own (Docker or Podman, whichever is on your PATH). make fetch-check has no container fallback
fuser (from psmisc) make build Guards the finished ISO against being rewritten while a virtual machine has it open; without fuser the guard is skipped
qemu-system-x86_64, OVMF firmware at /usr/share/ovmf/OVMF.fd, /dev/kvm make run, make rundisk Only to boot the result in a virtual machine
A USB stick at least as large as the ISO Booting the image on a machine ls -l build/iso-build/kdos.iso gives the figure for your build. An image built with KDOS_IMAGE=full carries every package and is about 20 GB; it does not fit a DVD, so optical boot of it means a BD-R
A target disk for an installed system Installing The installer’s Welcome page reports the install size, the amount it copies. The default layout keeps two copies of the system plus room for each to grow, so the disk needs several times that; the Disk page says what a chosen disk holds and what the install needs

The full list, with the tools that only development work needs, is in What a development machine needs.

Build an image

git clone https://github.com/kunaldawn/kdos.git kdos
cd kdos
make fetch
make build

make fetch is the only step that downloads source code. The first make build on a machine also needs the network, to build its container image from Alpine Linux packages; after that, make build reads nothing but what the fetch left in the port directories and runs offline.

Fetching the sources

A clone carries the recipes, not the upstream source archives. A recipe, or port, is a directory holding a declarative kpkgbuild file and a build.sh (see the glossary). About 2,400 live under ports/core/, each on one of about a hundred subject shelves as ports/core/<shelf>/<name>/, and about forty more under src/. Each recipe names its source files with a sha256 = line, and make fetch downloads every such file that git does not carry. A few named files, such as bash’s upstream patches, are committed beside their recipes instead. Several ports share one archive (the LLVM tarball alone serves eight), so the distinct files are fewer than the names. The ports catalogue lists every port by shelf, with the phase that builds it.

For each file, make fetch takes the first copy it finds whose hash matches the recipe: the download cache under ports/.srccache/, then the KDOS source archive (the sources-<N> pre-releases), then the upstream URL in the recipe. A verified file is entered in the cache and hard-linked into each port directory that names it, so switching branches fetches nothing twice. The full lookup order, the variables that change it and the container that regenerates a vendored dependency bundle are described in Where sources come from.

make fetch is safe to re-run: a file already present and verified is not downloaded again. make fetch-check lists, without using the network, every archived source that is missing or corrupt, and exits 1 if it finds any. A build started without the fetch fails at the first port whose archive is absent.

Building

make build builds the container image os-dev from the repository’s Dockerfile (Alpine Linux with a compiler and build tools), then runs the build orchestrator, kdosbuild, inside it with --network none. Only the first make build on a machine needs the network, to pull Alpine and its packages; after that Docker reuses the image and the whole build runs offline.

When make build runs in a terminal, the orchestrator opens a startup picker before it does anything. Choose start fresh and press Enter to run every phase; the picker also asks whether to write phase snapshots, which is off until S turns it on. make build BUILD_ARGS=--fresh skips the picker, and --snapshot writes snapshots without it. The startup picker describes both questions.

The result is one file, the base ISO, which carries the closure of ports/base (see The base image):

build/iso-build/kdos.iso

Every package the build made stays in the build tree, build/fs, whatever the ISO carries.

make build refuses to start while that ISO is open in another program, for example a virtual machine started by make run, because the last step rewrites it and a guest reading the old image would see I/O errors. Stop the virtual machine first, or set ALLOW_ISO_IN_USE=1 to override.

A few variables change what the build produces:

Variable Effect
BUILD_ARGS="…" Flags for the orchestrator, such as --fresh, --snapshot, --continue-from <phase> or --rebuild <port>. See The build system
KDOS_ISO_SOURCES=1 Copies the ports tree with its fetched sources, src/, script/, fs/, the Makefile and the Dockerfile onto the ISO under sources/, with the binhost too when KDOS_MAKE_BINHOST=1 wrote one, together with a SOURCES stamp that kdos rebuild prints. No rebuild from such a medium has been run through every phase; see KDOS can build KDOS
KDOS_IMAGE=full The ISO carries every package the build made rather than the base: a medium for a machine that installs offline, and for the test rig
KDOS_MAKE_BINHOST=1 Also writes the signed binhost, build/binhost, with the release index a release publishes
KDOS_PACK_KDOS=1 Also packs the finished system as a base pack named kdos, written to build/kdos-base/kdos.kpack and carried on the medium under packs/

The graphical applications KDOS ports natively, from Firefox ESR, LibreOffice and every KDE Gear application to KiCad and GNU Radio, are compiled by the same build like any other port; the base ones go on the ISO and the rest into the build tree and the binhost. For software that is not ported, the ISO ships the catalogue, which describes each application as a stack of container image layers built from Debian packages; the machine that wants one builds it in a rootless Podman container. See Applications, and Packs and boxes for the container format.

When a build fails, read the failing step’s log under build/logs/ and check Build troubleshooting, which lists the recurring failures by symptom.

See also


Part II — Using KDOS, chapter 5. Previous: 4. Decisions · Contents · Next: 6. Installation