Skip to content
StatusQuickstartDocsArchitectureDesign Run locally
Docs / Reference / Configuration

SwiftOS Configuration Reference

This reference documents the build, boot, test, and guest defaults used by the current checked-in SwiftOS system. It is the place to look when you need the exact Make variables, generated artifacts, QEMU profiles, seeded accounts, runtime paths, or acceptance-test knobs.

Use this with:

Defaults At A Glance

Area Default
Architecture aarch64
Kernel/userland ABI target aarch64-none-none-elf
Primary board QEMU virt
Direct boot CPU cortex-a72
Direct boot RAM 256M
Direct console QEMU -nographic serial
Direct kernel image build/kernel.elf
Direct base filesystem build/base.img attached read-only through virtio-blk
Direct DTB build/virt.dtb loaded at 0x4FF00000
UEFI firmware AAVMF/edk2 AArch64 firmware
UEFI disk image build/swift-os.img
Guest init /bin/swos-init, falling back to /bin/console-login
Login shell /bin/busybox ash
Writable guest storage /tmp tmpfs (ephemeral) and /data datafs (persistent, when a data disk is attached)
Package overlay fixture build/pkghello-payload.img
Package-store fixture build/pkgstore-pkghello.img
LLM model files stories260K.bin and tok512.bin staged directly under /models; verified stories15M serving generations staged under /models/stories15M

The target is static and intentionally small. There is no Linux syscall ABI and no dynamic loader. Writable guest state is split by lifetime: ephemeral /tmp (tmpfs) and the persistent /data tier (datafs, on a dedicated virtio-blk disk). There is still no general-purpose persistent writable root filesystem — the base image stays immutable. To decide where a given setting belongs, see SETTINGS_GUIDE.md.

Choose A Configuration Change

Use this table before editing Make variables, QEMU commands, or guest seed files. It names the configuration source, the rebuild step, and the proof that the change took effect.

Need Change Rebuild or run Proof
Use a different Embedded Swift toolchain Override TOOLCHAIN or SWIFTC make tools-check, then make build Tool path in tools-check and successful kernel build
Use a different QEMU binary or firmware Override QEMU or AAVMF_CODE make tools-check, then make run or make disk-run Boot test for the chosen profile
Switch from QEMU to VirtualBox board constants Set BOARD=virtualbox make BOARD=virtualbox disk VirtualBox evidence from VIRTUALBOX.md
Change base files, web content, accounts, or model bundle trust roots Edit base/ or model inputs make base-image ./tests/vfs_disk_test.sh, login or service test as applicable
Add or remove a /bin program Update userland build/staging rules make build base-image Command-specific QEMU test and command reference update
Attach networking for service tests Add -netdev user,... and virtio-net-device Manual QEMU profile or network test Focused network test
Change host-forwarded ports Change only host-side hostfwd port unless guest code also changes Manual QEMU profile Host curl or nc output plus readiness marker
Change package fixture contents Update package source, manifest, or recipe Package or ports fixture target Matching package install/overlay test
Change test pacing, ports, or SMP CPU count Override test harness variables such as SMP_CPUS or profile-specific port vars Focused test target Test output records the override

Toolchain Variables

The top-level Makefile is the source of truth for host tool defaults. Every variable below can be overridden on the make command line.

Variable Default Purpose
TOOLCHAIN $(HOME)/Library/Developer/Toolchains/swift-6.3.2-RELEASE.xctoolchain Embedded Swift toolchain root
SWIFTC $(TOOLCHAIN)/usr/bin/swiftc Target Embedded Swift compiler
HOST_SWIFTC /usr/bin/swiftc Host Swift compiler for tests and tools
LLVM /opt/homebrew/opt/llvm/bin LLVM tool directory
CLANG $(LLVM)/clang C, assembly, and EFI compile driver
OBJCOPY $(LLVM)/llvm-objcopy Kernel binary extraction
LDBIN /opt/homebrew/opt/lld/bin/ld.lld ELF linker for the kernel
LLDLINK /opt/homebrew/opt/lld/bin/lld-link PE/COFF linker for the EFI app
AAVMF_CODE /opt/homebrew/share/qemu/edk2-aarch64-code.fd AArch64 UEFI firmware
QEMU qemu-system-aarch64 QEMU binary used by make targets and tests
GDB aarch64-elf-gdb Debugger for the QEMU gdbstub
NEWLIB_GCC aarch64-elf-gcc GNU cross compiler used for newlib-linked userland

