Skip to content

About

System installer for Sunlight Linux, in Go. UEFI-only: partitions (GPT, LUKS, LVM, RAID), installs the base with xbps, sets up GRUB and a first boot under slinit. Installed in VMs and on bare metal. Reads clr-installer's config format; independent Apache-2.0 code.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

slinstaller

Tests Release Go License: Apache-2.0

Part of Sunlight Linux · slinit · slpam · slinstaller · slkernel · slpkgs · sldocs · slmanifests

The system installer for Sunlight Linux, written in Go. It runs as root from a UEFI-booted live medium, partitions the target disk, installs the base system with xbps, sets up GRUB for UEFI and configures a first boot under slinit.

Project Details
Latest release v2.9.0 (2026-12-01) — see CHANGELOG.md
Verified so far Unit, fuzz, user-namespace and loop-device suites in CI; manual UEFI installs in a VM and on bare metal (Intel NUC) — see Testing
Stability STABILITY.md — early bootstrap: flags, output and Go packages may change; the one contract is reading clr-installer's config format
Requires Go 1.25+ to build (go.mod names toolchain go1.27.4, the one CI builds and tests with); to run: root, UEFI firmware, and the tools listed in doc/packaging.md
License Apache 2.0

slinstaller reads the config format of clr-installer, Clear Linux's installer, so an existing clr-installer config.yaml describes the same install here, and its wizard follows clr-installer's layout. clr-installer is GPL-3.0 and slinstaller is Apache-2.0, so clr-installer is a design reference only: the config schema and the behaviour are implemented, its code is not used. The base system comes from the Void lineage (xbps, Void's repository) with Sunlight's own packages — sunlight-base, slinit, slpam — from the live medium's repository or the signed Sunlight mirror; see doc/packaging.md for the order in which xbps searches them.

Deliberately out of scope: BIOS/MBR booting, systemd, and Clear Linux's own parts (swupd, bundles, telemetry); a graphical front-end and ISO generation; zfs, bcache, erofs, iSCSI, multipath and NVMe over TCP (by decision, for later); and shrinking xfs, which the filesystem does not allow.

New here? Read doc/config.md: the config format, the rules a config is checked against before any disk is touched, and the keys slinstaller adds to clr-installer's. Building a live ISO? Read doc/packaging.md.

Build

go build -o slinstaller ./cmd/slinstaller

For a live medium, build it static and stamped (CGO_ENABLED=0, -X main.version=); doc/packaging.md has the line and what the ISO must carry.

Quick start

slinstaller is destructive, so it defaults to a dry run and makes you confirm. A minimal config is at the top of doc/config.md; demo/ and demo/vm/ hold worked ones (LUKS, LVM, LVM on LUKS, RAID 1, reuse).

# See the disks
./slinstaller --list-disks

# From a config file: print the plan (touches nothing), then carry it out
./slinstaller config.yaml
sudo ./slinstaller --apply config.yaml      # retype the disk path to confirm

# Or interactively (no config file): pick a disk and answer a few questions
sudo ./slinstaller

The plan is every command the partition stage runs — parted, cryptsetup, mdadm, pvcreate/vgcreate/lvcreate, mkfs — in the order --apply runs them; what the live system still holds on those disks (arrays, volume groups, old signatures) is listed after it, as what is released first. What --apply would refuse on this machine (a target disk missing, a partition, of size 0 or zram, a disk in use, one shared with a disk the install leaves, a volume group name already taken, a Safe install's new partition on a disk that is not GPT or that parted would number otherwise) is said as "it will refuse"; the dry run still exits 0 — that is a fact of the machine, not of the config — while --system-check exits non-zero for it.

Useful flags: --repo/--keys/--arch/--packages for the base install, --root for the target mount tree, and --through <stage> to run only up to a stage (for VM testing). An encrypted layout takes its passphrase from --crypt-file, SLINSTALLER_LUKS_PASSPHRASE or a prompt — never from the config. slinstaller --help lists every flag; slinstaller --completion bash (or fish) prints a completion script for them (see completions/).

⚠️ Partitioning, formatting and bootloader installs are irreversible. Try changes in a VM (QEMU + OVMF) against a scratch image — see demo/vm, a harness that boots a Void live ISO under OVMF, hands in the binary over a 9p share, installs to a scratch disk and boots the result. Never on a disk with data you care about.

Installing from the live medium

  1. Boot the live medium in UEFI mode. slinstaller refuses to install from a BIOS/legacy boot. Unless the install is --offline, the live system needs a network with DNS and CA certificates: the base system comes over HTTPS.
  2. As root, run slinstaller. On a real terminal this is the full-screen wizard, laid out as clr-installer's: a Required tab (Choose Timezone, Choose Language, Configure the Keyboard, Choose Edition, Configure Installation Media, Manage User, Kernel Command Line) and an Advanced tab (network, proxy, hostname, kernel, mirror, automatic updates, additional bundles, saving the config, and the kernel tuning sections). Configure Installation Media offers Destructive (erase the disk, a standard layout), Advanced (lay out the partitions yourself) and Safe (install into free space, keeping what is there) installations.
  3. Over a serial console or a pipe, or with --text, it is a plain prompt flow instead: disk, root filesystem, encryption, swap, hostname and one administrator. It has no edition or network questions, so it installs Minimal Server on dhcpcd.

On the KDE live medium the wizard starts on the Minimal KDE edition (Choose Edition changes it). When the live system runs NetworkManager, as the KDE live medium does, the installed system gets NetworkManager and the live Wi-Fi profiles, unless an interface was given a static address under Configure Network Interfaces.

For an unattended install, write a config (start from doc/config.md, slinstaller --template file.yaml, or --discover /dev/sdX for an install beside what is on the disk), check it with slinstaller --system-check config.yaml, then run slinstaller --apply config.yaml. Password hashes for users come from slinstaller --genpass -. The config may also be an https:// URL.

When an install fails

  • Before any disk is touched, a missing tool, an unreachable mirror, a package xbps cannot resolve or a config that fails validation stops the install with the reason; --system-check runs the same checks on their own.
  • The log of every --apply and wizard install is /tmp/slinstaller.log on the live system (--log names another file); a completed install copies it to /root/slinstaller.log on the target, beside the config it installed, /root/slinstaller.yaml. --log-level 2 keeps the terminal to the stages and the result.
  • A failed install leaves a diagnostics archive in /tmp — the error, the log, the disks and the config without its password hashes — and says where (--diagnostics names it). Attach it to a bug report.
  • To continue an unfinished install, run the same --apply command with --resume (it failed installing the base system) or --resume-from <stage> (base-install or a later stage); nothing is partitioned or formatted again, and after a reboot of the live medium the encrypted volumes, arrays and volume groups are brought back first.
  • To look around what a --through run left mounted, --in-target "cmd" runs a command in the target and --unmount takes it all down.

What it does

The install runs as an ordered sequence of stages; --through stops after any of them, and --resume-from restarts an unfinished install from base-install or a later stage:

pre-install hooks → partition → mount → bind /proc,/sys,/dev
  → base system (xbps) → fstab → swap file → bootloader (GRUB-EFI)
  → first-boot config → network → save config → post-install hooks
Area What it does
Disk GPT, an EFI System Partition (1G in the layouts slinstaller writes itself, since 2.7.0), partitions by parted; mkfs.* / mkswap; the last partition can fill the disk
Encryption LUKS on any partition typed crypt, or with encrypted: true on a type: lvm partition or a RAID array (cryptsetup, crypttab, rd.luks cmdline, initramfs rebuild)
LVM, RAID volume groups and logical volumes (lvm2), software RAID arrays (mdadm) — see Servers
Swap a swap partition, or a swap file (swapFileSize)
Base system xbps-install from a repository, with the signing keys and a chrooted reconfigure
Bootloader GRUB for UEFI (grub-install + grub-mkconfig), kernel arguments from the config
Initramfs dracut, built for the machine (hostonly) for a plain root, with a generic image (no graphics drivers, about 49 MB) and its own boot entry; an encrypted, LVM or RAID root keeps the generic one; initramfs: generic opts out (since 2.6.0)
Kernel settings command-line profiles, console log level, CPU governor and P-State mode, kdump reservation — see Kernel settings
First boot hostname, timezone, console keymap, locale, user accounts (with wheel sudo for admins and SSH keys)
Edition Minimal Server (the default, sunlight-base alone), Server (plus a server's tools and all firmware) or Minimal KDE (a Plasma desktop with SDDM, NetworkManager, PipeWire and Bluetooth) — the edition key, since 2.9.0; see config.md
Network dhcpcd (DHCP by default; static interfaces become /etc/dhcpcd.conf stanzas), or NetworkManager with the live system's Wi-Fi profiles carried over (networkManager, since 2.8.0; Minimal KDE implies it)
Hooks pre/post-install commands, chrooted or not, with $chrootDir/$chrooted

The interactive front-ends (above) produce the same config a file would, and the same core installs it — see doc/architecture.md.

On a target that has slinit and its boot service, the bootloader stage adds init=/usr/bin/slinit to the kernel command line unless the config sets an init= of its own; a default install (sunlight-base) is such a target. --packages base-system,grub-x86_64-efi,glibc-locales installs a plain Void system with runit instead.

Documentation

Document What it covers
doc/config.md The config: format, validation rules, clr-installer keys read as their Sunlight counterpart, slinstaller's own keys, kernel settings
doc/architecture.md The config as the one document, the front-end/core boundary, the clean-room rule toward clr-installer, the packages, the safety gates
doc/packaging.md Putting slinstaller on a live ISO: build line, tools, keys, local repository, offline installs
doc/port-status.md Coverage of clr-installer's feature set, package by package, and what is left
demo/vm/README.md The QEMU + OVMF harness: building, installing inside the guest, booting the result
tests/README.md The loop-device stage tests and every CI job
completions/README.md bash and fish completions, generated from the flags
third_party/bubbletea/README.slinstaller.md Why bubbletea is vendored, and what was left out
CHANGELOG.md Every release, with what each one verified
STABILITY.md What may and may not change between releases
SECURITY.md Reporting a vulnerability; the security-relevant areas
CONTRIBUTING.md · CODE_OF_CONDUCT.md How to contribute
CLAUDE.md · EXAMPLES.md Guidelines for LLM-assisted work, with installer examples

Cross-project documents in sldocs: the install pipeline spec; the requirements that an installed system boots slinit and updates from the Sunlight mirror (both partially met); and four findings — the mirror silently dropped, skipValidationAll widening destruction, the terminal-query stall and 2.3.0 built with a vulnerable Go.

Testing

go vet ./... && go test ./...
sudo tests/loop/run.sh ./slinstaller     # partition and mount stages on loop devices
Layer What it proves Where
Unit suite The logic, through recorded commands and stubbed sysfs; CI runs it with -race and a 95% coverage floor beside the code under pkg/, cmd/
User namespace A whole install, every stage, with real mounts and stand-in tools, for plain, encrypted, LVM, LVM-on-LUKS, RAID 1, encrypted-/home and reuse layouts; it checks the files the stages write, not that the result boots pkg/controller/e2e_ns_test.go and the other *_ns_test.go
Fuzzing 15 targets that check properties, 20 s each in CI Fuzz* in pkg/, cmd/
Loop devices Partitioning, --discover, shrinking ext4/ntfs/btrfs with data intact, btrfs subvolumes, a partitioned RAID 1 tests/loop
Dry run Every demo config, and a --template config, still plans CI dry-run job
VM install GRUB, a real xbps-install, the first boot — the only test of what follows the mount. Manual, not in CI; run routinely by the maintainer, including with 2.3.x, but not recorded per release; the CHANGELOG entries for 2.1.1, 2.2.0 and 2.3.0 say no VM install was made before each was cut, and 2.9.0's records a Minimal KDE install from the live KDE medium in QEMU that boots to SDDM and into Plasma demo/vm
Bare metal An Intel NUC7i5BNH installed from a USB stick with v2.1.0 on 2026-11-21, which boots slinit as PID 1. Manual, a maintainer's run, not repeated per release —

tests/README.md describes each CI job.

Contributing

Read CONTRIBUTING.md first: test destructive changes in a VM, never on a real disk; keep every destructive step gated; UEFI only. Within the Sunlight tree, slinstaller lands at src/installer/ through slmanifests:

repo init -u https://github.com/sunlightlinux/slmanifests.git -b main
repo sync -j4

License

Apache License 2.0.

About

System installer for Sunlight Linux, in Go. UEFI-only: partitions (GPT, LUKS, LVM, RAID), installs the base with xbps, sets up GRUB and a first boot under slinit. Installed in VMs and on bare metal. Reads clr-installer's config format; independent Apache-2.0 code.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages