patches and low-level development discussion
 help / color / mirror / code / Atom feed
From: Demi Marie Obenour <demiobenour@gmail.com>
To: Spectrum OS Development <devel@spectrum-os.org>
Cc: Demi Marie Obenour <demiobenour@gmail.com>, Alyssa Ross <hi@alyssa.is>
Subject: [PATCH v3 13/14] Documentation: Update support
Date: Wed, 19 Nov 2025 03:18:36 -0500	[thread overview]
Message-ID: <20251119-updates-v3-13-b88a99915509@gmail.com> (raw)
In-Reply-To: <20251119-updates-v3-0-b88a99915509@gmail.com>

The documentation previously stated that updates were not possible
without reinstalling.  This is no longer the case, so correct the
outdated documentation and explain how to enable updates for images one
builds.

Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
---
Changes since v2:
- Move the documentation on how to enable updates to the part on build
  configuration.
- Clarify what happens if an update is interrupted.
- Move details to a technical note.
- Link to systemd-sysupdate.
---
 Documentation/development/build-configuration.adoc | 13 ++++++++++
 Documentation/installation/getting-spectrum.adoc   | 25 +++++++++++++-----
 Documentation/installation/index.adoc              |  4 ++-
 Documentation/using-spectrum/index.adoc            |  2 ++
 Documentation/using-spectrum/updates.adoc          | 30 ++++++++++++++++++++++
 5 files changed, 66 insertions(+), 8 deletions(-)

diff --git a/Documentation/development/build-configuration.adoc b/Documentation/development/build-configuration.adoc
index 545aa8c05ac40a101b5ee280015cde7ec4f3a66f..24672802d2395b9ba124baeba433bf2c4fc59193 100644
--- a/Documentation/development/build-configuration.adoc
+++ b/Documentation/development/build-configuration.adoc
@@ -20,6 +20,19 @@ The configuration file should contain an attribute set.  See
 https://spectrum-os.org/git/spectrum/tree/lib/config.default.nix[lib/config.default.nix]
 for supported configuration attributes and their default values.
 
+To enable updates, you need to specify a version, an update URL, and an update signing key.
+By default, the update URL is set to a .invalid domain and the update signing key is
+an invalid key.  Therefore, updates will not work.  To enable updates, provide a valid key
+and update server URL.  Spectrum uses
+https://www.freedesktop.org/software/systemd/man/latest/systemd-sysupdate.html[systemd-sysupdate],
+so see the https://www.freedesktop.org/software/systemd/man/latest/sysupdate.d.html[sysupdate.d]
+documentation for what you need to put on your server.  Building
+https://spectrum-os.org/git/spectrum/tree/release/updates.nix[release/updates.nix] produces an
+directory that is compatible with systemd-sysupdate, except that the signature (`SHA256SUMS.gpg`)
+is missing.
+
+Updates are signed, so the worst a compromised update server can do is fill up your home directory.
+
 .config.nix to build Spectrum with a https://nixos.org/manual/nixpkgs/unstable/#sec-overlays-definition[Nixpkgs overlay]
 [example]
 [source,nix]
diff --git a/Documentation/installation/getting-spectrum.adoc b/Documentation/installation/getting-spectrum.adoc
index e7806e0f92793320bf0cdcbdd11dbc4e713275c7..0abc83a9e6fc01084b3faa9b93eb38398b0aef27 100644
--- a/Documentation/installation/getting-spectrum.adoc
+++ b/Documentation/installation/getting-spectrum.adoc
@@ -86,13 +86,24 @@ 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 OS updates are not yet implemented, and persistent
-storage is not yet exposed to VMs.  Using the "Try Spectrum" option to
-boot Spectrum will let you try out everything in Spectrum, without
-having to go through the additional step of reinstalling Spectrum
-every time you want to use a newer version.
+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, and there is no procedure for updating to
-new versions—you have to reinstall the OS.
+currently missing.
diff --git a/Documentation/installation/index.adoc b/Documentation/installation/index.adoc
index d67c88dda062066c19c3b21e699f074cc18a6dbc..c61092c93a3965b6c4014aeaee9090532634c9be 100644
--- a/Documentation/installation/index.adoc
+++ b/Documentation/installation/index.adoc
@@ -18,6 +18,8 @@ development.
 
 == Uninstalling and Updating
 
-Currently, there is no implementation for a software update.
+Software updates are a work in progress.  If you built Spectrum yourself,
+xref:../development/build-configuration.adoc[Build configuration] for how
+to enable updates for it.
 
 You can replace Spectrum by installing another OS.