Examples:

make SWIFTC=/path/to/swiftc build
make QEMU=/path/to/qemu-system-aarch64 run
make AAVMF_CODE=/path/to/edk2-aarch64-code.fd disk-run

Check resolved tools:

make tools-check

Embedded Swift flags are toolchain-version-specific. Confirm the current Makefile and NOTES.md before changing them.

Image Build Variables

Variable Default Purpose
SSHD_HOST_SEED_FILE empty Optional hex-encoded 32-byte SSHD host-key seed staged into /etc/ssh/ssh_host_ed25519_seed during make base-image
SSHD_KEX_SEED_FILE empty Optional hex-encoded 32-byte SSHD KEX mix seed staged into /etc/ssh/ssh_kex_seed during make base-image; runtime entropy comes from SYS_RANDOM when virtio-rng is attached
SSHD_AUTHORIZED_KEYS_FILE empty Optional SSHD authorized_keys file staged into /etc/ssh/authorized_keys during make base-image
NET_IPV6_CONFIG_FILE empty Optional static IPv6 config staged into /etc/swos/net-ipv6 during make base-image; accepts address=<ipv6>/64 and gateway=fe80::1 lines
SWOS_SERVICES_FILE empty Optional boot service manifest staged into /etc/swos/services during make base-image

Board Selection

BOARD selects the target board configuration.

Value Status Kernel physical base Notes
qemu Default, primary 0x40080000 QEMU virt, RAM base 0x40000000
virtualbox Best-effort 0x08080000 VirtualBox ARM profile; see VIRTUALBOX.md

Examples:

make BOARD=qemu build
make BOARD=virtualbox disk

Changing BOARD changes the link/load base and board compile defines. The Makefile tracks the active board in build/.board and removes board-dependent artifacts when the value changes. Board-independent, slow artifacts such as busybox, the packed base image, and the newlib sysroot are kept.

Build Targets

