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 BC46ACEB0; Sat, 22 Nov 2025 01:27:58 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id E701ACD62; Sat, 22 Nov 2025 01:27:48 +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-xb12e.google.com (mail-yx1-xb12e.google.com [IPv6:2607:f8b0:4864:20::b12e]) by atuin.qyliss.net (Postfix) with ESMTPS id A1E2FCCEA for ; Sat, 22 Nov 2025 01:27:40 +0000 (UTC) Received: by mail-yx1-xb12e.google.com with SMTP id 956f58d0204a3-640d43060d2so2362280d50.2 for ; Fri, 21 Nov 2025 17:27:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763774859; x=1764379659; 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=uoLCUq9WoLrcCqDdLM7WPmYJBSlOuFU7X9KOQk0iQ1I=; b=Ni3d4cInfxE1sOIHBB7s+JP/pe9jjl3FF7+a5D4+bwnms1cCe9+k5XntxTj95ORkw7 XB5c/UUcqCLhHHOEvpesTr07tVbzqtROEu1mHapirAp3PAZcH1qCfFvE4x0VOh8K562Q KqD9p0/oLVrFjfdjjhMoDaOGe9lxB8IXn5IBlI0290YZs0OKNwncEZN+kkw7+e+7f70j 1IObcbhLDJSkCkwobE8lU2IWcU+fkR8t7g61GWnLmeydaQ0x8vWs7m0LN1bARHN6CdSi XSoZIC9I2kezeuyEN0MDnkdcHzU3QeSEwJVb/sWqPBHACkbQu1hRfsXgn83jtmtdex5M 9rrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763774859; x=1764379659; 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=uoLCUq9WoLrcCqDdLM7WPmYJBSlOuFU7X9KOQk0iQ1I=; b=Aa8yCLsDgRvC19RtVAbjRi/U8g2ZE1+ffaSQVlmZDVxfINxJR9pVYokh0EZ1c9Vxg6 gpTp6O+CgTRFhp6MM278EPdFsYdaoKBtkhUGvURA9Bn1QlQSYHdmN4ZVazTLgAYyfb4z tbGCzBUESSHMrB56SINN0eIkV0ShMDT64zHd0ycdynHXVFI557FhkhBXX8g4ZaHk9CnO fLW7v4teCs4FBujtpUDHx2HuA7ayh9Cc+1Xk5PUo4MVkd7GKzw3WLNfruHhgEePq4XAk INYiDUkzK8wg4b9r3Wo7Ey64X7NdcGAKdjX23bjcX9rrbl5YBOqw5QLtfzkp8efozWT5 qYgA== X-Gm-Message-State: AOJu0Yx4BDLucVwoNJW3F+ViVYm+95Y5DaF3YzEmOV12/295sl9klqEJ dq4adt2kgxAVAMc9wtHCgzM3Z7rb4c9htywOgd6kZyISf6STfQO0Qu1Qj0JT5A== X-Gm-Gg: ASbGnctld8E9sAkJq1z/+9R5hWDIsoUUv9osSTqThdfAa4x39MfRJ6z2Irnk2HQ8nWH VD1KLxPKI7DtbX7DOc9Z1IgtsUnhjLT6U5J9gqA7wCR7eX3hYOGuXAOTcCNNZ8hY1k5pClTkaBB xnvk/E7msBOT1Vu18mWc/RJdbOJuQ9k/Gn7qgOp0neja2isr1g5M845HuJI1exL+ZT3308ioFrz Mf/LeJT23O7TUQT5U6L2F3InvoDKnZAJg8x4zENs8G+pPJGsR+zHyeM5jDCAZWBMBPcypef7zIE LJHQTXdkrcxSrdXfQzGZWghOirz5ym4xI135t4Q0egTzxZC7BOhltsj2Pw2JlC9NArQ2RI5hzYD jfl1fCI539lX7o3hsYeHe6xj75ASIaSoA+N/UINT1GiWfp6aKM+jnsKW0FNNHoi29S4ZEzKr5LW dXL+pUgXtUo1XE0zgLLoSRCj9wdtb53mU7+Dwtn3h/ME/MOHoTmp/sf5EXgQnH678t5k8cNDw5a oMRd0slxgAReonqX8vEls8/Tac2L5Xtbt4= X-Google-Smtp-Source: AGHT+IFxVbpqmpxwoojc7uICrfN3+taYu5Msqs/JRHoiYUlxQ7h/MCNPesE9jOXfxcTQC27TGlcWgA== X-Received: by 2002:a05:690e:130d:b0:63f:abf6:1c9 with SMTP id 956f58d0204a3-64302a4b3fdmr3149069d50.25.1763774858497; Fri, 21 Nov 2025 17:27:38 -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-642f707a9b9sm2246350d50.6.2025.11.21.17.27.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Nov 2025 17:27:37 -0800 (PST) From: Demi Marie Obenour Date: Fri, 21 Nov 2025 20:23:30 -0500 Subject: [PATCH v4 08/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: <20251121-updates-v4-8-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=10188; i=demiobenour@gmail.com; s=20250729; h=from:subject:message-id; bh=KdMyh2e3zu/HHvuw3APdCRLltJsG6LXJHrQj1NsyJhg=; b=DTaQFie/zpQqhxaEEbIWvfIWahgNmG1UsrIH3K35+lmgFbjvaoH4u60qnKnBarAFStLPub+kh X7vce7YXzLtBra7rnF3OhPIY3KFAIv1wLMUCGwSP2j1Iyr80oEyPjBn X-Developer-Key: i=demiobenour@gmail.com; a=ed25519; pk=X57Q4/YQDj9t4SBeKaDwvXYKB6quZJVx/DE2Ly2out0= Message-ID-Hash: GTXEWMUSTNCXCUH5HDCGJAURS5LVC4XY X-Message-ID-Hash: GTXEWMUSTNCXCUH5HDCGJAURS5LVC4XY 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 v3: - Make the compression level configurable. The default is 1 so that development builds finish in a reasonable amount of time. Release builds should use compression level 9. 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 --------------- lib/config.default.nix | 1 + release/checks/integration/meson.build | 2 +- release/checks/integration/try.c | 29 ---------------------- release/combined/eosimages.nix | 13 +++++----- release/combined/grub.cfg.in | 5 ---- 8 files changed, 34 insertions(+), 75 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 27a26b46a8110d35ee02a63b12931d6b9c2742e5..735c12fc207f027db2b605309976a832b09335d6 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 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/lib/config.default.nix b/lib/config.default.nix index a8422345cc00f9413bb19ec968fd89c82fed801b..b1c4c33f1dca3d503fb8e3ef855d65c49cf5a202 100644 --- a/lib/config.default.nix +++ b/lib/config.default.nix @@ -4,4 +4,5 @@ { pkgsFun = import ./nixpkgs.default.nix; pkgsArgs = {}; + compressionLevel = 1; } 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..9cb35dcecee54c17392b609c493272ec83062e9b 100644 --- a/release/combined/eosimages.nix +++ b/release/combined/eosimages.nix @@ -2,7 +2,7 @@ # SPDX-FileCopyrightText: 2021-2023 Alyssa Ross import ../../lib/call-package.nix ( -{ callSpectrumPackage, runCommand, e2fsprogs, tar2ext4 }: +{ callSpectrumPackage, runCommand, e2fsprogs, tar2ext4, config }: runCommand "eosimages.img" { nativeBuildInputs = [ e2fsprogs tar2ext4 ]; @@ -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 -${builtins.toString (0 + config.compressionLevel)} < "$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