[PATCH v6 4/8] Add B partitions to installation images

Demi Marie Obenour
2025-11-29T09:51:23Z

systemd-sysupdate never writes to the running OS partition. Instead, it
requires a separate partition to write the update into. Create a
separate partition for that purpose.

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.

Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
Reviewed-by: Alyssa Ross <hi@alyssa.is>
---
Changes since v5:
- Rebase with old patches missing.
Changes since v4:
- Leave B partitions empty.
- Leave MiB unit implicit.
- Use fixed GUIDs for blank partitions.

Changes since v2:
- Make into a standalone commit
- Do not rely on separate script to generate the images.
- Use a smaller size for the verity partition.

Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
---
Documentation/development/uuid-reference.adoc | 8 ++++++++
release/installer/run-vm.nix | 2 +-
release/live/Makefile | 6 ++++--
3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/Documentation/development/uuid-reference.adoc b/Documentation/development/uuid-reference.adoc
index 146615896104d5ab20c2e9353e5ed8f7a3dc54a6..16279c8a7e690bbaafdc3e0194f3130ba65c281c 100644
--- a/Documentation/development/uuid-reference.adoc
+++ b/Documentation/development/uuid-reference.adoc
@@ -59,6 +59,14 @@ Spectrum combined live system / installer image.

The Spectrum installer system.

+=== `18f2ccff-92f1-4bb1-a80e-24f76ecda90c`
+
+The not-yet-used B verity partition.
+
+=== `ec0c5ff3-f6b1-4adf-82b4-61336c4d135f`
+
+The not-yet-used B root filesystem partition.
+
'''

== Finding Undocumented UUIDs
diff --git a/release/installer/run-vm.nix b/release/installer/run-vm.nix
index 37b470cba890f65c3b45e743edcaaed7396e5d3b..b9907f7b6e9b502eaf4255304e3a8efb3e3632d7 100644
--- a/release/installer/run-vm.nix
+++ b/release/installer/run-vm.nix
@@ -25,7 +25,7 @@ in
writeShellScript "run-spectrum-installer-vm.sh" ''
export PATH=${makeBinPath [ coreutils qemu_kvm ]}
img="$(mktemp spectrum-installer-target.XXXXXXXXXX.img)"
- truncate -s 20G "$img"
+ truncate -s 40G "$img"
exec 3<>"$img"
rm -f "$img"
exec ${../../scripts/run-qemu.sh} -cpu max -m 4G \
diff --git a/release/live/Makefile b/release/live/Makefile
index e856f4ccb841fd003d419955d79669fac2593cd6..64d74aeadb8c26de73d892be3a1fb0f54a450d08 100644
--- a/release/live/Makefile
+++ b/release/live/Makefile
@@ -10,8 +10,10 @@ dest = build/live.img
$(dest): ../../scripts/format-uuid.sh ../../scripts/make-gpt.sh ../../scripts/sfdisk-field.awk build/boot.fat $(ROOT_FS_IMAGES)
../../scripts/make-gpt.sh $@.tmp \
build/boot.fat:c12a7328-f81f-11d2-ba4b-00a0c93ec93b \
- $(ROOT_FS_VERITY):verity:$$(../../scripts/format-uuid.sh "$$(dd if=$(ROOT_FS_VERITY_ROOTHASH) bs=32 skip=1 count=1 status=none)"):Spectrum_'$(VERSION).verity' \
- $(ROOT_FS_IMAGE):root:$$(../../scripts/format-uuid.sh "$$(head -c 32 $(ROOT_FS_VERITY_ROOTHASH))"):Spectrum_'$(VERSION)'
+ $(ROOT_FS_VERITY):verity:$$(../../scripts/format-uuid.sh "$$(dd if=$(ROOT_FS_VERITY_ROOTHASH) bs=32 skip=1 count=1 status=none)"):Spectrum_'$(VERSION).verity:162' \
+ $(ROOT_FS_IMAGE):root:$$(../../scripts/format-uuid.sh "$$(head -c 32 $(ROOT_FS_VERITY_ROOTHASH))"):Spectrum_'$(VERSION):20000' \
+ /dev/null:verity:18f2ccff-92f1-4bb1-a80e-24f76ecda90c:_empty:162 \
+ /dev/null:root:ec0c5ff3-f6b1-4adf-82b4-61336c4d135f:_empty:20000
mv $@.tmp $@

build/boot.fat: $(SYSTEMD_BOOT_EFI) $(SPECTRUM_EFI)

--
2.52.0