Target Purpose
make build Build build/kernel.elf and build/kernel.bin.
make base-image Build build/base.img from base/, staged /bin, and model files.
make run Build direct-boot prerequisites and boot QEMU on the serial console.
make debug Boot QEMU with -s -S, paused for debugger attach.
make gdb Attach GDB to QEMU's gdbstub on :1234.
make uefi Build the AArch64 EFI application at build/BOOTAA64.EFI.
make uefi-run Boot through AAVMF using a QEMU virtual-FAT ESP.
make disk Build the bootable GPT image build/swift-os.img.
make disk-run Boot the GPT disk image through AAVMF.
make run-gfx Boot the UEFI disk with ramfb, virtio keyboard, and a Cocoa display.
make docs-test Check public Markdown links/anchors, API tables, Swift bridge coverage, documentation map coverage, command references, host tool references, and full-gate stability coverage wiring.
make model Fetch LLM checkpoints/tokenizers and build the Q8 serving artifacts.
make swpkg Build the host-side .swpkg tool.
make swpkg-header-integrity-test Verify .swpkg rejects tampered header trust fields before verification or payload extraction.
make pkgstore Build the host-side package-store image tool.
make pkgrepo Build the signed static package repository tool.
make sshkey Build the host-side SSH key helper for generating SSHD seed files and deriving OpenSSH host-key lines from them.
make sshd-host-key-rotation-test Build a temporary base image with a generated SSHD host-key seed and prove host OpenSSH pins the rotated key.
make sshd-kex-seed-test Build a temporary base image with a generated SSHD KEX seed and prove SSHD loads it while completing OpenSSH remote exec.
make sshd-authorized-keys-test Build a temporary base image with a generated SSHD authorized key and prove OpenSSH accepts it while rejecting the default fixture key.
make sshd-supervision-test Build a temporary base image with sshd-once and prove swos-init restarts SSHD between two host OpenSSH commands.
make sshd-ipv6-listener-test Build a temporary base image with sshd6 and prove /bin/sshd -6 autostarts as an AF_INET6 listener under ipv6=on.
make sshd-ipv6-supervision-test Build a temporary base image with sshd6-once and prove swos-init restarts the AF_INET6 SSHD listener; on hosts with IPv6 hostfwd, also prove two host OpenSSH commands before and after restart.
make sshd-runtime-entropy-test Attach QEMU virtio-rng and prove SSHD marks KEX as runtime-seeded while completing OpenSSH remote exec.
make sshd-deploy-preflight-test Build a temporary Hetzner-style deploy image with static IPv6, deploy SSHD seeds, deploy authorized_keys, sshd6, and virtio-rng, then prove /bin/netinfo reports that state in the guest.
make hetzner-deploy-bundle-test Run the SSHD/static-IPv6 deploy preflight with SSHD_DEPLOY_EVIDENCE_DIR enabled, then verify the generated handoff bundle contains public deploy evidence and no private seeds.
make net-static-ipv6-test Build a temporary base image with Hetzner-style static IPv6 config and prove the kernel applies it at boot.
make swport Build the ports catalog and recipe helper.
make package-fixture Build and verify the sample package plus payload image.
make package-store-fixture Build and inspect the sample package-store image.
make package-local-install-fixture Build the writable package-store image used by local target-side install tests.
make package-overlay-test Run the package overlay acceptance test.
make package-store-test Run the package-store boot activation acceptance test.
make package-local-install-test Run target-side local .swpkg install against a writable package-store disk.
make package-repo-fixture Build the signed sample package repository fixture.
make package-repo-install-test Run target-side install by package name from the signed sample repository fixture.
make ports-catalog-test Validate the seed ports catalog.
make ports-recipe-test Validate checked source-port recipes and recipe helper flows.
make ports-lua-repo-fixture Cross-build Lua and publish its signed local repository fixture.
make ports-zlib-repo-fixture Cross-build zlib/minigzip and publish its signed local repository fixture.
make ports-bzip2-repo-fixture Cross-build bzip2 tools/libbz2 and publish its signed local repository fixture.
make ports-zstd-repo-fixture Cross-build zstd tools/libzstd and publish its signed local repository fixture.
make ports-xz-repo-fixture Cross-build xz tools/liblzma and publish its signed local repository fixture.
make ports-libarchive-repo-fixture Cross-build libarchive/bsdtar and publish its signed local repository fixture.
make ports-ca-certificates-repo-fixture Build the data-only CA certificate package and signed local repository fixture.
make ports-openssl-repo-fixture Cross-build OpenSSL and publish its signed local repository fixture.
make ports-pcre2-repo-fixture Cross-build PCRE2/pcre2grep and publish its signed local repository fixture.
make ports-tzdata-repo-fixture Build the data-only IANA time zone package and signed local repository fixture.
make ports-nginx-repo-fixture Cross-build nginx and publish its signed local repository fixture.
make ports-sqlite-repo-fixture Cross-build SQLite and publish its signed local repository fixture.
make package-lua-install-fixture Build the writable package-store image used by Lua/ports repository install tests.
make package-lua-repo-install-test Run target-side Lua install from the signed Lua repository fixture.
make ports-seed-repo-fixture Publish Lua, zlib, bzip2, zstd, xz, libarchive, ca-certificates, OpenSSL, pcre2, tzdata, nginx, and sqlite into one signed seed repository.
make package-ports-seed-repo-install-test Run target-side install of the checked seed repository packages by name.
make ports-static-host-publish Copy the seed repository into a deployable static-host web root.
make package-static-host-repo-install-test Run the hosted-layout package repository install test.
make ports-hosted-url-verify Verify a deployed static package repository URL from the host.
make ports-hosted-url-verify-test Verify the static package host root through an HTTP URL from the host.
make package-static-host-dns-repo-install-test Run target-side package install from a DNS-resolved hosted repository URL.
make package-hosted-url-install-test Run target-side install from an explicitly supplied hosted repository URL.
make test Run host tests plus QEMU acceptance tests, including the C5 driver-service/device-authority aggregate.
make stability-coverage-test Check that the full gate still includes required memory/resource, hardware/SMP, security/isolation, update, package, network, C5, and UEFI coverage.
make smp-test Run the default SMP boot smoke.
make smp-release-guard Run static SMP release-readiness contract checks.
make smp-release-contract Alias for the SMP release-readiness guard.
make phase1-roadmap-test Check Phase 1 roadmap, notes, Makefile target, docs, and executable-marker alignment.
make qemu-virt-hardware-map-test Validate QEMU virt PL011, GIC, timer, PSCI, CPU topology, and virtio-mmio DTB facts for the supported SMP profiles.
make s4-resource-stress-test Run the SMP resource-boundary stress gate under -smp 4.
make smp-cpu-utilization-test Run the per-CPU utilization top gate under -smp 4.
make s5-scheduler-placement-test Run the S5b bounded EL0 scheduler placement gate under -smp 4.
make s5-placement-stress-test Run the S5c repeated EL0 placement stress gate under -smp 4.
make s5-el0-fanout-test Run the S5d independent EL0 fanout gate under -smp 4.
make s5-thread-fanout-test Run the S5e shared-address-space thread fanout gate under -smp 4.
make s5-run-any-placement-test Run the S5f run-any EL0 placement gate under -smp 4.
make s5-test Run the aggregate S5 readiness gate (S5a through S5f) under -smp 4.
make c5-driver-service-test Run the C5 driver-service/device-discovery smoke under -smp 4.
make c5-device-handle-test Compatibility alias for the C5 driver-service/device-metadata gate under -smp 4.
make c5-device-discovery-test Compatibility alias for the C5 driver-service/device-metadata gate under -smp 4.
make c5-device-metadata-test Run the focused C5d virtio-input discovery metadata gate under -smp 4.
make c5-device-authority-test Run the focused C5e device authority envelope gate under -smp 4.
make c5-device-rights-test Run the C5f metadata-only device-grant rights guard.
make device-authority-cap-test Run the C5g guest denial gate for device discovery and claim authority.
make c5-test Run the aggregate C5 driver-service/device-authority readiness gate (C5a through C5g).
make s0c-test Run only the SMP state-audit target.
make s0-test Run the S0 SMP readiness gate.
make s1-test Run the Phase 1 SMP readiness gate.
make newlib Build the local newlib sysroot.
make busybox Build the static busybox binary used as the shell.
make busybox-check Validate the busybox configuration.
make clean Remove generated build products under build/.
make tools-check Print resolved tool paths and versions.