diff --git a/Documentation/using-spectrum/index.adoc b/Documentation/using-spectrum/index.adoc
index 25347a4ed7bb1f899ee0a3b85aa51da94bb954b4..5d9ea657f7c6f8c21edbf8637d2d2d0bf52f931d 100644
--- a/Documentation/using-spectrum/index.adoc
+++ b/Documentation/using-spectrum/index.adoc
@@ -11,3 +11,5 @@ Ready to get started with Spectrum? Here is what you can do next:
 
 * xref:running-vms.adoc[Start some applications].
 * xref:creating-custom-vms.adoc[Create your own VM] to use other applications.
+* xref:updates.adoc[Enable updates] so you can use newer versions of Spectrum
+  without reinstalling the OS.
diff --git a/Documentation/using-spectrum/updates.adoc b/Documentation/using-spectrum/updates.adoc
new file mode 100644
index 0000000000000000000000000000000000000000..64f085bf1e721b46076b86228adb8e86b3e5c57d
--- /dev/null
+++ b/Documentation/using-spectrum/updates.adoc
@@ -0,0 +1,30 @@
+= Updating the OS
+:page-parent: Using Spectrum
+
+// SPDX-FileCopyrightText: 2025 Demi Marie Obenour <demiobenour@gmail.com>
+// SPDX-License-Identifier: GFDL-1.3-no-invariants-or-later OR CC-BY-SA-4.0
+
+Spectrum supports updates via the `spectrum-update` command.  This
+takes the path to a staging directory as argument.  This directory
+must be on a BTRFS filesystem.
+
+Updates are atomic and take effect after the system reboots.
+If the system is rebooted, crashes, or loses power during an
+update, the update will not take effect.  Updates are digitally
+signed and Spectrum will refuse to install an update that does
+not have a trusted signature.
+
+See xref:../development/build-configuration.adoc[build configuration]
+for what is needed for updates to work.  The actual update is done using
+https://www.freedesktop.org/software/systemd/man/systemd-sysupdate.html[systemd-sysupdate].
+See its documentation for the details.
+
+== Technical Note
+
+Since Spectrum's host has no network access, the VM that does the
+updates (`sys.appvm-systemd-sysupdate`) is given a BTRFS subvolume to
+write the updates into.  It uses `systemd-sysupdate` to download the updates
+into this directory.  Once it exits, the host snapshots this directory and
+checks it for malicious filenames or non-regular files.  If the check
+passes, this directory is used as the source for `systemd-sysupdate`,
+which installs the updates to the OS volume and EFI system partition.

-- 
2.52.0


  parent reply	other threads:[~2025-11-19  8:21 UTC|newest]

