Re: [PATCH 4/7] Adjust partition layout to support updates

Alyssa Ross
2025-10-29T15:49:59Z

[-- Attachment #1: Type: text/plain, Size: 2845 bytes --]

Demi Marie Obenour <demiobenour@gmail.com> writes:

> systemd-sysupdate has strict requirements on the partition layout:
>
> - The label of the active partition must match the template in the
> .transfer file. For instance, the root filesystem of Spectrum OS
> 0.0.0 will be in a partition with label Spectrum_OS_0.0.0.
> - The label of the inactive partition must either be that of the old
> version of the OS or "_empty". The former indicates an incomplete
> update.
> - The partition type UUID must conform to the Discoverable Partition
> Specification.
>
> After installing an image to a partition, systemd-sysupdate updates the
> label of the partition to match the image's version. However, it does
> not update the partition UUID. Therefore, use the partition label, not
> the partition UUID, to find the root filesystem and its verity metadata.
>
> systemd-sysupdate will fail if the OS image does not fit in the
> partitions that the installer created. Therefor, make the partitions
> very large so that there is plenty of room for the OS to grow. This
> requires rewriting the code that calculates the partition sizes.
>
> Since the partition label includes the OS version, add an OS version
> number. Use 0.0.0 to indicate that Spectrum OS is still in very early
> development and should not be used.
>
> Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
> ---
> host/initramfs/Makefile | 17 +++++-----
> host/initramfs/default.nix | 2 ++
> host/initramfs/etc/init | 17 +++-------
> host/initramfs/etc/probe | 20 ++++++++----
> host/initramfs/shell.nix | 1 +
> host/rootfs/Makefile | 23 ++++++++------
> host/rootfs/default.nix | 3 ++
> host/rootfs/shell.nix | 1 +
> img/app/Makefile | 2 +-
> img/app/default.nix | 5 +--
> lib/kcmdline-utils.mk | 10 +++---
> lib/version.nix | 15 +++++++++
> release/checks/no-roothash.nix | 2 +-
> release/live/Makefile | 15 ++++-----
> release/live/default.nix | 11 +++++--
> release/live/shell.nix | 4 ++-
> scripts/format-uuid.awk | 35 ++++++++++++++++++++
> scripts/format-uuid.sh | 1 +
> scripts/make-gpt.bash | 72 ++++++++++++++++++++++++++++++++++++++++++
> scripts/make-gpt.sh | 67 ++-------------------------------------
> scripts/make-live-image.sh | 41 ++++++++++++++++++++++++
> scripts/sfdisk-field.awk | 3 +-
> version | 1 +
> version.license | 2 ++
> vm/sys/net/Makefile | 2 +-
> vm/sys/net/default.nix | 5 +--
> 26 files changed, 252 insertions(+), 125 deletions(-)

I expect this will change once we figure out what to do about the
installer / combined image, so I'm leaving it for now.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]