make clean intentionally removes generated artifacts, not downloaded toolchains. Re-run make model, make newlib, or make busybox when those inputs are missing or stale.

Build Artifacts

Artifact Producer Consumer
build/kernel.elf make build Direct QEMU -kernel, debugger symbols
build/kernel.bin make build UEFI loader embedding
build/base.img make base-image Read-only guest base filesystem
build/virt.dtb QEMU DTB capture target Direct QEMU boot
build/virt-smp4.dtb QEMU DTB capture target SMP tests
build/BOOTAA64.EFI make uefi EFI System Partition
build/swift-os.img make disk UEFI/GPT boot
build/base-root make base-image Staging tree before packing
build/basepack host Swift tool Packs the base image
build/sshkey host Swift tool Generates SSHD host-key seed files and derives OpenSSH public host keys and known_hosts lines from /etc/ssh/ssh_host_ed25519_seed material
build/swpkg host Swift tool Creates, verifies, and extracts packages
build/pkgstore host Swift tool Creates and inspects package-store images
build/pkghello.swpkg make package-fixture Sample package file
build/pkghello-payload.img make package-fixture Read-only package payload overlay
build/pkgstore-pkghello.img make package-store-fixture Package-store bootstrap image
build/pkgstore-lua-install.img make package-lua-install-fixture Writable package-store image used by Lua/ports install tests

Direct QEMU Profile

The default direct boot profile is:

-M virt
-cpu cortex-a72
-m 256M
-nographic
-global virtio-mmio.force-legacy=false
-device loader,file=build/virt.dtb,addr=0x4FF00000,force-raw=on
-drive file=build/base.img,format=raw,if=none,id=swosbase,readonly=on
-device virtio-blk-device,drive=swosbase
-kernel build/kernel.elf

Important details:

  • force-legacy=false selects the modern virtio-mmio transport used by the drivers.
  • The DTB is loaded into guest RAM at 0x4FF00000.
  • The base image is read-only and identified as swosbase.
  • make run does not attach a NIC by default.

Network QEMU Profile

Attach virtio-net when running socket programs. This common profile forwards host TCP 8080 to guest TCP 8080, and host TCP/UDP 5555 to guest port 5555:

make build base-image build/virt.dtb

