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 2A9A71B795; Wed, 19 Nov 2025 08:21:43 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id 8DFB81B703; Wed, 19 Nov 2025 08:21:33 +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-yx1-xb12d.google.com (mail-yx1-xb12d.google.com [IPv6:2607:f8b0:4864:20::b12d]) by atuin.qyliss.net (Postfix) with ESMTPS id A64551B59B for ; Wed, 19 Nov 2025 08:21:20 +0000 (UTC) Received: by mail-yx1-xb12d.google.com with SMTP id 956f58d0204a3-640d8b78608so4799443d50.1 for ; Wed, 19 Nov 2025 00:21:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763540479; x=1764145279; 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=tjpGFH8RUZEFq6kuojsnENid3OH6AUX43PPrnKAT5Ao=; b=I/N500cs2g4RYlNAcHojArCAIyk1oXgGiX1YwWTPKXzHpvYnhL+QFz4Meg+02uzvZ5 RQMypllpguMv0k1KXwwW5yKDVXKiPhSJCg+am5xKJO15zF8ocqoGgPGQ3m8yFrQ7hMQv yz0ZJ9ORKUEfywjErcqoFEtJ/PZuedP0DL1jJ//ZehskZpiqxqU7x1b9bpA8bwqa4uip dKfQHRDXA6BLiTG9dUU7Od1nymw6QF9Lqa3IMmkeOBxX8zai0pjTuyaHWsQ17y0WWZ22 UJbnrcoCzK1R2vzM1v7ISPZvmsbWxVF+tm7OirCR7lG4INEyEDhl+LylJ26S1dq3reG2 4jrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763540479; x=1764145279; 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=tjpGFH8RUZEFq6kuojsnENid3OH6AUX43PPrnKAT5Ao=; b=vvZSrYtf92Vgn9CrxK8jYyCs+4SCRD2S69H/J/0yJl+y0FDSIHlwJaUnqyfVSBazwa F1elHxZym16rPEX+liEMb6Lr3xTXh9TNzAY1LYYzxsDZ8E4opG9lTegnI5ll9v1GkPF+ V5+m2ntUK3/8HhzBQxl6FqT4lgQ9iqG8ludjVz+DmYdjnde9PKR3YXL1verAbz3cij9w HVWgZJv3+cArlLtbb384PcFC4hEhkgH1rMQtxpdRLL69YtAT5YrnkEVeCM7tGKBaBKXm iN1bbeH1so2Q0vRWax/Nxuchrvgh4o+HywqUc1JqNynn/bES7KcLzcHsa+UuIab1cu+K 8iFg== X-Gm-Message-State: AOJu0Ywc0Uab3XBhNZqcICW87tF+2xw2ryxYudnVwSy87U484JpMkWbT K/a/ZPuwfYM/IKBDOTeDbN9jz2lmLIrrrEYadHDrAV8Hkio2/o0Mes8y4bomiw== X-Gm-Gg: ASbGnctiuaSTN+Nr7hh0yVYA739oE0eJ2up1senFhYyZQLE3PIql8NH4CIUZg5tVmzV uR4zmcaWtxkP7mSWo99/J37636e20CpBtBwYjPXoqO/9NpJhinjPLZT8XSR0sBOk43FUFan5CjW p1bgrDFHXqv2UJ50J2bDsehlVN+S7GUFybgu2NQ1YMQWUtmP77KxfYW9U+3IKmOfT1XokVdR2B2 7gQh0lp88Aj6Yw9A8eTJPOe6roaXsIni6drUHF3wxjAc2pxfpn7Ib9FbaBznNBsZ5YAtrv74hjE hKW/uJE9cx5JE0+49Q4TYFZSQWK89m4nS9Qy5ev2vSMC8XLFsSIZ7iZEqEc7rOW4lr2BQb+V235 thSLrekRI7TBZg5KFN+iVQCfN6Ve8YayyXtJWbX1GQKRQxoixke8l/2mgprNvS6bXNA6G3dWTxa JuRoaMAzQ8h6LIuBzrZocXGUV3yNH26y4g4MmKQa1HYlb9LKxWhLfbWIwVlWkuL8uedYj+BW5h8 AtiPPNR/D4jeLOxiWLe/ying/U6cjXxyNTFlXaYHAhIFQ== X-Google-Smtp-Source: AGHT+IEY7WG0a5VcDYKF4QOxzze9AGAIq+BR64XDBq33/sYLRbk8W6DLzG+uSyLhycwOoaE11aM78g== X-Received: by 2002:a05:690e:15c3:b0:63c:f5a7:40f with SMTP id 956f58d0204a3-641e7699f4fmr13636091d50.67.1763540478504; Wed, 19 Nov 2025 00:21:18 -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-6410ea1084dsm6742942d50.12.2025.11.19.00.21.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Nov 2025 00:21:17 -0800 (PST) From: Demi Marie Obenour Date: Wed, 19 Nov 2025 03:18:32 -0500 Subject: [PATCH v3 09/14] release: Compress installation images and remove live image MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20251119-updates-v3-9-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=9235; i=demiobenour@gmail.com; s=20250729; h=from:subject:message-id; bh=9cBKqg2nBv5AVb3ixhJrLoFNQeSTWDpgIC5OHI/bvlU=; b=kOhuuzzC3Pi14iCrYc9s0jggeC5+86of0rF289KfsaHKfZc8IOo8e4FbgYF/mY4/GJQOkSHyZ Arde6XoajqnAYV/nJQctlDJqIZK/9gzgU9Dp94hKJ435vMWocvo0+YS X-Developer-Key: i=demiobenour@gmail.com; a=ed25519; pk=X57Q4/YQDj9t4SBeKaDwvXYKB6quZJVx/DE2Ly2out0= Message-ID-Hash: 3XDT3QY25ZTDDT5JWUBI4XQKMW7GARA2 X-Message-ID-Hash: 3XDT3QY25ZTDDT5JWUBI4XQKMW7GARA2 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 will fail if the OS image does not fit in the partitions that the installer created. Therefor, the partitions need to be very large so that there is plenty of room for the OS to grow. Furthermore, systemd-sysupdate requires both A and B copies of both the root and verity partitions. mkfs.ext4 is not able to produce images with files large enough to hold both the primary and backup copy of the root partition [1]. Reducing the sizes of partitions to be little greater than the size of the root filesystem image does not help. The produced file is still too large. Therefore, compress the image, which causes it to be small enough that mkfs.ext4 can handle it. This breaks the option to use the installer as a live image. Therefore, remove it. This option will return once Spectrum switches to the GNOME OS installer [2]. However, it is still possible to build a live image that is separate from the installer. Document how to build and use it. GRUB2 does support compressed loopback images, but these presumably buffer the whole image in memory. Since the entire installer will be replaced, making it work is not considered worthwhile. [1]: https://github.com/tytso/e2fsprogs/issues/254 [2]: https://spectrum-os.org/lists/archives/spectrum-devel/87wm4dlkhz.fsf@alyssa.is/ Signed-off-by: Demi Marie Obenour --- Changes since v2: - Remove live image test instead of skipping it. - Document the change. - Document that there is still a live image available, though it is separate from the installer. - Document how to build the live image. Signed-off-by: Demi Marie Obenour --- Documentation/installation/getting-spectrum.adoc | 31 +++++++++++++++++++----- host/initramfs/Makefile | 8 ------ host/initramfs/etc/probe | 20 --------------- release/checks/integration/meson.build | 2 +- release/checks/integration/try.c | 29 ---------------------- release/combined/eosimages.nix | 11 +++++---- release/combined/grub.cfg.in | 5 ---- 7 files changed, 32 insertions(+), 74 deletions(-) diff --git a/Documentation/installation/getting-spectrum.adoc b/Documentation/installation/getting-spectrum.adoc index 29803aa324b196119a03b22d7f1e2d7730e2c1eb..e7806e0f92793320bf0cdcbdd11dbc4e713275c7 100644 --- a/Documentation/installation/getting-spectrum.adoc +++ b/Documentation/installation/getting-spectrum.adoc @@ -42,10 +42,30 @@ still take a very long time. == Installing Spectrum To install Spectrum on a computer, you can use a USB drive as a -bootable Spectrum installer device. When booting a system from the -installer device, you will be able to choose whether to try out -Spectrum without installing it on your system (as a live image), or to -install it to your computer's internal storage. +bootable Spectrum installer device. You will need to choose whether to +try out Spectrum without installing it on your system (as a live image), +or to install it to your computer's internal storage. + +=== Building A Live Image + +First, you need to build the Spectrum image: + +[source,shell] +---- +git clone https://spectrum-os.org/git/spectrum +nix-build spectrum/release/live +---- + +If you haven't set up the xref:binary-cache.adoc[binary cache], this +will take a very long time. When it's done, a symbolic link named +"result" will appear in the current directory, pointing to the +installer image. Write that image to a USB drive, for example using +`dd` (command line) or +https://gitlab.com/bztsrc/usbimager[`usbimager`] (graphical, available +in Nixpkgs). Boot your system from the USB drive, and Spectrum should +be ready for you to use. + +=== Building The Installer First, you need to build the Spectrum image: @@ -62,8 +82,7 @@ installer image. Write that image to a USB drive, for example using `dd` (command line) or https://gitlab.com/bztsrc/usbimager[`usbimager`] (graphical, available in Nixpkgs). Boot your system from the USB drive, and you should see -a menu allowing you to choose between "Try Spectrum" and "Install -Spectrum". +a menu allowing you to "Install Spectrum". NOTE: While it's possible to install Spectrum to your internal storage, at this point in Spectrum's development there is not much diff --git a/host/initramfs/Makefile b/host/initramfs/Makefile index 383aa856d0b886325f3505a7596b08dad31a4851..db33ff86e9cd994efd4ce50acdf881d69ba79299 100644 --- a/host/initramfs/Makefile +++ b/host/initramfs/Makefile @@ -43,14 +43,6 @@ build/live.img: ../../scripts/format-uuid.awk ../../scripts/make-gpt.sh ../../sc $(ROOT_FS):root:$$1:Spectrum_'$(VERSION)' mv $@.tmp $@ -build/loop.tar: build/live.img - $(TAR) -cf $@ build/live.img - -build/loop.img: ../../scripts/make-gpt.sh ../../scripts/sfdisk-field.awk build/loop.ext4 - bash ../../scripts/make-gpt.sh $@.tmp \ - build/loop.ext4:56a3bbc3-aefa-43d9-a64d-7b3fd59bbc4e - mv $@.tmp $@ - clean: rm -rf build .PHONY: clean diff --git a/host/initramfs/etc/probe b/host/initramfs/etc/probe index 4cbd00db52c1a7128b5c619a43d415675feaee0b..013092b6dcc5b82db7302c1ae7e6d8a4f5a0b802 100755 --- a/host/initramfs/etc/probe +++ b/host/initramfs/etc/probe @@ -2,26 +2,6 @@ # SPDX-License-Identifier: EUPL-1.2+ # SPDX-FileCopyrightText: 2021 Alyssa Ross -if -n { - # If this is a Spectrum installer eosimages partition, we might be - # booting from the installer, and should loopback mount the images. - importas -i mdev MDEV - if { - backtick -E type { lsblk -lnpo PARTTYPE $mdev } - test $type = 56a3bbc3-aefa-43d9-a64d-7b3fd59bbc4e - } - if { - forx -pE module { ext4 loop } - modprobe $module - } - backtick -E uuid { lsblk -lnpo PARTUUID $mdev } - if { mkdir -p /mnt/${uuid} } - if { mount $mdev /mnt/${uuid} } - find /mnt/${uuid} -name *.img -exec - losetup -Pf {} - ; -} - # Check whether we now have all the partitions we need to boot. importas -i rootfs_uuid ROOTFS_UUID diff --git a/release/checks/integration/meson.build b/release/checks/integration/meson.build index 7214e47ba1ec23c247c8b76e5c8d94aff1ce1fd6..7bf8f51e4c762d2279ed6064ae1a87cb9b07494c 100644 --- a/release/checks/integration/meson.build +++ b/release/checks/integration/meson.build @@ -11,7 +11,7 @@ run_qemu = find_program('../../../scripts/run-qemu.sh') lib = static_library('spectrum-integration-test', 'lib.c') -foreach test : ['appimage', 'late-serial', 'networking', 'portal', 'try'] +foreach test : ['appimage', 'late-serial', 'networking', 'portal'] test(test, executable(test, test + '.c', link_with : lib), timeout : 400, args : [run_qemu]) diff --git a/release/checks/integration/try.c b/release/checks/integration/try.c deleted file mode 100644 index 4b874c0a7e9b48324497450fb5488e04576fd43b..0000000000000000000000000000000000000000 --- a/release/checks/integration/try.c +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-License-Identifier: EUPL-1.2+ -// SPDX-FileCopyrightText: 2025 Alyssa Ross - -#include "lib.h" - -#include -#include - -void test(struct config c) -{ - struct vm *vm; - - c.drives.img = getenv_or_die("COMBINED_PATH"); - - vm = start_qemu(c); - - start_console_thread(vm, "GNU GRUB "); - wait_for_prompt(vm); - - start_console_thread(vm, "~ # "); - - // Assume that Try Spectrum is the first menu entry. - if (fputc('\n', vm_console_writer(vm)) == EOF) { - fputs("error writing to console\n", stderr); - exit(EXIT_FAILURE); - } - - wait_for_prompt(vm); -} diff --git a/release/combined/eosimages.nix b/release/combined/eosimages.nix index 0ac4c48374e7098a2b91f61fc07cebb2042ffbdc..9921d9bcc89cc38271f83a970815f1060b3780e0 100644 --- a/release/combined/eosimages.nix +++ b/release/combined/eosimages.nix @@ -12,11 +12,12 @@ runCommand "eosimages.img" { unsafeDiscardReferences = { out = true; }; dontFixup = true; } '' + set -euo pipefail mkdir dir cd dir - ln -s $image $imageName - sha256sum $imageName > $imageName.sha256 - tar -chf $NIX_BUILD_TOP/eosimages.tar * - tar2ext4 -i $NIX_BUILD_TOP/eosimages.tar -o $out - e2label $out eosimages + ln -s -- "$image" "$imageName" + gzip -9 < "$image" > "$imageName.gz" + sha256sum -- "$imageName.gz" > "$imageName.gz.sha256" + tar -ch -- "$imageName.gz" "$imageName.gz.sha256" | tar2ext4 -o "$out" + e2label "$out" eosimages '') (_: {}) diff --git a/release/combined/grub.cfg.in b/release/combined/grub.cfg.in index a8e73a3b4dc0d643cf575e3cc545ec9ff72380cb..a22f5fc96ba6451d44c0f9768a15a1f48c5dce1c 100644 --- a/release/combined/grub.cfg.in +++ b/release/combined/grub.cfg.in @@ -15,11 +15,6 @@ set gfxpayload=keep terminal_output gfxterm terminal_output console -menuentry "Try Spectrum" { - loopback live (hd0,gpt3)/Spectrum-0.0-x86_64-generic.0.Live.img - chainloader (live,gpt1)/EFI/Linux/spectrum.efi -} - menuentry "Install Spectrum" { set root=(hd0,gpt2) linux @linux@ @kernelParams@ -- 2.52.0