Build Pipeline spk-compile
spk-compile (Project SmechDeployV2) is the sovereign build orchestrator
for the entire Smech Labs OS stack. It is a single standalone Python 3 script with
zero external dependencies — no pip, no venv, no external build system abstraction.
Every build phase is implemented inline. SmechDeploy (the old collection of numbered
shell/Python scripts) is retired; spk-compile is the build system.
Smech-Labs/SmechDeploy repository is archived. Do not use the old
numbered scripts (01_compile_core_system.sh etc.) — they are gone.
Use spk-compile.py for all OS builds.
Download
| File | Version |
|---|---|
| spk-compile.py | v2.2.0 |
curl -fsSL https://github.com/Smech-Labs/spk-compile/releases/download/v2.2.0/spk-compile.py -o spk-compile.py
python3 spk-compile.py --version
Full release notes: github.com/Smech-Labs/spk-compile/releases/tag/v2.2.0
Getting spk-compile
git clone https://github.com/Smech-Labs/spk-compile.git
cd spk-compile
Or call it directly from inside spk (as
spk build-image since spk v2.5.0 -- spk compile
now means "build one package's source into a .spkg",
see spk's README):
spk build-image smechos
spk build-image smechvisor --phase kde
spk build-image --list smechos
spk locates spk-compile.py at
/usr/share/spk/spk-compile.py or
/opt/smechdeploy/spk-compile.py.
What it builds
| Output | Profile | Command |
|---|---|---|
| SmechOS root filesystem (glibc/systemd desktop, current) | smechos-plasma-live |
python3 spk-compile.py smechos-plasma-live |
| SmechOS live ISO (glibc/systemd desktop, current) | smechos-plasma-live |
python3 spk-compile.py smechos-plasma-live --iso live |
| SmechOS root filesystem (musl/OpenRC, lightweight/legacy) | smechos |
python3 spk-compile.py smechos |
| SmechOS install ISO (musl/OpenRC, lightweight/legacy) | smechos |
python3 spk-compile.py smechos --iso install |
| SmechVisor root filesystem | smechvisor |
python3 spk-compile.py smechvisor |
| SmechVisor install ISO | smechvisor |
python3 spk-compile.py smechvisor --iso install |
| SmechVisor deploy shim ISO | smechvisor |
python3 spk-compile.py smechvisor --iso shim |
Prerequisites
smechos-plasma-live build needs an exact set of host
packages (a specific GCC version, matching Qt6/KDE build deps, kernel
build tools) that is impractical to reproduce by hand. The
Dockerfile in the repo builds this environment once,
reliably, from a plain ubuntu:24.04 base — see
"Building in a container" below. Running spk-compile.py
directly against a bare host is only realistic for
build-one.sh's single-package builds.
- x86_64 Linux host with Docker or Podman
- Root /
--privilegedcontainer access (kernel build, module installs) - ~50 GB free disk space for source downloads and build artifacts
- Internet access (sources are downloaded on demand and cached)
Source tarballs are cached in spk-compile-sources/ (adjacent to
--target, bind-mount this as a persistent volume). Re-runs
skip already-cached files and already-completed phases via stamp files
under spk-compile-sources/.stamps/.
Building in a container
# Build the compile image once (cached after the first run)
podman build -t ghcr.io/smech-labs/smechos-build:latest -f Dockerfile .
# docker build works identically if you have Docker instead of podman
# Run the full build
docker run --rm --privileged --cgroupns=host \
-v /path/to/spk-compile-sources:/mnt/spk-compile-sources \
-v /path/to/smechos_build_root:/mnt/smechos_build_root \
-v /tmp/smechos_build:/tmp/smechos_build \
ghcr.io/smech-labs/smechos-build:latest smechos-plasma-live
spk-compile.py invocation
(cmd_iso(), triggered by --iso live, runs
instead of the phase list, not after it). Phase completion is
stamp-file-persisted, so this second run doesn't redo any of the first
one's work — it only assembles the ISO from the already-built rootfs.
mkdir -p /path/to/smechos-iso-output
docker run --rm --privileged --cgroupns=host \
-v /path/to/spk-compile-sources:/mnt/spk-compile-sources \
-v /path/to/smechos_build_root:/mnt/smechos_build_root \
-v /tmp/smechos_build:/tmp/smechos_build \
-v /path/to/smechos-iso-output:/mnt/smechos-iso-output \
ghcr.io/smech-labs/smechos-build:latest smechos-plasma-live --iso live
The finished ISO lands at
smechos-iso-output/smechos-plasma-live.iso.
The container runs as root, so the ISO output
directory ends up root-owned on the host. Hashing/signing as a
regular user afterward needs a chown first, or
sha256sum ... | tee and gpg fail to write
their output files silently:
sudo chown -R $(whoami):$(whoami) /path/to/smechos-iso-output
cd /path/to/smechos-iso-output
sha256sum smechos-plasma-live.iso > smechos-plasma-live.iso.sha256
gpg --detach-sign --armor smechos-plasma-live.iso
If a phase fails on a missing package, that's normal — it's a one-line
Dockerfile fix, not a real bug. Find the Ubuntu -dev
package providing the missing CMake/Meson dependency, add it to the
relevant apt-get install block, and rebuild — Docker layer
caching keeps this to seconds, and completed phases/packages are
skipped via the stamp files, so you only re-pay for the phase that
failed. A handful of dependencies aren't in apt at all (KDE-adjacent
projects on their own release schedule, or small third-party
libraries) — those get built from source inline in
phase_kde(); copy the existing pattern there for a new
one.
Build Profiles
SmechOS
# Full build
sudo python3 spk-compile.py smechos
# Single phase
sudo python3 spk-compile.py smechos --phase kde
# Custom target path
sudo python3 spk-compile.py smechos --target /mnt/my_build_root
# Build install ISO
sudo python3 spk-compile.py smechos --iso install
SmechVisor
# Full build
sudo python3 spk-compile.py smechvisor
# Deploy shim ISO only
sudo python3 spk-compile.py smechvisor --iso shim
List phases
python3 spk-compile.py --list smechos
python3 spk-compile.py --list smechvisor
Phase Reference
SmechOS phases (24, profile smechos-plasma-live)
| # | Phase name | What it does |
|---|---|---|
| 1 | userland-glibc | Bootstrap GNU userland against host glibc |
| 2 | etc | Write /etc skeleton: hostname, hosts, fstab, passwd, group, os-release, locale.conf |
| 3 | systemd | Install systemd from Debian packages |
| 4 | systemd-config | Configure baseline systemd state |
| 5 | locale | Generate en_US.UTF-8 locale |
| 6 | grub | Compile GRUB 2.12 EFI (x86_64) + BIOS (i386) from source |
| 7 | qt-deps | Compile Qt6 6.10.3 modules: qtbase, qtdeclarative, qtsvg, qtwayland, qtmultimedia, qt5compat… |
| 8 | mesa | Compile Mesa 24.3.4 with radeonsi, nouveau, swrast gallium + Vulkan AMD/Intel/virtio drivers |
| 9 | cmake-bootstrap | Bootstrap CMake 3.31.6 |
| 10 | wayland | Build Wayland 1.24.0 |
| 11 | wayland-protocols | Build wayland-protocols 1.48 |
| 12 | libinput | Build libinput 1.28.0 |
| 13 | kde | Compile KDE Frameworks 6.24.0 + Plasma 6.6.6 |
| 14 | plasma-configure | Configure display manager (autologin, SDDM fallback) |
| 15 | kwin-deps | Copy KWin compositor runtime deps from the build host |
| 16 | xwayland-deps | Fetch Xwayland + xkbcomp + xkb-data |
| 17 | qt6uitools | Ensure Qt6UITools .so is present |
| 18 | kernel | Compile Linux 6.12.16: defconfig + KVM, VFIO, IOMMU, RDNA, EFI stub, virtio |
| 19 | firmware | Clone the full upstream linux-firmware tree from git.kernel.org (pinned tag) |
| 20 | patch-metadata | Patch /etc/os-release and KDE .desktop files for SmechOS branding |
| 21 | discover | Compile AppStream 1.0.4, PackageKit 1.3.0, compile Plasma Discover |
| 22 | calamares | Build the Calamares graphical installer |
| 23 | firefox | Install Mozilla Firefox stable |
| 24 | live-initramfs | Build the busybox live initramfs |
| — | bundle | Bundle output into spk-installable category-level .tar.xz packages |
| — | bundle-spkg | Emit one real .spkg per tracked component (currently every KF6/Plasma/Qt6 module) from recorded install manifests |
SmechVisor phases (8)
| # | Phase name | What it does |
|---|---|---|
| 1 | musl | Same as SmechOS musl phase |
| 2 | userland | Same as SmechOS userland phase |
| 3 | etc | Same as SmechOS etc phase (no desktop entries) |
| 4 | openrc | Deploy OpenRC with hypervisor runlevel config |
| 5 | inittab | Write inittab (tty1 only, OpenRC) |
| 6 | kernel | Compile Linux 6.12.16 with KVM + VFIO + IOMMU mandatory |
| 7 | grub | Compile GRUB 2.12 EFI + BIOS with intel_iommu=on amd_iommu=on iommu=pt in boot cmdline |
| 8 | smechvisord | Fetch smechvisord binary, install to /usr/bin/, write OpenRC init script |
Source versions pinned
| Component | Version |
|---|---|
| Linux kernel | 6.12.16 |
| GRUB | 2.12 |
| Qt6 | 6.10.3 |
| KDE Frameworks | 6.24.0 |
| KDE Plasma | 6.6.6 (LTS) |
| Mesa | 24.3.4 |
| Wayland | 1.24.0 |
| wayland-protocols | 1.48 |
| libinput | 1.28.0 |
| CMake (bootstrap) | 3.31.6 |
| AppStream | 1.0.4 |
| PackageKit | 1.3.0 |
SmechOS builds against glibc + systemd, not musl/OpenRC —
the leaner musl/OpenRC stack is used only by the headless
smechos-bitcoin profile (see spk-compile.py's
SMECHOS_BITCOIN_PHASES), not the desktop
smechos-plasma-live profile this page documents.
Adding a new phase
- Write a Python function
def phase_myfeature(target): ...inspk-compile.py. Usedownload(),extract(),cmake_install(), ormeson_install()helpers. - Add a tuple
("myfeature", phase_myfeature, "Description")to the relevant phase list —SMECHOS_PLASMA_LIVE_PHASESfor the desktop build, orSMECHOS_PHASES/SMECHVISOR_PHASES/SMECHOS_BITCOIN_PHASESfor the other profiles — at the correct position. - Run with
--phase myfeatureto test in isolation before committing to the full build.