qemu-system-aarch64 -M virt -cpu cortex-a72 -m 256M -nographic \
  -global virtio-mmio.force-legacy=false \
  -device loader,file=build/virt.dtb,addr=0x4FF00000,force-raw=on \
  -drive file=build/base.img,format=raw,if=none,id=swosbase,readonly=on \
  -device virtio-blk-device,drive=swosbase \
  -netdev user,id=n0,hostfwd=tcp:127.0.0.1:8080-:8080,hostfwd=tcp:127.0.0.1:5555-:5555,hostfwd=udp:127.0.0.1:5555-:5555 \
  -device virtio-net-device,netdev=n0 \
  -kernel build/kernel.elf

Guest defaults:

Guest service Port Host access with the profile above
/bin/httpd TCP 8080 http://127.0.0.1:8080/
/bin/llmd TCP 8080 http://127.0.0.1:8080/health
/bin/tcpecho TCP 5555 nc 127.0.0.1 5555
/bin/udpecho UDP 5555 nc -u 127.0.0.1 5555
/bin/tcpget outbound default TCP 10.0.2.2:5555 Host listener on TCP 5555
/bin/nslookup default resolver UDP 10.0.2.3:53 QEMU slirp DNS

The seeded root principal has capNet; user and guest do not. /bin/httpd and /bin/llmd both bind guest TCP port 8080, so run one at a time or use separate boots.

UEFI And Graphical Profiles

UEFI boot uses AAVMF and an EFI System Partition containing \EFI\BOOT\BOOTAA64.EFI.

Virtual-FAT UEFI boot:

make uefi-run

GPT disk UEFI boot:

make disk-run

Graphical smoke boot:

make run-gfx

The graphical profile adds:

  • ramfb for an EFI GOP framebuffer.
  • virtio-keyboard-device for input smoke coverage.
  • -display cocoa on macOS hosts.
  • -serial stdio so serial logs remain visible.

The current product shell remains serial-first.

Guest Defaults

Accounts

The seeded identity source is base/etc/swos/passwd.

Login Password Principal Capability mask Operational role
root swordfish 1 0x3f Full seeded and test authority
user swordfish 2 0x0e Spawn, filesystem read, tmpfs write
guest guest 3 0x02 Spawn-only capability checks

The compatibility files base/etc/passwd and base/etc/group are generated or maintained for POSIX-like tools. Kernel authorization uses SwiftOS principals, capabilities, and handle rights.

SSH Preflight Files

The default base image includes development SSH material for the checked QEMU preflights:

Path Source Purpose
/etc/ssh/authorized_keys base/etc/ssh/authorized_keys Public keys accepted by the current /bin/sshd preflight for root
/etc/ssh/known_hosts base/etc/ssh/known_hosts Public host keys trusted by the current /bin/ssh preflight
/etc/ssh/ssh_host_ed25519_seed base/etc/ssh/ssh_host_ed25519_seed Hex-encoded 32-byte development seed used to derive the SSHD Ed25519 host key
/etc/ssh/ssh_kex_seed SSHD_KEX_SEED_FILE=PATH Optional hex-encoded 32-byte deploy seed mixed into SSHD KEX pseudo-random context
/etc/swos/net-ipv6 NET_IPV6_CONFIG_FILE=PATH Optional static IPv6 config with address=<ipv6>/64 and gateway=<link-local-ipv6> lines

Replace this material when building a deploy-specific artifact. The checked-in SSHD host-key seed and SSH client trust anchor are deterministic test material, not per-instance production identity or deploy-specific trust policy. Generate deploy-specific SSHD material, then stage it into the base image:

build/sshkey seed --out support/keys/ssh_host_ed25519_seed
build/sshkey seed --out support/keys/ssh_kex_seed
make SSHD_HOST_SEED_FILE=support/keys/ssh_host_ed25519_seed \
  SSHD_KEX_SEED_FILE=support/keys/ssh_kex_seed \
  SSHD_AUTHORIZED_KEYS_FILE=support/keys/authorized_keys \
  base-image
build/sshkey known-host \
  --host HOST \
  --seed-file support/keys/ssh_host_ed25519_seed

SSHD_HOST_SEED_FILE becomes /etc/ssh/ssh_host_ed25519_seed; SSHD_KEX_SEED_FILE becomes /etc/ssh/ssh_kex_seed; SSHD_AUTHORIZED_KEYS_FILE becomes /etc/ssh/authorized_keys; NET_IPV6_CONFIG_FILE becomes /etc/swos/net-ipv6; SWOS_SERVICES_FILE becomes /etc/swos/services when a custom service manifest is supplied.