Thread overview: 177+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-29 10:12 [PATCH 0/7] System updates based on systemd-sysupdate Demi Marie Obenour
2025-10-29 10:12 ` [PATCH 1/7] host/rootfs: Use full util-linux and systemd Demi Marie Obenour
2025-10-29 11:36   ` Alyssa Ross
2025-11-01  3:25     ` Demi Marie Obenour
2025-11-01 12:13       ` Alyssa Ross
2025-11-06  9:15         ` Demi Marie Obenour
2025-10-29 10:12 ` [PATCH 2/7] release/combined: Compress installation image Demi Marie Obenour
2025-10-29 11:50   ` Alyssa Ross
2025-10-29 16:51     ` Alyssa Ross
2025-11-01 22:15       ` Demi Marie Obenour
2025-11-02  0:18         ` Demi Marie Obenour
2025-11-02 12:05           ` Alyssa Ross
2025-11-02 14:42             ` Alyssa Ross
2025-11-02 19:38             ` Demi Marie Obenour
2025-10-29 10:12 ` [PATCH 3/7] tools: Add directory checker for updates Demi Marie Obenour
2025-10-29 12:01   ` Alyssa Ross
2025-10-31 20:31     ` Demi Marie Obenour
2025-11-01 12:17       ` Alyssa Ross
2025-11-01 14:09         ` Alyssa Ross
2025-11-01 18:36         ` Demi Marie Obenour
2025-11-02 12:18           ` Alyssa Ross
2025-11-02 12:43             ` Alyssa Ross
2025-11-02 19:34               ` Demi Marie Obenour
2025-11-04 15:26                 ` Alyssa Ross
2025-11-02 19:21             ` Demi Marie Obenour
2025-11-04 15:27               ` Alyssa Ross
2025-11-04 22:56                 ` Demi Marie Obenour
2025-11-06 10:15                   ` Alyssa Ross
2025-10-29 10:12 ` [PATCH 4/7] Adjust partition layout to support updates Demi Marie Obenour
2025-10-29 15:49   ` Alyssa Ross
2025-10-29 10:12 ` [PATCH 5/7] release: add install step Demi Marie Obenour
2025-10-29 12:20   ` Alyssa Ross
2025-10-29 10:12 ` [PATCH 6/7] Factor out dm-verity build rules Demi Marie Obenour
2025-10-29 12:22   ` Alyssa Ross
2025-10-31  6:39     ` Demi Marie Obenour
2025-10-29 10:12 ` [PATCH 7/7] Support updates via systemd-sysupdate Demi Marie Obenour
2025-10-29 15:48   ` Alyssa Ross
2025-11-12 22:14 ` [PATCH v2 0/8] System updates based on systemd-sysupdate Demi Marie Obenour
2025-11-12 22:14   ` [PATCH v2 1/8] host/rootfs: Install all programs from util-linuxMinimal Demi Marie Obenour
2025-11-13 12:35     ` Alyssa Ross
2025-11-12 22:14   ` [PATCH v2 2/8] host/rootfs: Install systemd-pull Demi Marie Obenour
2025-11-13 15:22     ` Alyssa Ross
2025-11-13 23:46       ` Demi Marie Obenour
2025-11-14 11:59         ` Alyssa Ross
2025-11-12 22:14   ` [PATCH v2 3/8] tools: Add directory checker for updates Demi Marie Obenour
2025-11-13 13:21     ` Alyssa Ross
2025-11-13 17:53       ` Demi Marie Obenour
2025-11-13 18:01         ` Alyssa Ross
2025-11-13 18:03           ` Demi Marie Obenour
2025-11-14 13:08             ` Alyssa Ross
2025-11-14 18:37               ` Demi Marie Obenour
2025-11-15 15:20                 ` Alyssa Ross
2025-11-12 22:14   ` [PATCH v2 4/8] Adjust partition layout to support updates Demi Marie Obenour
2025-11-13 16:00     ` Alyssa Ross
2025-11-12 22:14   ` [PATCH v2 5/8] release: Create directory with system update Demi Marie Obenour
2025-11-13 16:04     ` Alyssa Ross
2025-11-13 18:23       ` Demi Marie Obenour
2025-11-13 19:09         ` Alyssa Ross
2025-11-12 22:15   ` [PATCH v2 6/8] Support updates via systemd-sysupdate Demi Marie Obenour
2025-11-13 16:44     ` Alyssa Ross
2025-11-13 20:25       ` Demi Marie Obenour
2025-11-14 12:14         ` Alyssa Ross
2025-11-14 23:16           ` Demi Marie Obenour
2025-11-20 14:56             ` Alyssa Ross
2025-11-20 19:42               ` Demi Marie Obenour
2025-11-12 22:15   ` [PATCH v2 7/8] Documentation: Update support Demi Marie Obenour
2025-11-13 16:49     ` Alyssa Ross
2025-11-13 22:24       ` Demi Marie Obenour
2025-11-14 12:16         ` Alyssa Ross
2025-11-12 22:15   ` [PATCH v2 8/8] lib/config.nix: Validate configuration parameters Demi Marie Obenour
2025-11-13 17:16     ` Alyssa Ross
2025-11-19  8:18   ` [PATCH v3 00/14] System updates based on systemd-sysupdate Demi Marie Obenour
2025-11-19  8:18     ` [PATCH v3 01/14] host/rootfs: Install all programs from util-linuxMinimal Demi Marie Obenour
2025-11-19 14:14       ` Alyssa Ross
2025-11-20  0:12         ` Demi Marie Obenour
2025-11-19  8:18     ` [PATCH v3 02/14] host/rootfs: Install systemd-pull Demi Marie Obenour
2025-11-19  8:18     ` [PATCH v3 03/14] tools: Add directory checker for updates Demi Marie Obenour
2025-11-19 14:45       ` Alyssa Ross
2025-11-19 23:58         ` Demi Marie Obenour
2025-11-19  8:18     ` [PATCH v3 04/14] scripts: port make-gpt.sh to bash Demi Marie Obenour
2025-11-20 10:28       ` Demi Marie Obenour
2025-11-19  8:18     ` [PATCH v3 05/14] scripts/make-gpt.sh: Allow specifying partition size Demi Marie Obenour
2025-11-19  8:18     ` [PATCH v3 06/14] Support generating multiple partition UUIDs Demi Marie Obenour
2025-11-19  8:18     ` [PATCH v3 07/14] scripts: Use shell expansion to get partition path Demi Marie Obenour
2025-11-19  8:18     ` [PATCH v3 08/14] Use OS version to set partition labels and UKI name Demi Marie Obenour
2025-11-20 12:11       ` Demi Marie Obenour
2025-11-19  8:18     ` [PATCH v3 09/14] release: Compress installation images and remove live image Demi Marie Obenour
2025-11-20 12:14       ` Demi Marie Obenour
2025-11-19  8:18     ` [PATCH v3 10/14] Add B partitions to installation images Demi Marie Obenour
2025-11-19  8:18     ` [PATCH v3 11/14] release: Create directory with system update Demi Marie Obenour
2025-11-19  8:18     ` [PATCH v3 12/14] Support updates via systemd-sysupdate Demi Marie Obenour
2025-11-19  8:18     ` Demi Marie Obenour [this message]
2025-11-19  8:18     ` [PATCH v3 14/14] Validate configuration parameters Demi Marie Obenour
2025-11-22  1:23     ` [PATCH v4 00/14] System updates based on systemd-sysupdate Demi Marie Obenour
2025-11-22  1:23       ` [PATCH v4 01/14] host/rootfs: Install all programs from util-linuxMinimal Demi Marie Obenour
2025-11-25 11:56         ` Alyssa Ross
2025-11-22  1:23       ` [PATCH v4 02/14] host/rootfs: Install systemd-pull Demi Marie Obenour
2025-11-25  7:36         ` Alyssa Ross
2025-11-22  1:23       ` [PATCH v4 03/14] tools: Add directory checker for updates Demi Marie Obenour
2025-11-22  1:23       ` [PATCH v4 04/14] scripts: port make-gpt.sh to bash Demi Marie Obenour
2025-11-22  1:23       ` [PATCH v4 05/14] scripts/make-gpt.sh: Allow specifying partition size Demi Marie Obenour
2025-11-22  1:23       ` [PATCH v4 06/14] Support generating multiple partition UUIDs Demi Marie Obenour
2025-11-25 13:02         ` Alyssa Ross
2025-11-26 18:26           ` Demi Marie Obenour
2025-11-22  1:23       ` [PATCH v4 07/14] scripts: Use shell expansion to get partition path Demi Marie Obenour
2025-11-22  1:23       ` [PATCH v4 08/14] release: Compress installation images and remove live image Demi Marie Obenour
2025-11-25 13:19         ` Alyssa Ross
2025-11-25 22:38           ` Demi Marie Obenour
2025-11-28 11:09             ` Alyssa Ross
2025-11-28 19:45               ` Demi Marie Obenour
2025-11-22  1:23       ` [PATCH v4 09/14] Use OS version to set partition labels and UKI name Demi Marie Obenour
2025-11-25 14:11         ` Alyssa Ross
2025-11-22  1:23       ` [PATCH v4 10/14] Add B partitions to installation images Demi Marie Obenour
2025-11-25 16:31         ` Alyssa Ross
2025-11-22  1:23       ` [PATCH v4 11/14] release: Create directory with system update Demi Marie Obenour
2025-11-25 16:50         ` Alyssa Ross
2025-11-22  1:23       ` [PATCH v4 12/14] Support updates via systemd-sysupdate Demi Marie Obenour
2025-11-25 17:54         ` Alyssa Ross
2025-11-22  1:23       ` [PATCH v4 13/14] Documentation: Update support Demi Marie Obenour
2025-11-25 18:00         ` Alyssa Ross
2025-11-22  1:23       ` [PATCH v4 14/14] Validate configuration parameters Demi Marie Obenour
2025-11-25 18:06         ` Alyssa Ross
2025-11-25 12:22       ` [PATCH v4 00/14] System updates based on systemd-sysupdate Alyssa Ross
2025-11-26 19:40       ` [PATCH v5 00/13] " Demi Marie Obenour
2025-11-26 19:40         ` [PATCH v5 01/13] tools: Add directory checker for updates Demi Marie Obenour
2025-11-26 19:40         ` [PATCH v5 02/13] scripts: port make-gpt.sh to bash Demi Marie Obenour
2025-11-26 19:40         ` [PATCH v5 03/13] scripts/make-gpt.sh: Allow specifying partition size Demi Marie Obenour
2025-11-26 19:40         ` [PATCH v5 04/13] Port scripts/format-uuid.sh to awk Demi Marie Obenour
2025-11-26 19:40         ` [PATCH v5 05/13] Use set and a command substitution to set UUID variables Demi Marie Obenour
2025-11-26 19:40         ` [PATCH v5 06/13] scripts: Use shell expansion to get partition path Demi Marie Obenour
2025-11-28 11:20           ` Alyssa Ross
2025-11-26 19:40         ` [PATCH v5 07/13] release: Compress installation images and remove live image Demi Marie Obenour
2025-11-28 11:21           ` Alyssa Ross
2025-11-26 19:40         ` [PATCH v5 08/13] Use OS version to set partition labels and UKI name Demi Marie Obenour
2025-11-26 19:40         ` [PATCH v5 09/13] Add B partitions to installation images Demi Marie Obenour
2025-11-28 11:23           ` Alyssa Ross
2025-11-26 19:40         ` [PATCH v5 10/13] release: Create directory with system update Demi Marie Obenour
2025-11-26 19:40         ` [PATCH v5 11/13] Support updates via systemd-sysupdate Demi Marie Obenour
2025-11-28 13:47           ` Alyssa Ross
2025-11-28 20:27             ` Demi Marie Obenour
2025-11-28 20:41               ` Alyssa Ross
2025-11-28 20:44                 ` Demi Marie Obenour
2025-11-28 21:08                   ` Alyssa Ross
2025-11-28 21:28                     ` Demi Marie Obenour
2025-11-28 21:30                       ` Alyssa Ross
2025-11-26 19:40         ` [PATCH v5 12/13] Documentation: Update support Demi Marie Obenour
2025-11-26 19:40         ` [PATCH v5 13/13] Validate configuration parameters Demi Marie Obenour
2025-11-29  9:49         ` [PATCH v6 0/8] System updates based on systemd-sysupdate Demi Marie Obenour
2025-11-29  9:49           ` [PATCH v6 1/8] tools: Add directory checker for updates Demi Marie Obenour
2025-11-29 11:16             ` Alyssa Ross
2025-11-29  9:49           ` [PATCH v6 2/8] release: Compress installation images and remove live image Demi Marie Obenour
2025-11-29 11:16             ` Alyssa Ross
2025-11-29  9:50           ` [PATCH v6 3/8] Use OS version to set partition labels and UKI name Demi Marie Obenour
2025-11-29 11:16             ` Alyssa Ross
2025-11-29  9:50           ` [PATCH v6 4/8] Add B partitions to installation images Demi Marie Obenour
2025-11-29 11:16             ` Alyssa Ross
2025-11-29  9:50           ` [PATCH v6 5/8] release: Create directory with system update Demi Marie Obenour
2025-11-29 11:16             ` Alyssa Ross
2025-11-29  9:50           ` [PATCH v6 6/8] Support updates via systemd-sysupdate Demi Marie Obenour
2025-11-29 11:16             ` Alyssa Ross
2025-11-29  9:50           ` [PATCH v6 7/8] Documentation: Update support Demi Marie Obenour
2025-11-30 21:46             ` Alyssa Ross
2025-11-29  9:50           ` [PATCH v6 8/8] Validate configuration parameters Demi Marie Obenour
2025-11-26 19:33     ` [PATCH v4 00/13] System updates based on systemd-sysupdate Demi Marie Obenour
2025-11-26 19:33       ` [PATCH v4 01/13] tools: Add directory checker for updates Demi Marie Obenour
2025-11-26 19:34       ` [PATCH v4 02/13] scripts: port make-gpt.sh to bash Demi Marie Obenour
2025-11-26 19:34       ` [PATCH v4 03/13] scripts/make-gpt.sh: Allow specifying partition size Demi Marie Obenour
2025-11-26 19:34       ` [PATCH v4 04/13] Port scripts/format-uuid.sh to awk Demi Marie Obenour
2025-11-26 19:34       ` [PATCH v4 05/13] Use set and a command substitution to set UUID variables Demi Marie Obenour
2025-11-26 19:34       ` [PATCH v4 06/13] scripts: Use shell expansion to get partition path Demi Marie Obenour
2025-11-26 19:34       ` [PATCH v4 07/13] release: Compress installation images and remove live image Demi Marie Obenour
2025-11-26 19:34       ` [PATCH v4 08/13] Use OS version to set partition labels and UKI name Demi Marie Obenour
2025-11-26 19:34       ` [PATCH v4 09/13] Add B partitions to installation images Demi Marie Obenour
2025-11-26 19:34       ` [PATCH v4 10/13] release: Create directory with system update Demi Marie Obenour
2025-11-26 19:34       ` [PATCH v4 11/13] Support updates via systemd-sysupdate Demi Marie Obenour
2025-11-26 19:34       ` [PATCH v4 12/13] Documentation: Update support Demi Marie Obenour
2025-11-26 19:34       ` [PATCH v4 13/13] Validate configuration parameters Demi Marie Obenour

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251119-updates-v3-13-b88a99915509@gmail.com \
    --to=demiobenour@gmail.com \
    --cc=devel@spectrum-os.org \
    --cc=hi@alyssa.is \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

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).