From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from atuin.qyliss.net (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id E459A1B6E5; Wed, 19 Nov 2025 08:21:38 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id A06641B5D6; Wed, 19 Nov 2025 08:21:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-0.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DMARC_PASS,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=4.0.1 Received: from mail-yw1-x1134.google.com (mail-yw1-x1134.google.com [IPv6:2607:f8b0:4864:20::1134]) by atuin.qyliss.net (Postfix) with ESMTPS id E81241B55A for ; Wed, 19 Nov 2025 08:21:18 +0000 (UTC) Received: by mail-yw1-x1134.google.com with SMTP id 00721157ae682-7866375e943so53933747b3.0 for ; Wed, 19 Nov 2025 00:21:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763540477; x=1764145277; darn=spectrum-os.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=1W6FpfAasILAAOw9lpnAidw2SX0WkO33VkE4mQdRW5w=; b=U+hv23y5Y1VNooXZmYJ4dGY/s31KGv4vBvoSUhueOi6dRmFKUoIpj82y9WBZKu//Os NAGAZt8uiOYQsaBMBemwFVgvuO0NLf1LYv+JKI6Bt1DBSgk3uMasHs2CAf0K7CfHE3CJ WXuqZbuupek3BE3GygAfN0qPPZN97S72byuI78skLohijkUzn4T0sktkv6gyvSJrEkUJ WF7zBZ1sytwTQAHO5HU5jFR15F0x80+A3e15Fjpn0+8mgL2YlQoI9T5Rs2XHbPZESArB ffwoY+r5EKHZ/74pg466o9lcxvqnpLhix5X9Pl2PCbJ2uhFftqk0lh1f9HfK66WkVon4 Xk9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763540477; x=1764145277; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=1W6FpfAasILAAOw9lpnAidw2SX0WkO33VkE4mQdRW5w=; b=gQKR2mxIzTGkKbGMnLX4fk+ZIofdpBIfB0QAxwkajIQZW7j8Klobq2Zu3Uw+ahNynq ItM4cw92cSFvwTkIStlSBnAl3HcenS6PbPkvkkgyUHQ7q6LUUbLTZcsTkbuw2u6Uxv/4 v7ebcpkhSLREYv73AKN4qu8pYtdQ7fQJV4fHZIi2i5Sj2ib9y4B52m+j6AuqmFfJ3799 0XvyglX7m3QA0Yz9FQ401V6rCFlPgeMsN22R3W2R58PoqMF/S51f23sTfNivb3iQfof0 3fzmIU5EFujeEgnDgvhUFnwWlEtX86uNcr1GBYbR7Z+VJJ+CNthtjdmnQtaffwg3NamY zFRQ== X-Gm-Message-State: AOJu0YyooO8vU4Y/+C2ZRAedYckGR3VnMF4HGNwVEEasSdIIONDtpwT/ dMlKQ3R5ICSBGxnqvbh5AyXMuAQb3V69y10aoQ0DF422jk4GMrm0zzy0sfm1hA== X-Gm-Gg: ASbGncspagiJuxbEf7U3r8mO78yMUOpjQwVeOTyqP+UG7v/D2Pddo3CLC15jSht/1Zq o6M7YjFepKjxGO+2no4dj5f6i9pirUU2yRWAPTqY3BCECHmKpG1sMG0qnLe/qwTDXTIoGrpL2bT c37e1D7UMNuDsnHVIE9ahGOOQZ8QHoTtAFDrTpHRgjWjRpYpFxSycrYYnOpbBeeWxKcmWPATguj axmTLY8l25qXPVZ6VvrxwXNtuwIP2PF8KdGxGnIjdG4S/r5f8ACMWBX4viC168KqQweoUB1AwMq rQmX+1NM4MWhiCwtDE6HOASmDlVSOXjBYoFcODR4pQ9LEBB3XNwteJt6EzIsMqqmFYjAMVIogX7 h44fyCldU56/aOm2XS+yWU1gTevaqapURsgVzYajoFef7brDYhLJG++skKSOphb+EUhzyWsKB23 jv4teKjrs4/c0gchEklfwC6XUVxLobq5WoKJfV9rNH3lnzKW4YVh0zT+e2VGFwOABAq1MXMkTnj d9jysrXHxBkWkJV88YFHYSADFIo6tUs5kk= X-Google-Smtp-Source: AGHT+IE1NMVeVTdgXBDNkP9I0kxBCLrnBqDjcJxVHOJ9oy9EOQ2szNHu0VjSQrfUn72qHjLbkaWeIA== X-Received: by 2002:a05:690c:6e09:b0:786:52df:1be0 with SMTP id 00721157ae682-78929e3f60dmr168217387b3.19.1763540476863; Wed, 19 Nov 2025 00:21:16 -0800 (PST) Received: from localhost.localdomain (h96-60-249-169.cncrtn.broadband.dynamic.tds.net. [96.60.249.169]) by smtp.gmail.com with UTF8SMTPSA id 00721157ae682-78821de1c3asm60878267b3.5.2025.11.19.00.21.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Nov 2025 00:21:16 -0800 (PST) From: Demi Marie Obenour Date: Wed, 19 Nov 2025 03:18:31 -0500 Subject: [PATCH v3 08/14] Use OS version to set partition labels and UKI name MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20251119-updates-v3-8-b88a99915509@gmail.com> References: <20251119-updates-v3-0-b88a99915509@gmail.com> In-Reply-To: <20251119-updates-v3-0-b88a99915509@gmail.com> To: Spectrum OS Development X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1763540303; l=6980; i=demiobenour@gmail.com; s=20250729; h=from:subject:message-id; bh=SK/xU0gUGYInkl4+oyIKNp9dbwoNatWxz8hnKlMLJSk=; b=e9xXzZo3HiC3yrhfYJXVfQ+JZlw/PS5r7pJ81Rzk8Xpb4Lp8NeQPSKdeHhtgN1KwANVxpJIEM m7Q7gXGb+RvCCZpI+Lkewor0mDF431DZPzdR+OtncPtjCfjpCkVZF+q X-Developer-Key: i=demiobenour@gmail.com; a=ed25519; pk=X57Q4/YQDj9t4SBeKaDwvXYKB6quZJVx/DE2Ly2out0= Message-ID-Hash: Q6AMZTDK6P22YAU7DCADCWOHW25HRDIO X-Message-ID-Hash: Q6AMZTDK6P22YAU7DCADCWOHW25HRDIO X-MailFrom: demiobenour@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-devel.spectrum-os.org-0; header-match-devel.spectrum-os.org-1; header-match-devel.spectrum-os.org-2; header-match-devel.spectrum-os.org-3; header-match-devel.spectrum-os.org-4; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Demi Marie Obenour , Alyssa Ross X-Mailman-Version: 3.3.9 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 0.0.0 must be in a partition with label "Spectrum_0.0.0", and the verity partition must have the label "Spectrum_0.0.0.verity". - The label of the inactive partition must be that of the old version of Spectrum, or "_empty" for freshly installed systems. - The partition type UUID must conform to the Discoverable Partition Specification. Also, the UKI must have a name that includes the OS version. Otherwise, it will not be deleted during updates. 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. The version number can be overridden in the build configuration file. Signed-off-by: Demi Marie Obenour --- Changes since v2: - Split off into separate commit. --- host/efi.nix | 2 +- host/initramfs/Makefile | 4 ++-- host/initramfs/shell.nix | 2 ++ host/rootfs/Makefile | 4 ++-- host/rootfs/shell.nix | 2 ++ lib/config.default.nix | 1 + release/live/Makefile | 6 +++--- release/live/default.nix | 3 +++ 8 files changed, 16 insertions(+), 8 deletions(-) diff --git a/host/efi.nix b/host/efi.nix index d0ce260bd908c186059b75a1b4f42258b0e62bff..ecedb6bea6bf29c7a7303dc9062fe12b5c7a9fbd 100644 --- a/host/efi.nix +++ b/host/efi.nix @@ -3,7 +3,7 @@ # SPDX-FileCopyrightText: 2025 Demi Marie Obenour import ../lib/call-package.nix ( -{ callSpectrumPackage, config, cryptsetup, rootfs +{ callSpectrumPackage, cryptsetup, rootfs , runCommand, stdenv, systemdUkify }: let diff --git a/host/initramfs/Makefile b/host/initramfs/Makefile index 27a26b46a8110d35ee02a63b12931d6b9c2742e5..383aa856d0b886325f3505a7596b08dad31a4851 100644 --- a/host/initramfs/Makefile +++ b/host/initramfs/Makefile @@ -39,8 +39,8 @@ build/live.img: ../../scripts/format-uuid.awk ../../scripts/make-gpt.sh ../../sc uuids=$$(awk -f ../../scripts/format-uuid.awk < $(ROOT_FS_VERITY_ROOTHASH)) && \ set -euo pipefail -- $$uuids && \ bash ../../scripts/make-gpt.sh $@.tmp \ - $(ROOT_FS_VERITY):verity:$$3 \ - $(ROOT_FS):root:$$1 + $(ROOT_FS_VERITY):verity:$$3:Spectrum_'$(VERSION).verity' \ + $(ROOT_FS):root:$$1:Spectrum_'$(VERSION)' mv $@.tmp $@ build/loop.tar: build/live.img diff --git a/host/initramfs/shell.nix b/host/initramfs/shell.nix index ff067354881b480656fae9b339a0a9068475d85f..36e3956a2ebc80fd273da226af253ebe8f7f7b24 100644 --- a/host/initramfs/shell.nix +++ b/host/initramfs/shell.nix @@ -4,6 +4,7 @@ import ../../lib/call-package.nix ( { callSpectrumPackage, rootfs, pkgsStatic, stdenv , cryptsetup, jq, qemu_kvm, tar2ext4, util-linux +, config }: let @@ -18,5 +19,6 @@ initramfs.overrideAttrs ({ nativeBuildInputs ? [], env ? {}, ... }: { env = env // { KERNEL = "${rootfs.kernel}/${stdenv.hostPlatform.linux-kernel.target}"; ROOT_FS_DIR = rootfs; + VERSION = config.version; }; })) (_: {}) diff --git a/host/rootfs/Makefile b/host/rootfs/Makefile index 1945afde0c1d804f9d14e9177aa812cbdc71234c..0d71dd1441077c9f30945e5063aacbfc240a9006 100644 --- a/host/rootfs/Makefile +++ b/host/rootfs/Makefile @@ -99,8 +99,8 @@ build/live.img: ../../scripts/format-uuid.sh ../../scripts/make-gpt.sh ../../scr uuids=$$(awk -f ../../scripts/format-uuid.awk < $(ROOT_FS_VERITY_ROOTHASH)) && \ set -euo pipefail -- $$uuids && \ bash ../../scripts/make-gpt.sh $@.tmp \ - $(ROOT_FS_VERITY):verity:$$3 \ - $(ROOT_FS):root:$$1 + $(ROOT_FS_VERITY):verity:$$3:Spectrum_'$(VERSION).verity' \ + $(ROOT_FS):root:$$1:Spectrum_'$(VERSION)' mv $@.tmp $@ debug: diff --git a/host/rootfs/shell.nix b/host/rootfs/shell.nix index 6df2f575fdfc7cdf8067ccfdb5fecaad9f6ea5e6..27f93e05fce036257d27cf9992fee8c925073f80 100644 --- a/host/rootfs/shell.nix +++ b/host/rootfs/shell.nix @@ -5,6 +5,7 @@ import ../../lib/call-package.nix ( { callSpectrumPackage, rootfs, pkgsStatic, srcOnly, stdenv , btrfs-progs, cryptsetup, jq, netcat, qemu_kvm, reuse, util-linux +, config }: rootfs.overrideAttrs ( @@ -20,5 +21,6 @@ rootfs.overrideAttrs ( KERNEL = "${passthru.kernel}/${stdenv.hostPlatform.linux-kernel.target}"; LINUX_SRC = srcOnly passthru.kernel.configfile; VMLINUX = "${passthru.kernel.dev}/vmlinux"; + VERSION = config.version; }; })) (_: {}) diff --git a/lib/config.default.nix b/lib/config.default.nix index a8422345cc00f9413bb19ec968fd89c82fed801b..489c231490a8b66aa01f50053b25646060f7f963 100644 --- a/lib/config.default.nix +++ b/lib/config.default.nix @@ -4,4 +4,5 @@ { pkgsFun = import ./nixpkgs.default.nix; pkgsArgs = {}; + version = "0.0.0"; } diff --git a/release/live/Makefile b/release/live/Makefile index 78361a48512a37514ba0e57e0cc8b0ec3a71664b..a85edfde2d186716656ed23fe719ca63b31bcd59 100644 --- a/release/live/Makefile +++ b/release/live/Makefile @@ -14,8 +14,8 @@ $(dest): ../../scripts/format-uuid.awk ../../scripts/make-gpt.sh ../../scripts/s set -euo pipefail -- $$uuids && \ bash ../../scripts/make-gpt.sh $@.tmp \ build/boot.fat:c12a7328-f81f-11d2-ba4b-00a0c93ec93b \ - $(ROOT_FS_VERITY):verity:$$3 \ - $(ROOT_FS):root:$$1 + $(ROOT_FS_VERITY):verity:$$3:Spectrum_'$(VERSION).verity' \ + $(ROOT_FS):root:$$1:Spectrum_'$(VERSION)' mv $@.tmp $@ build/empty: @@ -25,7 +25,7 @@ build/boot.fat: $(SYSTEMD_BOOT_EFI) $(EFI_IMAGE) build/empty $(TRUNCATE) -s 440401920 $@ $(MKFS_FAT) $@ $(MMD) -i $@ ::/EFI ::/EFI/BOOT ::/EFI/Linux - $(MCOPY) -i $@ $(EFI_IMAGE) ::/EFI/Linux/spectrum.efi + $(MCOPY) -i $@ $(EFI_IMAGE) '::/EFI/Linux/Spectrum_$(VERSION).efi' $(MCOPY) -i $@ $(SYSTEMD_BOOT_EFI) ::/EFI/BOOT/$(EFINAME) clean: diff --git a/release/live/default.nix b/release/live/default.nix index 98cb4862e239e3ad9ddbd7b5ace5716f57df683b..22e5a00de08ed858522a00f00359890ef52f03e0 100644 --- a/release/live/default.nix +++ b/release/live/default.nix @@ -1,11 +1,13 @@ # SPDX-License-Identifier: MIT # SPDX-FileCopyrightText: 2021-2023, 2025 Alyssa Ross # SPDX-FileCopyrightText: 2022 Unikie +# SPDX-FileCopyrightText: 2025 Demi Marie Obenour import ../../lib/call-package.nix ( { callSpectrumPackage, spectrum-build-tools, src , lib, pkgsStatic, stdenvNoCC , cryptsetup, dosfstools, jq, mtools, util-linux +, config }: let @@ -46,6 +48,7 @@ stdenv.mkDerivation { SYSTEMD_BOOT_EFI = "${systemd}/lib/systemd/boot/efi/systemd-boot${efiArch}.efi"; EFI_IMAGE = efi; EFINAME = "BOOT${toUpper efiArch}.EFI"; + VERSION = config.version; }; buildFlags = [ "dest=$(out)" ]; -- 2.52.0