Set SSHD_DEPLOY_EVIDENCE_DIR=PATH when running tests/sshd_deploy_preflight_test.sh to save a Hetzner-style handoff bundle with public deploy evidence, artifact hashes, and the serial log. Private deploy host-key, KEX, and login key material is intentionally omitted.

Filesystem

Path Source Writable Lifetime
/bin build/base.img No Immutable across boot
/etc build/base.img No Immutable across boot
/www build/base.img No Immutable across boot
/models build/base.img No Immutable across boot
/tmp tmpfs Yes, with capTmpWrite Lost on reboot
/data datafs on a virtio-blk data disk Yes, with fsync durability Persists across reboot when a SWDATAFS disk is attached
/usr/bin/pkghello package overlay fixture No Present only when overlay is attached

To change installed base files, edit base/ or staged userland sources, then rebuild build/base.img.

To change package payload files, rebuild the package fixture or the relevant .swpkg package.

Console

/bin/swos-init runs as the first user process when present in the base image. It reads /etc/swos/services, starts allowlisted boot services such as sshd or sshd6, and then replaces itself with /bin/console-login unless an opt-in supervised service token keeps it running as a restart loop. If swos-init is missing, the kernel falls back to /bin/console-login directly.

After successful authentication, console-login starts the configured shell. When the shell exits, init/login starts again for the next session.

The default shell is busybox ash, staged as /bin/busybox.

Package Overlay Configuration

The package fixture builds:

Artifact Meaning
build/pkghello.swpkg Sample package container
build/pkghello-payload.img Extracted read-only payload image
build/pkgstore-pkghello.img Package-store image with active generation 1
/usr/bin/pkghello Guest-visible executable from the payload

Build and verify it:

make package-fixture

Boot with the payload attached:

qemu-system-aarch64 -M virt -cpu cortex-a72 -m 256M -nographic -no-reboot \
  -global virtio-mmio.force-legacy=false \
  -device loader,file=build/virt.dtb,addr=0x4FF00000,force-raw=on \
  -drive file=build/base.img,format=raw,if=none,id=swosbase,readonly=on \
  -device virtio-blk-device,drive=swosbase \
  -drive file=build/pkghello-payload.img,format=raw,if=none,id=swospkg0,readonly=on \
  -device virtio-blk-device,drive=swospkg0 \
  -kernel build/kernel.elf

Inside the guest:

/usr/bin/pkghello

Package overlays are read-only. The current target-side install path is the narrow local .swpkg flow backed by a writable package-store image:

make package-local-install-fixture
make package-local-install-test

Repository install with name-based dependency resolution works for signed fixtures. Remove, upgrade, rollback, public hosting, and version-constraint solving remain future package-manager work.

For the package-store boot profile and current package limits, see PACKAGE_GUIDE.md.

Test Harness Knobs

Most acceptance tests accept a small set of environment overrides.

Variable Used by Purpose
QEMU Most QEMU tests Select QEMU binary
TIMEOUT Boot and SMP tests Override boot wait in seconds
AAVMF_CODE UEFI and framebuffer tests Select AAVMF firmware
HOST_SWIFTC Host Swift tests and SMP preflight Select host Swift compiler
LLVM_OBJDUMP SMP object-layout tests Select llvm-objdump
FDT_TEST SMP S1 preflight Reuse a prebuilt FDT test binary
SMP_CPUS SMP and UEFI tests Select CPU count, usually 1 to 8
SMP_DTB SMP and C5 driver-service/device-discovery tests Provide a prebuilt SMP DTB
SMP_HEADROOM_CPUS SMP headroom test Space-separated CPU counts to probe
SMP_S1_PREFLIGHT_CPUS SMP S1 preflight Space-separated CPU counts to validate
UEFI_BOOT UEFI boot test Select disk or fat boot mode
HTTPD_HOST_PORT HTTP server test Override host-forwarded HTTP port
LLMD_HOST_PORT LLM serving test Override host-forwarded LLM server port
NET_ZC_HOST_PORT HTTP throughput test Override host-forwarded throughput port
TCP_CONNECT_HOST_PORT TCP active-open test Override host listener port
C4B_SOCK_HOST_PORT IPC socket-transfer test Override host UDP port

Network tests choose high host ports automatically when their override is not set. Use overrides when running multiple trees on one host or when a firewall allows only a specific range.

