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 ABDB9CED8; Sat, 22 Nov 2025 01:28:02 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id 135ACCDCE; Sat, 22 Nov 2025 01:27:50 +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-x1132.google.com (mail-yw1-x1132.google.com [IPv6:2607:f8b0:4864:20::1132]) by atuin.qyliss.net (Postfix) with ESMTPS id C11A6CD22 for ; Sat, 22 Nov 2025 01:27:41 +0000 (UTC) Received: by mail-yw1-x1132.google.com with SMTP id 00721157ae682-787da30c50fso26849687b3.3 for ; Fri, 21 Nov 2025 17:27:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763774860; x=1764379660; 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=HWqqA/rBg30q6YZ0z4FGdc6LIjmRQWEPk0gTnd1e1C8=; b=VmQFWIWC4URChRo1QV7F+84KI3PCXkTnYw+bqa+05QDXsnCHwuAx3HIcxs72tVcDiG 5G2crHaZJKHrbhBz3RPRwnQqjYbYFIGMXUAo47WMoLbbsTtOpvwgy47zgIVpnD/WV+Ut XZSjU9TCawrsDSyIqG0KOc//Y2kfWlxmLxoSiUmfr/vg+8oBoEmrJSL+iTfCo4Um569z SM5d7uFk27PS0uEcPHdfBLnS8G2vy/hy/l8nE8/t+z2qwasqVGgIAK5N+QZS0aXi6roC 3R+GgXcAnHPsm8I0YB0t5Dq5CmyGr2Y2NoO78ACezIHQdp/oyiapIkgkKUYaQCQ0z58P BC1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763774860; x=1764379660; 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=HWqqA/rBg30q6YZ0z4FGdc6LIjmRQWEPk0gTnd1e1C8=; b=ZS0abIXdCzuEw/DjHJkSOkxgTNNIZrzc5MtYoY/Xp9uio7FRJq+svZZBcBkPYZUuXf n7JCg+PZjEHBNK8U96VZil5/jg1qSfJldZB8wp8biDp/xo6GtC8utIPHCEfCrRsu/ehB Laz5F5T2XQIJ4/KPCWkQ7caZtpj8P4ND9XmckBZYpFdieKP4jCAo90d6YL0/z2MAlllm 0m4MKymbaqaUS4pVaE5EaV944n4SwqCacc9Q+OgRbFplOB99kN+eW0iRG76MhMqUK0Cp NWEF2huUviQc2xGRplCNfVqlT2lM2JhJoNKs+r5olZ0xeRxJSbF8AuuAGpProRdK+kWh ThJw== X-Gm-Message-State: AOJu0YxbYNc4TPJTJeMv3lFfJW9Evo05aLeFCbUW0eFc6EskCLJpLDAk xkuG5bhFzTOOv37v4uGswVswddAAbPvdxlnHSXaugx4L+o4n3oIo7W36vF/Wcg== X-Gm-Gg: ASbGnctShM5DifplTP3PXDkFa6iRiD99xyFJu198UsaUxGd3ymfzRQCyW+8srI4UbKD u1ON8ohx9xUObVTQb64AWwWvtp2MSQbH4cr7aN40kJgd0lbikiGEtM5d2bujCUgKS+RcmR62XbB keteF8KngsQ6DkkqP6IoDBvRCHjU3C7mY9TH2luR2c37fnS3U3U2LNJIYA/kX+aJX8cJqF47/zL OIw1b2xYx25Zgd8bG0cWHZR/ctFF37nRyVWrE7EHMae+onCPqCBFMOLxmBn5+52967kkS1OYtzs CYVhsrsHtpiPpF4/hL5bm6FZtX5uiOpROx19SDA4Jdg7vmU546VnSYiLIePg5+AMU4vpaw5+wnQ CmhIV7dPqCSQYzERcFZkAl7AlkdnZ+DUlEf5bNmH0Ig2rxCVqfYyzbKfcVgoN5pUWcgoqTpCHl5 FGBSEpGra1r2ZRFZgLlKUyMEv6/e8f/2nvNLy9hDAm1/cseMhiYiy9tvxurbZfR56c+3wcylUTW e7xFaQm2SUz8IW/3953CYtTXLFc9KdBVLI= X-Google-Smtp-Source: AGHT+IG0SwFAiwb/9yxvCgWfSs8jV+pPy/TGA5OISXQxekF1N5duiGA6r7CqthW5/PlLyNJYuYyscw== X-Received: by 2002:a05:690c:3688:b0:788:989:fdae with SMTP id 00721157ae682-78a8b497faemr66254637b3.28.1763774859619; Fri, 21 Nov 2025 17:27:39 -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 956f58d0204a3-642f71787f3sm2243069d50.16.2025.11.21.17.27.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Nov 2025 17:27:39 -0800 (PST) From: Demi Marie Obenour Date: Fri, 21 Nov 2025 20:23:31 -0500 Subject: [PATCH v4 09/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: <20251121-updates-v4-9-d4561c42776e@gmail.com> References: <20251121-updates-v4-0-d4561c42776e@gmail.com> In-Reply-To: <20251121-updates-v4-0-d4561c42776e@gmail.com> To: Spectrum OS Development X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1763774602; l=6978; i=demiobenour@gmail.com; s=20250729; h=from:subject:message-id; bh=z2Sp/Cc4I/G3tFv62Gyw2PCvDbViqMhqLl01Vu//nLM=; b=vSEusapfGS+Rp+3N41kwFGADAFsl2O1kn3AuQTM9qwN8B7oTOBYFkUYsuScvRA/L6h0GWDJai yh33ObviReNAzL7INbwJz6sJbri6N+t7ImCzmf/51WDhqzGjgzGcUAx X-Developer-Key: i=demiobenour@gmail.com; a=ed25519; pk=X57Q4/YQDj9t4SBeKaDwvXYKB6quZJVx/DE2Ly2out0= Message-ID-Hash: QZKI4RQP5JWA4QXJPGLHA4CAGLXS6QGL X-Message-ID-Hash: QZKI4RQP5JWA4QXJPGLHA4CAGLXS6QGL 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 735c12fc207f027db2b605309976a832b09335d6..db33ff86e9cd994efd4ce50acdf881d69ba79299 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 $@ clean: 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 f02bb76371f000e3f65bb7c2a7f217d437845481..d64bce115cc6c306956121b4bcd7271331ba1b7e 100644 --- a/host/rootfs/Makefile +++ b/host/rootfs/Makefile @@ -93,8 +93,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 b1c4c33f1dca3d503fb8e3ef855d65c49cf5a202..4ea2fead303d9a064fc0ce3a188423d6dbcc6c08 100644 --- a/lib/config.default.nix +++ b/lib/config.default.nix @@ -5,4 +5,5 @@ pkgsFun = import ./nixpkgs.default.nix; pkgsArgs = {}; compressionLevel = 1; + 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