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 7A662B9A8; Wed, 26 Nov 2025 19:42:19 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id 2D262B8C0; Wed, 26 Nov 2025 19:42:11 +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-x112a.google.com (mail-yw1-x112a.google.com [IPv6:2607:f8b0:4864:20::112a]) by atuin.qyliss.net (Postfix) with ESMTPS id 9F431B776 for ; Wed, 26 Nov 2025 19:41:51 +0000 (UTC) Received: by mail-yw1-x112a.google.com with SMTP id 00721157ae682-7866aca9ff4so1429217b3.3 for ; Wed, 26 Nov 2025 11:41:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764186109; x=1764790909; 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=roIX3GVE/3NEm/e/0K68UpziStfGlo8ZAvPsmpS8Q3o=; b=fu52UBBPo0YUWoPGI60JD3X44rvOB6TtGvvKu0IxGtZSJL03cOu6d4a7nUP6NdMBDk jbH6q1BTwxMPp6qG+0mY2l9vt6LFu4SlqHv762jHGoH5tuJI8wMukp5Ff1fT9LCRZop4 fyBbx+YuLtA5eYL9lDRuhRcKRRiLrh8ILas1euJkfYpzl51BiWIo/KBtEHY02fJiV4Fq ApGuIDSof5m2IFqzBbo8KrZi0Cgsi7LGCzBFdvFw3HCbL0/GZk3HRHAlmRNvuxYG2KuX Hi9fPaSKKZ8ieDy8632tEQ+AIystKEbWDzFgQCguGKRNteaGujmU6V04mJHA/CHBurmq ykBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764186109; x=1764790909; 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=roIX3GVE/3NEm/e/0K68UpziStfGlo8ZAvPsmpS8Q3o=; b=UKohX6j/3MfVTsF6UitIjcCkcVhkyedos/KCt+Xbqr4pDbSYBIi4NpJBkG/Kz6YrcL bRUU1Xfn5NBhXJS8rF1NUjavSc2i6I2F1kVwTnEG9rhZlGgwoH9rT3FDncnvckWux/y7 dTKCcsIzpychLdPZRFw/KBqPWLQCwAcUAtCD5q7T7yA+3eHV15iVca2ULCgAqPbQRhGP pRztu9+zjn2tpYWi3SBVYiOn0IpLrAVpxHjKxB5EBbRGSXhq6aEuHY9Z+ogo22eeXNFn 3+yca54h4/6uzijC39+6rZ+iOuKs+O4sR+fN/by0d6ixMzN2IUBFWX5zMdeuDkX8cov8 Y7xA== X-Gm-Message-State: AOJu0Yzg9ZjCMaoRuizQZhV9imdY9wFVFXZvHUZRuMnNbeUchZaiPIfk /cMZyXhtZksY2CTfrBph66yAfLdqtwLPYcRDcRe7lLkiWzvry7qFIKoyCiFK3A== X-Gm-Gg: ASbGncuGEPbiZFOZlel9UBRetMckd5BH669kmrdNDBHZbYSb4Z80o3c8XhzUK5W0iJc XaE9//6b9EXOeunik1ecSxHy2GIm3m4aZUggbC0oVV/QgmTvyG/lbFaAjrk1OAyEgegQRAv5cPY qkpPasodZIuKLgJ94EzFfUJvr0nzdY2gvO5QrNY/rnOwx867TgxgclYqV8gNVQr4QsSRQs7S3Ok lu2JIMmx28yHBy197SOPXK95wAs6dmAgudFhOvv65U/gsU5MwwNIONtju6FHx1MUIKG5lIKyydJ OIU9R9wtkiaoAatz8JUjM1EipjeTIg+VTfUhP/GWoXDVnVBzkxLDAEOd/RvVfP7ldTlq020MkAw qGOb98tHeDryOcYCSimw195YjqsXoL/Wbx+8BuC6vsNmbdLyaMhqQISke0S8OKAJMgGVtRhDm2N MZklamq0tEE2U+ZNYZfEcJFCPtD7+fy7dJoYyeooiIqhOPRqwWQDMqo3f0FSuJEJA8vQj/Fswcw aXTMaDXGwDw2mOqdsU1xmNZ0h9I2ALwSz4= X-Google-Smtp-Source: AGHT+IGmg1SJacM/nTmVRYRawvoa+MprNixe/LEId/OAqnG2uDKJp1CqHJJueSlTzgYdRAExPTCygg== X-Received: by 2002:a05:690c:e3e5:b0:789:6a48:83f1 with SMTP id 00721157ae682-78a8b557b62mr173041067b3.57.1764186108931; Wed, 26 Nov 2025 11:41:48 -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-78a798a5decsm69547047b3.21.2025.11.26.11.41.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Nov 2025 11:41:48 -0800 (PST) From: Demi Marie Obenour Date: Wed, 26 Nov 2025 14:40:47 -0500 Subject: [PATCH v5 07/13] 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: <20251126-updates-v5-7-fd746748febd@gmail.com> References: <20251126-updates-v5-0-fd746748febd@gmail.com> In-Reply-To: <20251126-updates-v5-0-fd746748febd@gmail.com> To: Spectrum OS Development X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1764186040; l=10610; i=demiobenour@gmail.com; s=20250729; h=from:subject:message-id; bh=JnQHf5tr4CLJRPWHS8L5UXoq56dzxYm6qXP8rGVHfwY=; b=r/ZZCcR/VlcxNrTgZ40qkASBIliq4HdBiUZCPL6Iuk58brYxmH+en0SoxZkPB4IT9Ti+515Mw 4TRD3h+OQHJAyxDUthrB4aM+IXLPlAptNfUSyecOzw9aqP7wpvKAchT X-Developer-Key: i=demiobenour@gmail.com; a=ed25519; pk=X57Q4/YQDj9t4SBeKaDwvXYKB6quZJVx/DE2Ly2out0= Message-ID-Hash: Z2T7HPBKPPDEWOCJOKZ6J2OVVFPENZVK X-Message-ID-Hash: Z2T7HPBKPPDEWOCJOKZ6J2OVVFPENZVK 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 v4: - Replace a mention of "Try Spectrum" with a mention of the live image. - Combine instructions for building an installer and a live image. - Drop the config option for the compression level. - Drop unnecessary quoting changes. - Drop unnecessary 'set -euo pipefail'. 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 | 44 ++++++++++++++++-------- 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 | 8 ++--- release/combined/grub.cfg.in | 5 --- 7 files changed, 35 insertions(+), 81 deletions(-) diff --git a/Documentation/installation/getting-spectrum.adoc b/Documentation/installation/getting-spectrum.adoc index 29803aa324b196119a03b22d7f1e2d7730e2c1eb..22c1fe310b56adecaac5ed7e87decbfd56881919 100644 --- a/Documentation/installation/getting-spectrum.adoc +++ b/Documentation/installation/getting-spectrum.adoc @@ -23,6 +23,17 @@ documentation for https://nix.dev/manual/nix/2.24/advanced-topics/cores-vs-jobs.html[tuning cores and jobs]. +To get Spectrum, run + +[source,shell] +---- +git clone https://spectrum-os.org/git/spectrum +---- + +Then follow one of the instructions below. If you haven't set up the +xref:binary-cache.adoc[binary cache], all of the following Nix commands +will take a very long time. + == Trying Spectrum If you want to try Spectrum out to get a feel for it, without @@ -31,27 +42,30 @@ applications. [source,shell] ---- -git clone https://spectrum-os.org/git/spectrum cd spectrum/host/rootfs nix-shell --run 'make run' ---- -This builds just enough of Spectrum to try it out in a VM, but it will -still take a very long time. +This builds just enough of Spectrum to try it out in a VM. == 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. -First, you need to build the Spectrum image: +To build a live image, run: + +[source,shell] +---- +nix-build spectrum/release/live +---- + +To build an installer, run: [source,shell] ---- -git clone https://spectrum-os.org/git/spectrum nix-build spectrum/release/combined ---- @@ -61,15 +75,17 @@ will take a very long time. When it's done, a symbolic link named 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". +in Nixpkgs). Then boot your system from the USB drive + +If you built a live image, Spectrum should be ready for you to use. +If you built an installer, you should see 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 reason to, as OS updates are not yet implemented, and persistent -storage is not yet exposed to VMs. Using the "Try Spectrum" option to -boot Spectrum will let you try out everything in Spectrum, without +storage is not yet exposed to VMs. Using a live image to boot +Spectrum will let you try out everything in Spectrum, without having to go through the additional step of reinstalling Spectrum every time you want to use a newer version. diff --git a/host/initramfs/Makefile b/host/initramfs/Makefile index 392dcfc8af3d6924fae717025124f228a2362b94..c3d600ad5a55d81b8ca9c7a3e182ef5f4fd90f4b 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_IMAGE):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/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..38210922ec165a36c33d99d08f04beabdc01ed53 100644 --- a/release/combined/eosimages.nix +++ b/release/combined/eosimages.nix @@ -14,9 +14,9 @@ runCommand "eosimages.img" { } '' 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 + 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