Examples:

QEMU=/opt/qemu/bin/qemu-system-aarch64 ./tests/boot_test.sh
TIMEOUT=180 ./tests/smp_boot_test.sh
HTTPD_HOST_PORT=18080 ./tests/httpd_test.sh
LLMD_HOST_PORT=18081 ./tests/llm_serve_test.sh
SMP_CPUS=4 UEFI_BOOT=disk ./tests/uefi_boot_test.sh
SMP_CPUS=4 SMP_DTB=build/virt-smp4.dtb ./tests/driver_service_test.sh

Common Configuration Changes

Use A Different Swift Toolchain

make TOOLCHAIN=/path/to/swift-toolchain build

Then run:

make tools-check
make build

If Embedded Swift flags changed between toolchains, update the Makefile and document the decision in NOTES.md.

Change Guest Base Files

  1. Edit files under base/.
  2. Rebuild the base image:
make base-image
  1. Boot or test with the rebuilt build/base.img.

Add A Native /bin Program

Follow DEVELOPER_GUIDE.md. The short version is:

  1. Add the userland source.
  2. Add a build rule and ELF variable in the Makefile.
  3. Stage the resulting ELF in the $(BASE_IMG) rule.
  4. Add an acceptance test.
  5. Update COMMAND_REFERENCE.md.

Change Seeded Accounts

  1. Edit base/etc/swos/passwd.
  2. Keep compatibility views aligned when relevant.
  3. Rebuild build/base.img.
  4. Run login and capability tests:
./tests/console_login_test.sh
./tests/cap_enforce_test.sh

Change Network Ports

For manual QEMU runs, edit the hostfwd= entries in the QEMU command. For tests, prefer the port override variables listed above.

After changing socket behavior, run the relevant acceptance tests:

./tests/httpd_test.sh
./tests/tcp_echo_test.sh
./tests/udp_echo_test.sh
./tests/tcp_connect_test.sh
./tests/dns_test.sh
./tests/llm_serve_test.sh

Change Package Fixture Contents

  1. Edit fixtures/pkghello/manifest.json or the staged package root rule.
  2. Rebuild:
make package-fixture
  1. Verify in QEMU:
make package-overlay-test

Verification Matrix

Change Minimum verification
Tool path or compiler override make tools-check, make build
Kernel or direct QEMU profile make build, ./tests/boot_test.sh
Base filesystem content make base-image, ./tests/vfs_disk_test.sh, command-specific tests
Login or identity store ./tests/console_login_test.sh, ./tests/cap_enforce_test.sh
Network profile Relevant socket test plus ./tests/virtio_net_test.sh
LLM serving profile make base-image, ./tests/llm_serve_test.sh
Package overlay make package-overlay-test
Package-store activation make package-store-test
Local package install make package-local-install-test
Signed repository install make package-repo-install-test
Package artifact integrity make swpkg-header-integrity-test
Static-host or hosted package repository make package-static-host-repo-install-test, make ports-hosted-url-verify-test, or make package-static-host-dns-repo-install-test
UEFI loader or disk make disk, ./tests/uefi_boot_test.sh
SMP boot parameters make s1-test, make s4-resource-stress-test, make qemu-virt-hardware-map-test, or the milestone-specific SMP target
C5 driver-service/device-authority path make c5-device-authority-test
Documentation-only configuration update make docs-test, git diff --check, and a build or relevant acceptance test

When in doubt, run make test. It is the broad acceptance gate for this repository revision.

Not Configurable Yet

These are intentional current limits:

  • No Linux ABI mode.
  • No dynamic loader.
  • No general-purpose persistent writable root filesystem. The base image stays immutable; persistent state goes on the narrow /data tier (datafs), which has no journaling and relies on honest fsync plus application journaling for crash-safety. See SETTINGS_GUIDE.md.
  • No public hosted package channel, package upgrade, remove, rollback, or version-constraint solver. Local pkg install FILE and signed pkg repo set/pkg update [URL]/ pkg install NAME work for signed fixtures when a writable package-store image is attached, including name-based dependency resolution, streamed repository package installs, and rejection paths for expired or incompatible catalogs and package hash mismatches.
  • No production certificate store for tlsget.
  • No default graphical desktop shell.

Track product hardening in RISK_REMEDIATION_ROADMAP.md.

Edit this page on GitHub