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 90BE51CA32; Sat, 29 Nov 2025 09:51:24 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id 0A8731C956; Sat, 29 Nov 2025 09:51:17 +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-x1136.google.com (mail-yw1-x1136.google.com [IPv6:2607:f8b0:4864:20::1136]) by atuin.qyliss.net (Postfix) with ESMTPS id C32971C9AA for ; Sat, 29 Nov 2025 09:51:15 +0000 (UTC) Received: by mail-yw1-x1136.google.com with SMTP id 00721157ae682-787da30c53dso24554127b3.0 for ; Sat, 29 Nov 2025 01:51:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764409873; x=1765014673; 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=Y7sB7TP8pxOq4xswmgy91skbpa4hWZDS6gMwHhobpM0=; b=X39aJxSd4+I7W2LNjCCxBIVb0qK3WIaCGV4Q6C55U1AoyO/pK0grRjqs3uVCs7SbrC z4YsAyXActRakB7n9UD9/05B2Ol9aklRQedzoYq7pzZs4QzC+sLKuGtziryeqxJYJNFS LdCnLHocWJE13+ysIyJt1Rq58QIxnHR0/ewYRRvvtjxuyIau2yOIcTxrcvj0esS5Gwi5 wKOTsypBCZuCD2PmX9oZBNAcdB2wdZ2QfirlZ7gpOUG0XcsjpgwfcK44i9VRk3UxDwNH 4wNWrzLFwLAeEJdjLvdfCbuHoaYJj6uP35GPWVjt/NpV7oOh3rhaFv7fYQlN5hcEy4zg zkKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764409873; x=1765014673; 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=Y7sB7TP8pxOq4xswmgy91skbpa4hWZDS6gMwHhobpM0=; b=igwW3TyweRvok/qkl5h7q8wyrvJf0p4sRZEIVqcXbiO5dycPLRYbYIjimUUyIq4SAy y0uiyYpkVo2m0K+TanMcYB0to6usVX/f59Fywvao+zy8pik6UQmkaJfylS/WvsUYg8uF EGVE8b2PEDx5CnmsR9pVggFw8faRZ5yMcutYpo422wqPHHhcrNHE1939v8KcIzVm15Qc JZCBOgryLxGfYtFsN5dp9qJV/+6J0Fp+2Gykl/g34LIEKAlhqh8fVW33R1rBGGJXF0wP XedZljmuP5F6sKHAtgqyQN5TbmF6qseV63u0XeXvHYZYeIPIwvcmIeB2RwHkIf8wjR70 l+Ng== X-Gm-Message-State: AOJu0YwPczL/6/hDnH67ySHhGgl4JbB4CWBAshuQreZo+i9p7OUiqNNS ZuOCbzbED4i7r9aO8cdFulbezgKetGT6LA7ygGdOirnEVtvV8YG3cESNLRW0hA== X-Gm-Gg: ASbGnctX3JdxMqMiAqJDK3SzLWRajPtoiCFJwIV15ikFzEepMbR8uIMsa3Jq2uF3Xnk orDsGLvAdKZIjRyFOorwOYPXa++K36MMjpcU5k+kKczspkXqK7/YDbbiN+juUYmkzqLpWQXziV+ fW2PfYQ+rlcufxe0+Zfj1K1Ddt2I4UgWGMpdMBwiCXa4U8btbxGLJJPULGSi+8HGs8WGmVdkrB5 /bPzID9opqgzUV7FIGfnyw5s7cenu7w8cQT/DsBT0GC1jIJ8G/alDrGwNXMkq6Y50stZiv//g0e mos6D+QQjsF+cyDJAjJRpGn0mcT5GKmXRtFEDRQ/C0leLX/+Dw8ntUsUspg2GQDuy9UbVSnIkVh gfRqNGcOuc0aXC4Gi5IZBps5HYda1HjQ8pobOVlgYO1F/xxmD/pptg8yjH5RYGbRV1nkh/KL9Kv ywDnBZvBwWKbTa0DTjVmM98DgJVQsWga0hby+LYCvSb77RAlFwJXmpgUTv1kjSaLzPU/CZkNfgE m0KLgw5LrbJkJ9n8s1W01F2fsZC4MliP0o= X-Google-Smtp-Source: AGHT+IH/5XkZCqvDqMQD/rnHt667qgm9F1f6Zp5RXm8k1XVZPEXRAkVnPAmit4A+FCKonBy23WeyfA== X-Received: by 2002:a05:690c:3382:b0:786:6b92:b1ef with SMTP id 00721157ae682-78a8b567aefmr255823867b3.66.1764409873504; Sat, 29 Nov 2025 01:51:13 -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-78ad100b4ecsm23795467b3.28.2025.11.29.01.51.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Nov 2025 01:51:12 -0800 (PST) From: Demi Marie Obenour Date: Sat, 29 Nov 2025 04:50:02 -0500 Subject: [PATCH v6 5/8] release: Create directory with system update MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20251129-updates-v6-5-9edb87a2e509@gmail.com> References: <20251129-updates-v6-0-9edb87a2e509@gmail.com> In-Reply-To: <20251129-updates-v6-0-9edb87a2e509@gmail.com> To: Spectrum OS Development X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1764409797; l=2716; i=demiobenour@gmail.com; s=20250729; h=from:subject:message-id; bh=NlzvB3nIEwSjZ00IAdG4bbrqIMUrDXil8DDIs3JGdPY=; b=PqecoJxnz9Hv3JpK8THGwt/ISYaZoMewN62m0kt0q8+RO5jvDZHUOyMYsYH7fHh4onxJY2guz F/xhQYLQgrBDglsP9ZfgS58SNHId75PQa2PuW2tCRJAQX+64D+e7kZa X-Developer-Key: i=demiobenour@gmail.com; a=ed25519; pk=X57Q4/YQDj9t4SBeKaDwvXYKB6quZJVx/DE2Ly2out0= Message-ID-Hash: SE5GULESEVI22A5UV5HVIYXJT6SMJYJE X-Message-ID-Hash: SE5GULESEVI22A5UV5HVIYXJT6SMJYJE 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: Whenever a release is made, create a directory with the release files to be used for an update. After its SHA256SSUMS file is signed, the file is ready to be uploaded to a server for users to update from. Signed-off-by: Demi Marie Obenour Reviewed-by: Alyssa Ross --- Changes since v4: - Only set -u because stdenv sets the reset. Update comment. Changes since v2: - Use UUIDs to name the rootfs and verity superblock. This will allow systemd-sysupdate to set the correct UUIDs on the rootfs and verity partitions, avoiding the need to use labels to find these partitions. Signed-off-by: Demi Marie Obenour --- release.nix | 2 ++ release/update.nix | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/release.nix b/release.nix index a4fe66ee5925aeee3a1f5f1fac249c595cee0885..704abb39a3d01152eac3dfe313066834c3cd0a66 100644 --- a/release.nix +++ b/release.nix @@ -8,5 +8,7 @@ import lib/call-package.nix ({ callSpectrumPackage }: { checks = callSpectrumPackage release/checks {}; + updates = callSpectrumPackage release/update.nix {}; + combined = callSpectrumPackage release/combined/run-vm.nix {}; }) (_: {}) diff --git a/release/update.nix b/release/update.nix new file mode 100644 index 0000000000000000000000000000000000000000..18a91ac1eea56e9b2a941eb08244b3dee613b721 --- /dev/null +++ b/release/update.nix @@ -0,0 +1,33 @@ +# SPDX-License-Identifier: MIT +# SPDX-FileCopyrightText: 2021-2024 Alyssa Ross +# SPDX-FileCopyrightText: 2025 Demi Marie Obenour + +import ../lib/call-package.nix ( +{ callSpectrumPackage, config, runCommand, stdenv }: + +let + efi = import ../host/efi.nix {}; +in +runCommand "spectrum-update-directory" { + __structuredAttrs = true; + unsafeDiscardReferences = { out = true; }; + dontFixup = true; + env = { VERSION = config.version; }; +} '' + # stdenv sets -eo pipefail, but not -u + set -u + mkdir -- "$out" + cd -- "$out" + read -r roothash < ${efi.rootfs}/rootfs.verity.roothash + if ! [[ "$roothash" =~ ^[0-9a-f]{64}$ ]]; then + printf 'Internal error: bad root hash %q\n' "$roothash" + exit 1 + fi + cp -- ${efi} "Spectrum_$VERSION.efi" + cp -- ${efi.rootfs}/rootfs.verity.superblock "Spectrum_''${VERSION}_''${roothash:32:32}.verity" + cp -- ${efi.rootfs}/rootfs "Spectrum_''${VERSION}_''${roothash:0:32}.root" + sha256sum -b "Spectrum_$VERSION.efi" \ + "Spectrum_''${VERSION}_''${roothash:32:32}.verity" \ + "Spectrum_''${VERSION}_''${roothash:0:32}.root" > SHA256SUMS + '' +) (_: {}) -- 2.52.0