patches and low-level development discussion
 help / color / mirror / code / Atom feed
blob 0abc83a9e6fc01084b3faa9b93eb38398b0aef27 4207 bytes (raw)
name: Documentation/installation/getting-spectrum.adoc 	 # note: path name is non-authoritative(*)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
 
= Getting Spectrum
:page-parent: Build and Run
:page-nav_order: 2

// SPDX-FileCopyrightText: 2022-2024 Alyssa Ross <hi@alyssa.is>
// SPDX-License-Identifier: GFDL-1.3-no-invariants-or-later OR CC-BY-SA-4.0

To get Spectrum, you need to build it from source.  As long as you're
running Linuxfootnote:[Building from other operating systems might
work, but hasn't been tested.  Patches are welcome to support building
from other operating systems, as long as they're not too invasive.]
and have https://nixos.org/download.html[Nix] and https://git-scm.com/[git]
installed, it's very easy to do.

TIP: Before you start, consider setting up the
xref:binary-cache.adoc[Spectrum binary cache], which will save you a
lot of time waiting for builds.

TIP: If you encounter build failures, especially timeouts or
out-of-memory (OOM) kills, Nix might be configured to run too many
builds at once, with too many cores per build.  See Nix's
documentation for
https://nix.dev/manual/nix/2.24/advanced-topics/cores-vs-jobs.html[tuning
cores and jobs].

== Trying Spectrum

If you want to try Spectrum out to get a feel for it, without
installing it, you can run it in a development VM with some example
applications.

[source,shell]
----
git clone https://spectrum-os.org/git/spectrum
cd spectrum/host/rootfs
nix-shell --run 'make run'
----

This builds just enough of Spectrum to try it out in a VM, but it will
still take a very long time.

== Installing Spectrum

To install Spectrum on a computer, you can use a USB drive as a
bootable Spectrum installer device.  You will need to choose whether to
try out Spectrum without installing it on your system (as a live image),
or to install it to your computer's internal storage.

=== Building A Live Image

First, you need to build the Spectrum image:

[source,shell]
----
git clone https://spectrum-os.org/git/spectrum
nix-build spectrum/release/live
----

If you haven't set up the xref:binary-cache.adoc[binary cache], this
will take a very long time.  When it's done, a symbolic link named
"result" will appear in the current directory, pointing to the
installer image.  Write that image to a USB drive, for example using
`dd` (command line) or
https://gitlab.com/bztsrc/usbimager[`usbimager`] (graphical, available
in Nixpkgs).  Boot your system from the USB drive, and Spectrum should
be ready for you to use.

=== Building The Installer

First, you need to build the Spectrum image:

[source,shell]
----
git clone https://spectrum-os.org/git/spectrum
nix-build spectrum/release/combined
----

If you haven't set up the xref:binary-cache.adoc[binary cache], this
will take a very long time.  When it's done, a symbolic link named
"result" will appear in the current directory, pointing to the
installer image.  Write that image to a USB drive, for example using
`dd` (command line) or
https://gitlab.com/bztsrc/usbimager[`usbimager`] (graphical, available
in Nixpkgs).  Boot your system from the USB drive, and you should see
a menu allowing you to "Install Spectrum".

NOTE: While it's possible to install Spectrum to your internal
storage, at this point in Spectrum's development there is not much
reason to, as persistent storage is not yet exposed to VMs.

Currently, Spectrum does not provide an update server, so
you must provide your own.  You can do this via
xref:../development/build-configuration.adoc[build configuration].
The default sets the signing key to `/dev/null` and the server
URL to an invalid value, so updates won't work.  To enable updates,
set `update-url` to the URL of your server and `update-signing-key`
to a binary GnuPG keyring to verify the updates with.  Not all possible
URLs will work, but most invalid URLs will cause an error during the
build rather than runtime misbehavior.

In the running system, the signing key is located at
`/etc/systemd/import-pubring.gpg`.  The update URL is in various files
under `/etc/updates`.  These files are read-only, but one can mount
an overlayfs on top of `/etc/systemd` and `/etc/updates` if one wants
to make changes.

CAUTION: Do not use Spectrum for anything important or sensitive as it is not
yet suitable for real-world use.  Many important security properties are
currently missing.

debug log:

solving 0abc83a9e6fc01084b3faa9b93eb38398b0aef27 ...
found 0abc83a9e6fc01084b3faa9b93eb38398b0aef27 in https://inbox.spectrum-os.org/spectrum-devel/20251121-updates-v4-13-d4561c42776e@gmail.com/ ||
	https://inbox.spectrum-os.org/spectrum-devel/20251119-updates-v3-13-b88a99915509@gmail.com/
found e7806e0f92793320bf0cdcbdd11dbc4e713275c7 in https://inbox.spectrum-os.org/spectrum-devel/20251119-updates-v3-9-b88a99915509@gmail.com/ ||
	https://inbox.spectrum-os.org/spectrum-devel/20251121-updates-v4-8-d4561c42776e@gmail.com/
found 29803aa324b196119a03b22d7f1e2d7730e2c1eb in https://spectrum-os.org/git/spectrum
preparing index
index prepared:
100644 29803aa324b196119a03b22d7f1e2d7730e2c1eb	Documentation/installation/getting-spectrum.adoc

applying [1/2] https://inbox.spectrum-os.org/spectrum-devel/20251119-updates-v3-9-b88a99915509@gmail.com/
diff --git a/Documentation/installation/getting-spectrum.adoc b/Documentation/installation/getting-spectrum.adoc
index 29803aa324b196119a03b22d7f1e2d7730e2c1eb..e7806e0f92793320bf0cdcbdd11dbc4e713275c7 100644

Checking patch Documentation/installation/getting-spectrum.adoc...
Applied patch Documentation/installation/getting-spectrum.adoc cleanly.

skipping https://inbox.spectrum-os.org/spectrum-devel/20251121-updates-v4-8-d4561c42776e@gmail.com/ for e7806e0f92793320bf0cdcbdd11dbc4e713275c7
index at:
100644 e7806e0f92793320bf0cdcbdd11dbc4e713275c7	Documentation/installation/getting-spectrum.adoc

applying [2/2] https://inbox.spectrum-os.org/spectrum-devel/20251121-updates-v4-13-d4561c42776e@gmail.com/
diff --git a/Documentation/installation/getting-spectrum.adoc b/Documentation/installation/getting-spectrum.adoc
index e7806e0f92793320bf0cdcbdd11dbc4e713275c7..0abc83a9e6fc01084b3faa9b93eb38398b0aef27 100644

Checking patch Documentation/installation/getting-spectrum.adoc...
Applied patch Documentation/installation/getting-spectrum.adoc cleanly.

skipping https://inbox.spectrum-os.org/spectrum-devel/20251119-updates-v3-13-b88a99915509@gmail.com/ for 0abc83a9e6fc01084b3faa9b93eb38398b0aef27
index at:
100644 0abc83a9e6fc01084b3faa9b93eb38398b0aef27	Documentation/installation/getting-spectrum.adoc

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).