From unknown Sat Aug 16 00:09:41 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#73927 <73927@debbugs.gnu.org> To: bug#73927 <73927@debbugs.gnu.org> Subject: Status: [PATCH 00/16] Installer support for (cross) installing the Hurd. Reply-To: bug#73927 <73927@debbugs.gnu.org> Date: Sat, 16 Aug 2025 07:09:41 +0000 retitle 73927 [PATCH 00/16] Installer support for (cross) installing the Hu= rd. reassign 73927 guix-patches submitter 73927 Janneke Nieuwenhuizen severity 73927 normal tag 73927 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 21 04:14:45 2024 Received: (at submit) by debbugs.gnu.org; 21 Oct 2024 08:14:45 +0000 Received: from localhost ([127.0.0.1]:49966 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2nYq-0003SJ-C5 for submit@debbugs.gnu.org; Mon, 21 Oct 2024 04:14:44 -0400 Received: from lists.gnu.org ([209.51.188.17]:48126) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2nYo-0003SB-67 for submit@debbugs.gnu.org; Mon, 21 Oct 2024 04:14:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t2nYM-0007a0-2q for guix-patches@gnu.org; Mon, 21 Oct 2024 04:14:14 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t2nYK-0002uN-Ug; Mon, 21 Oct 2024 04:14:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=9gWGrl9USD6DYPm/ILBSd/YF0CTCIUKPOmKYd+gR62o=; b=lE/SaTEQqzBVdj L6gw139D/Op8uPTIcKT1+S4kp7tiO/m9fH/7bSmNxPvOEgoA9uVEoXdEnh00/dK1L9/mKPK/K8fhb 2/fwPJELDbYiQug2NytLHGWqSmAv+5QVJSvOWll3GDIBNlOf5pEZfH2stgDVgfnw2Xmv+UJXleQrm NkLECpmVX4YK1jUbKAx0Ib/2/aBSK28MVNgmDbzN3kE7cAhz77w2rtiXEu8ine4FxGowzFIGhjVos hYv1VSLAIvPcnaGOmuAZqWstbQ108vFtBbrjAgW28e/sXX+gmsPjkkoxan/LWvBFcClopgo5+vnVU s/yCgujdjBbq4byT0OTQ==; From: Janneke Nieuwenhuizen To: guix-patches@gnu.org Subject: [PATCH 00/16] Installer support for (cross) installing the Hurd. Date: Mon, 21 Oct 2024 10:13:54 +0200 Message-ID: X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 X-Debbugs-Cc: Josselin Poiret , Ludovic Courtès , Mathieu Othacehe Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit Cc: othacehe@gnu.org, ludo@gnu.org, dev@jpoiret.xyz X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi! This patch set adds initial support for installing and running the Hurd on real iron. Writing a draft blog post on all the Hurd work that we've done last year and describing the clumsy way to install a Hurd system inspired me to have another look at the installer. I've dusted off some old patches to fix booting a Hurd installation more than once, then there's some preliminary (installer) work and then it adds a "Kernel" selection page where you can optionally select "Hurd" next to the default "Linux Libre". If you select "Hurd", some defaults are changed such as using an ext2 file system, some options are disabled such as creating an encrypted partition or a swap partition, and some menus have a warning about availability of packages. Finally a fully functional "config.scm" is created for installing the Hurd. It is using the regular GNU/Linux installer for now and the Hurd system is being cross installed. It might be nice to have a Hurd based installer image some time, maybe when we have better networking support (rumpnet? ;). I've updated the `hurd-team' branch with this patch set. To build the installer, do something like --8<---------------cut here---------------start------------->8--- ./pre-inst-env guix system image -t iso9660 gnu/system/install.scm or ./pre-inst-env guix system image -t iso9660 --system=i686-linux gnu/system/install.scm --8<---------------cut here---------------end--------------->8--- (note that the 32bit version using linux-libre-6.10.13 panics for me, I've had success with linux-libre-5.15 (see ). The last, but not unimportant feature, are patches to run the installer in dry-run mode and especially to run it directly from Guile, i.e., without building the (current-guix) guix derivation for the `hurd-team' branch and whatnot. To run the installer (semi-) directly, do something like: --8<---------------cut here---------------start------------->8--- /pre-inst-env guile -c '((@ (gnu installer) run-installer) #:dry-run? #t)' or sudo -E ./pre-inst-env guile -c '((@ (gnu installer) run-installer))' --8<---------------cut here---------------end--------------->8--- BE VERY CAREFUL WHEN NOT USING #:DRY-RUN #T! It feels a bit clumsy because it still builds a lightweight installer script in the store. We could avoid going via the store and factor-out the gexp'ed installer steps list from the `installer-steps' procedure. This is problematic because it then needs (newt), (parted), and (webutils) modules to build the installer OS. We could just add guile-newt, guile-parted, guile-webutils to the guix package's dependencies but I figured, also from how the installer was written, that we really don't want this. I also tried using #:autoload (see ), but #:autoload seems to fail on record predicates like `disk?' --8<---------------cut here---------------start------------->8--- Wrong type to apply (#). --8<---------------cut here---------------end--------------->8--- and also tried adding an extra indirection (see ) in the hope to avoid having to use #:autoload for (parted), but as yet to no avail. Greetings, Janneke Janneke Nieuwenhuizen (16): system: hurd: Remove qemu networking from %base-services/hurd. gnu: hurd: Support system init in /libexec/runsystem. hurd-boot: Support system init: Create essential device nodes. system: hurd: Add swap-services to hurd-default-essential-services. gnu: hurd: Support second boot. hurd-boot: Support second boot. maint: Add installer dependencies to the manifest. installer: Remove unused (newt) imports. installer: Align comments. installer: Use "partitioning-page" consistently. installer: Fix file-name typos. installer: Use `%' for parameter %run-command-in-installer. installer: Add dry-run? installer: Add "Kernel" page to select the Hurd. installer: Add static-networking template. DRAFT installer: Support dry-run from Guile via store. gnu/build/hurd-boot.scm | 35 ++-- gnu/installer.scm | 206 ++++++++++++++++++------ gnu/installer/final.scm | 10 +- gnu/installer/kernel.scm | 34 ++++ gnu/installer/newt.scm | 24 ++- gnu/installer/newt/ethernet.scm | 1 - gnu/installer/newt/final.scm | 20 ++- gnu/installer/newt/kernel.scm | 45 ++++++ gnu/installer/newt/keymap.scm | 6 +- gnu/installer/newt/locale.scm | 7 +- gnu/installer/newt/page.scm | 7 +- gnu/installer/newt/parameters.scm | 1 - gnu/installer/newt/partition.scm | 10 +- gnu/installer/newt/services.scm | 32 ++-- gnu/installer/parted.scm | 114 ++++++++----- gnu/installer/record.scm | 8 +- gnu/installer/services.scm | 68 ++++++-- gnu/installer/steps.scm | 30 ++-- gnu/installer/utils.scm | 17 +- gnu/local.mk | 3 + gnu/packages/hurd.scm | 8 +- gnu/packages/patches/hurd-startup.patch | 82 ++++++++++ gnu/services/base.scm | 20 ++- gnu/services/virtualization.scm | 4 +- gnu/system.scm | 13 +- gnu/system/examples/bare-hurd.tmpl | 10 +- gnu/system/hurd.scm | 26 +-- gnu/system/images/hurd.scm | 2 +- manifest.scm | 7 +- 29 files changed, 661 insertions(+), 189 deletions(-) create mode 100644 gnu/installer/kernel.scm create mode 100644 gnu/installer/newt/kernel.scm create mode 100644 gnu/packages/patches/hurd-startup.patch base-commit: aaa12db63270c487e3be1963b0fdfe93fdb2544d -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 21 04:17:55 2024 Received: (at 73927) by debbugs.gnu.org; 21 Oct 2024 08:17:56 +0000 Received: from localhost ([127.0.0.1]:49980 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2nbv-0003dl-7s for submit@debbugs.gnu.org; Mon, 21 Oct 2024 04:17:55 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42850) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2nbt-0003dF-1a for 73927@debbugs.gnu.org; Mon, 21 Oct 2024 04:17:53 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t2nbN-0003R7-BH; Mon, 21 Oct 2024 04:17:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=v7eM2uVrdoqbOUffc/yD5r848jCktjuGgc/Sjl1V6h0=; b=Vr+EUB8/t0y2ly81m9WJ 07ckGppjYWTQNMCVNLc5EbHwzXPedDUukJvzKsmp+W7KCJA7BUlHfQp+/ZVg6D5XkwZmROuzG9edl rrkiiCYSIzZ9qGmiJD9xRFBgPaSyPOQgATaWKcswux4ltL4+v5dDRj+mkf6/MFd5o7IN7+UrFMytY EgsuFKiPNuF3OAAtkmkxtPbCwTvRbhkHFiw5TjKgqhZ/OiNbYFUx1dBAxLNT5xCHhwEu/jjkfxbsB OSninNvT4LUuPhSBMrJz/s8ECuzAknI1iCMwWwn2313nE+hc3ercoHe+33VkqrLVcRv2/qLxSnN2L iVrUpx7nXoBMiQ==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH 01/16] system: hurd: Remove qemu networking from %base-services/hurd. Date: Mon, 21 Oct 2024 10:16:57 +0200 Message-ID: <1fbb300ade6667d5390dbe1a2e8e82ff4af7d1a0.1729494414.git.janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) This allows us to use %base-services/hurd for services in a Hurd config for a real machine without removing static-networking. * gnu/system/hurd.scm (%base-services/hurd): Factor networking out to... (%base-services+qemu-networking/hurd): ..this new variable. * gnu/system/examples/bare-hurd.tmpl (%hurd-os): Use it. * gnu/services/virtualization.scm (%hurd-vm-operating-system): Use it. * gnu/system/images/hurd.scm (hurd-barebones-os): Use it. Add comment about QEMU and networking for a real machine. Change-Id: I777a63410383b9bf8b5740e4513dbc1e9fb0fd41 --- gnu/services/virtualization.scm | 4 ++-- gnu/system/examples/bare-hurd.tmpl | 10 ++++++++-- gnu/system/hurd.scm | 23 ++++++++++++++--------- gnu/system/images/hurd.scm | 2 +- 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/gnu/services/virtualization.scm b/gnu/services/virtualization.scm index d87e494348..d33dfa6ca7 100644 --- a/gnu/services/virtualization.scm +++ b/gnu/services/virtualization.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017 Ryan Moe ;;; Copyright © 2018, 2020-2024 Ludovic Courtès -;;; Copyright © 2020, 2021, 2023 Janneke Nieuwenhuizen +;;; Copyright © 2020, 2021, 2023, 2024 Janneke Nieuwenhuizen ;;; Copyright © 2021 Timotej Lazar ;;; Copyright © 2022 Oleg Pykhalov ;;; Copyright © 2022 Leo Nikkilä @@ -1643,7 +1643,7 @@ (define %hurd-vm-operating-system ;; /etc/guix/acl file in the childhurd. Thus, clear ;; 'authorize-key?' so that it's not overridden at activation ;; time. - (modify-services %base-services/hurd + (modify-services %base-services+qemu-networking/hurd (guix-service-type config => (guix-configuration (inherit config) diff --git a/gnu/system/examples/bare-hurd.tmpl b/gnu/system/examples/bare-hurd.tmpl index 463c7ee798..68c6d3c166 100644 --- a/gnu/system/examples/bare-hurd.tmpl +++ b/gnu/system/examples/bare-hurd.tmpl @@ -1,7 +1,7 @@ ;; -*-scheme-*- ;; This is an operating system configuration template -;; for a "bare bones" setup, with no X11 display server. +;; for a "bare bones" QEMU setup, with no X11 display server. ;; To build a disk image for a virtual machine, do ;; @@ -54,6 +54,12 @@ (permit-root-login #t) (allow-empty-passwords? #t) (password-authentication? #t))) - %base-services/hurd)))) + ;; For installing on a real (non-QEMU) machine, use: + ;; (static-networking-service-type + ;; (list %loopback-static-networking + ;; (static-networking + ;; ...))) + ;; %base-services/hurd + %base-services+qemu-networking/hurd)))) %hurd-os diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm index 6d6a20cf57..283bae6f10 100644 --- a/gnu/system/hurd.scm +++ b/gnu/system/hurd.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2020-2024 Ludovic Courtès -;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen +;;; Copyright © 2020, 2023, 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -47,6 +47,7 @@ (define-module (gnu system hurd) #:use-module (gnu system vm) #:export (%base-packages/hurd %base-services/hurd + %base-services+qemu-networking/hurd %hurd-default-operating-system %hurd-default-operating-system-kernel %setuid-programs/hurd)) @@ -79,14 +80,6 @@ (define %base-packages/hurd (define %base-services/hurd (append (list (service hurd-console-service-type (hurd-console-configuration (hurd hurd))) - (service static-networking-service-type - (list %loopback-static-networking - - ;; QEMU user-mode networking. To get "eth0", you need - ;; QEMU to emulate a device for which Mach has an - ;; in-kernel driver, for instance with: - ;; --device rtl8139,netdev=net0 --netdev user,id=net0 - %qemu-static-networking)) (service guix-service-type (guix-configuration (extra-options '("--disable-chroot" @@ -102,6 +95,18 @@ (define %base-services/hurd (tty (string-append "tty" (number->string n)))))) (iota 6 1)))) +(define %base-services+qemu-networking/hurd + (cons + (service static-networking-service-type + (list %loopback-static-networking + + ;; QEMU user-mode networking. To get "eth0", you need + ;; QEMU to emulate a device for which Mach has an + ;; in-kernel driver, for instance with: + ;; --device rtl8139,netdev=net0 --netdev user,id=net0 + %qemu-static-networking)) + %base-services/hurd)) + (define %setuid-programs/hurd ;; Default set of setuid-root programs. (map file-like->setuid-program diff --git a/gnu/system/images/hurd.scm b/gnu/system/images/hurd.scm index 9b618f7dc6..01c422a54f 100644 --- a/gnu/system/images/hurd.scm +++ b/gnu/system/images/hurd.scm @@ -60,7 +60,7 @@ (define hurd-barebones-os (permit-root-login #t) (allow-empty-passwords? #t) (password-authentication? #t))) - %base-services/hurd)))) + %base-services+qemu-networking/hurd)))) (define hurd-initialize-root-partition #~(lambda* (#:rest args) -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 21 04:17:56 2024 Received: (at 73927) by debbugs.gnu.org; 21 Oct 2024 08:17:56 +0000 Received: from localhost ([127.0.0.1]:49984 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2nbv-0003dt-S7 for submit@debbugs.gnu.org; Mon, 21 Oct 2024 04:17:56 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42852) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2nbt-0003dG-NT for 73927@debbugs.gnu.org; Mon, 21 Oct 2024 04:17:54 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t2nbO-0003RD-6j; Mon, 21 Oct 2024 04:17:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=TNN0Ow3iD7zTh7azvqMR1RfzrzfwuCtHf1IWqIlICcA=; b=jKkxawrMXt4AY28fzTnH 1bf8cj8Leo3Pd+8IvOsW9KiDOR2Y6WGObRdZwEVu7OUa5ptBcWOlh+YFg5NNbMbrzQkoHd7+uRt74 E3BrKOH8wxAOOgilkXordUVghQdVdvxyJC9rpb9a1KBPMMdHvS7CewI6+GvCIx4SK/Ygs5XxcPjT+ l7/nTE+jJKR5iJ+TLI39Ne5q4+kFbcl4s0JFfjpIJoeIFRJoxDljYs+B+RxA8w8SMUvK4Uo/LVBJn NL64Ps69z3HHU5OjNqP1+ITZO4v9PYcj+bF0GRbbXH4TDrWw5zjdZTJwLWp2UjCVfsCFwWkMORocd otzGXvoYC54IZw==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH 02/16] gnu: hurd: Support system init in /libexec/runsystem. Date: Mon, 21 Oct 2024 10:16:58 +0200 Message-ID: <2039eeef57770f39c2927ab566915f304cb659b1.1729494414.git.janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) This is the first step to support booting after guix system init, which does not create /servers. * gnu/packages/hurd.scm (hurd)[arguments]: In stage create-runsystem, do not assume /servers/socket/ exists, remove any existing /servers/socket/1. Change-Id: Ib61af08dd7b9c5659c938697671f69908bb7e20f --- gnu/packages/hurd.scm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm index 3d2a37a1e2..e6ea920714 100644 --- a/gnu/packages/hurd.scm +++ b/gnu/packages/hurd.scm @@ -383,6 +383,8 @@ (define-public hurd fsck --yes --force / fsysopts / --writable +mkdir -p /servers/socket +rm -f /servers/socket/1 # Note: this /hurd/ gets substituted settrans --create /servers/socket/1 /hurd/pflocal -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 21 04:18:01 2024 Received: (at 73927) by debbugs.gnu.org; 21 Oct 2024 08:18:01 +0000 Received: from localhost ([127.0.0.1]:49994 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2nc1-0003eW-8O for submit@debbugs.gnu.org; Mon, 21 Oct 2024 04:18:01 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42854) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2nbu-0003dL-Ly for 73927@debbugs.gnu.org; Mon, 21 Oct 2024 04:17:55 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t2nbO-0003RN-Vo; Mon, 21 Oct 2024 04:17:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=2h3AZ2GYfpsfmFYkj1YKl19ZlMJil0xENzRQ2EUkp2I=; b=RH1WAS2UEP7qMDbslix/ BnZ1nitDFyxwVrwLuZjWspPOfmUSxjxZpw87WlRtlD34cEE0ZiZA0fi1BRccMueSjNQCw7yRW6jEG dEVL8t+MCOTgSfaSgOksx8LKHe5kux7Eo/gYFnUO3q3ToSwmkohumc+xhwYcAB/LEelpCPZaZdDiq KYBGmZBBjTKZviBAhf7nTg9ljB4nr+5zeTVrW7H+bm1N+1qt7vNDohCRubk7t6x2iTcepOFtAwm79 4LdEkCiiDCRFEF+/uOpGTzaZ8b71cMFgWcJS7zXWtvxmJSJ6c7j0512jTnZRFR6Tt5wEx8n+pYhbD 34KCFZaxb4pO0Q==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH 03/16] hurd-boot: Support system init: Create essential device nodes. Date: Mon, 21 Oct 2024 10:16:59 +0200 Message-ID: <2cebd1cf836781f4330a223a890f6d1d60879913.1729494414.git.janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/build/hurd-boot.scm (make-hurd-device-nodes): Cater for existing directories (dev, servers). (set-hurd-device-translators): Remove /servers/socket/1, that is created by libexec/console-run. Cater for nonexistent /dev/console. (boot-hurd-system): Call make-hurd-device-nodes on initial run. --- gnu/build/hurd-boot.scm | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/gnu/build/hurd-boot.scm b/gnu/build/hurd-boot.scm index 4407284acb..daf4fb41ab 100644 --- a/gnu/build/hurd-boot.scm +++ b/gnu/build/hurd-boot.scm @@ -79,13 +79,13 @@ (define* (make-hurd-device-nodes #:optional (root "/")) (define (scope dir) (string-append root (if (string-suffix? "/" root) "" "/") dir)) - (mkdir (scope "dev")) + (mkdir-p (scope "dev")) ;; Don't create /dev/null etc just yet; the store ;; messes-up the permission bits. ;; Don't create /dev/console, /dev/vcs, etc.: they are created by ;; console-run on first boot. - (mkdir (scope "servers")) + (mkdir-p (scope "servers")) (for-each (lambda (file) (call-with-output-file (scope (string-append "servers/" file)) (lambda (port) @@ -100,7 +100,8 @@ (define* (make-hurd-device-nodes #:optional (root "/")) "kill" "suspend")) - (mkdir (scope "servers/socket")) + (mkdir-p (scope "servers/socket")) + ;; Don't create /servers/socket/1 & co: runsystem does that on first boot. ;; TODO: Set the 'gnu.translator' extended attribute for passive translator @@ -279,7 +280,8 @@ (define* (set-hurd-device-translators #:optional (root "/")) (for-each scope-set-translator servers) (mkdir* "dev/vcs/1") (mkdir* "dev/vcs/2") - (rename-file (scope "dev/console") (scope "dev/console-")) + (when (file-exists? (scope "dev/console")) + (rename-file (scope "dev/console") (scope "dev/console-"))) (for-each scope-set-translator devices) (false-if-EEXIST (symlink "/dev/random" (scope "dev/urandom"))) @@ -326,6 +328,10 @@ (define* (boot-hurd-system #:key (on-error 'debug)) (let ((hurd/hurd (readlink* (string-append system "/profile/hurd")))) (symlink hurd/hurd "/hurd")) + (unless (file-exists? "/servers/startup") + (format #t "Creating essential device nodes...\n") + (make-hurd-device-nodes)) + (format #t "Setting-up essential translators...\n") (setenv "PATH" (string-append system "/profile/bin")) (set-hurd-device-translators) -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 21 04:18:02 2024 Received: (at 73927) by debbugs.gnu.org; 21 Oct 2024 08:18:02 +0000 Received: from localhost ([127.0.0.1]:49996 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2nc1-0003ee-PZ for submit@debbugs.gnu.org; Mon, 21 Oct 2024 04:18:02 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42860) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2nbv-0003dN-8j for 73927@debbugs.gnu.org; Mon, 21 Oct 2024 04:17:55 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t2nbP-0003RV-Oi; Mon, 21 Oct 2024 04:17:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=yMt0KWvaTQ06WRle/LemMGvmXY6f4LS32lTrlbg0AxA=; b=BEE1fMiwV+liYCITkl6W q5MM2t6FjVpAaUP94tb/R44QLHH7RV5BIfiMlf4INUvYq2pG61LKuflLIowB1Uqm7gwoV+84V5F6T HdtCoXtQMCSNc+KLkkooZS34hxpRMDfSKVkO9KrhFNm89Mm5WrwOEygwtN4CTrWWwyjpPJVtI/34J 9dp3T7irLzVmmoyLgSu/UKf8I19xHZWMZ/YdxkPeen7WTGYWBHqXXFRCzz1IRIbwpoLNJ8vNoR1xl q0qPV/CVvksccx43GIBkQHi+JcogODfx/JLIRWMz7XmYVL+GFBEGdAY/WwhywxeDSw1LpelYdewNQ kvvic9Zkl71DWg==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH 04/16] system: hurd: Add swap-services to hurd-default-essential-services. Date: Mon, 21 Oct 2024 10:17:00 +0200 Message-ID: <6e79215c38d44fdae872be726901363d8145317e.1729494414.git.janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/services/base.scm (swap-service-type): Do not include 'udev' requirement for the Hurd. Use system* with "swapon", "swapoff" for the Hurd. * gnu/system.scm (hurd-default-essential-services): Add swap-services. * gnu/services/base.scm (swap-service-type): --- gnu/services/base.scm | 20 +++++++++++++------- gnu/system.scm | 13 +++++++------ 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 819d063673..7c50bc45b1 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -43,6 +43,7 @@ (define-module (gnu services base) #:autoload (guix diagnostics) (warning formatted-message &fix-hint) #:autoload (guix i18n) (G_) #:use-module (guix combinators) + #:use-module (guix utils) #:use-module (gnu services) #:use-module (gnu services admin) #:use-module (gnu services shepherd) @@ -2644,7 +2645,7 @@ (define swap-service-type (with-imported-modules (source-module-closure '((gnu build file-systems))) (shepherd-service (provision (list (swap->shepherd-service-name swap))) - (requirement `(udev ,@requirements)) + (requirement `(,@(if (target-hurd?) '() '(udev)) ,@requirements)) (documentation "Enable the given swap space.") (modules `((gnu build file-systems) ,@%default-modules)) @@ -2652,16 +2653,21 @@ (define swap-service-type (let ((device #$device-lookup)) (and device (begin - (restart-on-EINTR (swapon device - #$(if (swap-space? swap) - (swap-space->flags-bit-mask - swap) - 0))) + #$(if (target-hurd?) + #~(system* "swapon" device) + #~(restart-on-EINTR + (swapon device + #$(if (swap-space? swap) + (swap-space->flags-bit-mask + swap) + 0)))) #t))))) (stop #~(lambda _ (let ((device #$device-lookup)) (when device - (restart-on-EINTR (swapoff device))) + #$(if (target-hurd?) + #~(system* "swapoff" device) + #~(restart-on-EINTR (swapoff device)))) #f))) (respawn? #f)))) (description "Turn on the virtual memory swap area."))) diff --git a/gnu/system.scm b/gnu/system.scm index 44f93f91d1..187a72cbf5 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -843,11 +843,11 @@ (define (hurd-default-essential-services os) (let ((host-name (operating-system-host-name os)) (hosts-file (%operating-system-hosts-file os)) (entries (operating-system-directory-base-entries os))) - (list (service system-service-type entries) - %boot-service - %hurd-startup-service - %activation-service - (service shepherd-root-service-type) + (cons* (service system-service-type entries) + %boot-service + %hurd-startup-service + %activation-service + (service shepherd-root-service-type) (service user-processes-service-type) (account-service (append (operating-system-accounts os) @@ -869,7 +869,8 @@ (define (hurd-default-essential-services os) (service privileged-program-service-type (append (operating-system-privileged-programs os) (operating-system-setuid-programs os))) - (service profile-service-type (operating-system-packages os))))) + (service profile-service-type (operating-system-packages os)) + (swap-services os)))) (define* (operating-system-services os) "Return all the services of OS, including \"essential\" services." -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 21 04:18:03 2024 Received: (at 73927) by debbugs.gnu.org; 21 Oct 2024 08:18:03 +0000 Received: from localhost ([127.0.0.1]:50000 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2nc2-0003es-Ei for submit@debbugs.gnu.org; Mon, 21 Oct 2024 04:18:03 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42862) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2nbw-0003dP-AI for 73927@debbugs.gnu.org; Mon, 21 Oct 2024 04:17:56 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t2nbQ-0003Rd-Pw; Mon, 21 Oct 2024 04:17:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=cFlfQPLePxiRCJ17PHs/L4hugLMsDx0bKdh7Px1a19g=; b=VnJlFOrY+m2EJU5gQFzx mOCSDp5q2JU9Wh25iZlpmHmzimPrTAuuhplk18aEhHlAQg0YnrhWv74GV6Elq2jeF0+0mMeM0Cd8V hBCDMedR3vInolPb7h23PMjnbJ8rTaA8BWEFgcxRMJAC/d3V6tGU86GgXbG2LNcYa2fGLFOCzXpIQ DRq8/Cf3+v16Iz/Malx5TxcAxYFHHcMTepnO5spCbuFM97Ql/NabKUdAPjfLa4hQTFW7ovAdyS9A3 WCqIHFErYSRE9zDAncmc7IvNByW7X79jGgVnBn36AxCLrl7Ba0qwW+9bGELyj+AvaVEXsbE5oW2Se fZoevTZ5i+3esw==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH 05/16] gnu: hurd: Support second boot. Date: Mon, 21 Oct 2024 10:17:01 +0200 Message-ID: <0317244532bcd84c82c943080363025c710fa7aa.1729494414.git.janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) This avoids hanging upon second boot and ensures a declarative /hurd and /dev. * gnu/packages/patches/hurd-startup.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/hurd.scm (hurd): Use it. [arguments]: In stage create-runsystem remove /dev/urandom. Change-Id: Ifcca5562c297204735c35132820a32ca0f273677 --- gnu/local.mk | 1 + gnu/packages/hurd.scm | 6 +- gnu/packages/patches/hurd-startup.patch | 82 +++++++++++++++++++++++++ 3 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/hurd-startup.patch diff --git a/gnu/local.mk b/gnu/local.mk index 5d1b316aa3..6d0c20f5be 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1538,6 +1538,7 @@ dist_patch_DATA = \ %D%/packages/patches/hubbub-sort-entities.patch \ %D%/packages/patches/hueplusplus-mbedtls.patch \ %D%/packages/patches/hurd-rumpdisk-no-hd.patch \ + %D%/packages/patches/hurd-startup.patch \ %D%/packages/patches/hwloc-1-test-btrfs.patch \ %D%/packages/patches/i7z-gcc-10.patch \ %D%/packages/patches/icecat-makeicecat.patch \ diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm index e6ea920714..9c1681f236 100644 --- a/gnu/packages/hurd.scm +++ b/gnu/packages/hurd.scm @@ -317,7 +317,8 @@ (define-public hurd (name "hurd") (source (origin (inherit (package-source hurd-headers)) - (patches (search-patches "hurd-rumpdisk-no-hd.patch")))) + (patches (search-patches "hurd-rumpdisk-no-hd.patch" + "hurd-startup.patch")))) (version (package-version hurd-headers)) (arguments `(#:tests? #f ;no "check" target @@ -388,6 +389,9 @@ (define-public hurd # Note: this /hurd/ gets substituted settrans --create /servers/socket/1 /hurd/pflocal +# Upon second boot, (file-exists? /dev/null) in hurd-boot-system hangs unless: +rm -f /dev/urandom + # parse multiboot arguments for i in \"$@\"; do case $i in diff --git a/gnu/packages/patches/hurd-startup.patch b/gnu/packages/patches/hurd-startup.patch new file mode 100644 index 0000000000..0b0dcc9537 --- /dev/null +++ b/gnu/packages/patches/hurd-startup.patch @@ -0,0 +1,82 @@ +This avoids hanging upon second boot and ensures a declarative /dev. + +Upstream status: Not presented upstream. + +From a15d281ea012ee360c45376e964d35f6292ac549 Mon Sep 17 00:00:00 2001 +From: Janneke Nieuwenhuizen +Date: Sat, 27 May 2023 17:28:22 +0200 +Subject: [PATCH] startup: Remove /hurd, /dev, create /servers. + +This avoids hanging upon second boot and ensures a declarative /hurd +and /dev. + +* startup/startup.c (rm_r, create_servers): New functions. +(main): Use them to remove /dev and create /servers. Remove /hurd +symlink. +--- + startup/startup.c | 42 ++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 42 insertions(+) + +diff --git a/startup/startup.c b/startup/startup.c +index feb7d265..5f380194 100644 +--- a/startup/startup.c ++++ b/startup/startup.c +@@ -732,6 +732,42 @@ parse_opt (int key, char *arg, struct argp_state *state) + return 0; + } + ++#include ++static int ++rm_r (char const *file_name) ++{ ++ int callback (char const *file_name, struct stat64 const *stat_buffer, ++ int type_flag, struct FTW *ftw_buffer) ++ { ++ fprintf (stderr, "startup: removing: %s\n", file_name); ++ return remove (file_name); ++ } ++ ++ return nftw64 (file_name, callback, 0, FTW_DEPTH | FTW_MOUNT | FTW_PHYS); ++} ++ ++void ++create_servers (void) ++{ ++ char const *servers[] = { ++ "/servers/startup", ++ "/servers/exec", ++ "/servers/proc", ++ "/servers/password", ++ "/servers/default-pager", ++ "/servers/crash-dump-core", ++ "/servers/kill", ++ "/servers/suspend", ++ 0, ++ }; ++ mkdir ("/servers", 0755); ++ for (char const **p = servers; *p; p++) ++ open (*p, O_WRONLY | O_APPEND | O_CREAT, 0444); ++ mkdir ("/servers/socket", 0755); ++ mkdir ("/servers/bus", 0755); ++ mkdir ("/servers/bus/pci", 0755); ++} ++ + int + main (int argc, char **argv, char **envp) + { +@@ -741,6 +777,12 @@ main (int argc, char **argv, char **envp) + mach_port_t consdev; + struct argp argp = { options, parse_opt, 0, doc }; + ++ /* GNU Guix creates fresh ones in boot-hurd-system. */ ++ unlink ("/hurd"); ++ rm_r ("/dev"); ++ mkdir ("/dev", 0755); ++ create_servers (); ++ + /* Parse the arguments. We don't want the vector reordered, we + should pass on to our child the exact arguments we got and just + ignore any arguments that aren't flags for us. ARGP_NO_ERRS +-- +2.40.1 + -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 21 04:18:04 2024 Received: (at 73927) by debbugs.gnu.org; 21 Oct 2024 08:18:04 +0000 Received: from localhost ([127.0.0.1]:50006 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2nc3-0003fG-Gc for submit@debbugs.gnu.org; Mon, 21 Oct 2024 04:18:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42864) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2nbx-0003dQ-8j for 73927@debbugs.gnu.org; Mon, 21 Oct 2024 04:17:57 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t2nbR-0003Rm-Lf; Mon, 21 Oct 2024 04:17:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=jHaKbg4o/jE+GpBXlbLJ5PGb1IQGQgzbQVVHRqpqhLg=; b=MkdunvxaPtTtpHGONjiq N2pYX53WTk69aznukpYgWZpJMYc7D6SV9w1N+OTFuEPVK8c44MBHjgZW+fB2b7RvtpPE+qlmPydAB cpFZyUuRVvIXtb1JVPxOu4C11OyULrghpdOFFl31gwDvEkzCpO+5yALKAOv55nr/ZOYxmAPZZM+Oh z3ZeBgCaUuGI/PR0kNNECl22Jz8H0lGamhiz6gub44cxy8AQM4C8Kufvxr4Z+k8dZ8UOVXCq9hF4V KEaZSa0k1K866QkNsr3wJauIbWcX5MHY3XsBGorJIMyCENTFoVY+bGCjuPt2RHSZqnKC4sSLkZg3K jDGGTU6qRsOsQw==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH 06/16] hurd-boot: Support second boot. Date: Mon, 21 Oct 2024 10:17:02 +0200 Message-ID: <26625af5d6dbd20fd7cfbbe36dcc2b3cfd01a0d3.1729494414.git.janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/build/hurd-boot.scm (boot-hurd-system): Check for stale shepherd socket and remove it. Be chattier about /hurd symlink replacement. Change-Id: I5e528c131ebeadb7ebc9727336a0f9301af3e68e --- gnu/build/hurd-boot.scm | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/gnu/build/hurd-boot.scm b/gnu/build/hurd-boot.scm index daf4fb41ab..23ace25d4f 100644 --- a/gnu/build/hurd-boot.scm +++ b/gnu/build/hurd-boot.scm @@ -322,18 +322,29 @@ (define* (boot-hurd-system #:key (on-error 'debug)) (let* ((args (command-line)) (system (find-long-option "gnu.system" args)) - (to-load (find-long-option "gnu.load" args))) + (to-load (find-long-option "gnu.load" args)) + (profile (string-append system "/profile")) + (bin (string-append profile "/bin")) + (sbin (string-append profile "/bin"))) - (false-if-exception (delete-file "/hurd")) - (let ((hurd/hurd (readlink* (string-append system "/profile/hurd")))) - (symlink hurd/hurd "/hurd")) + (setenv "PATH" (string-append bin ":" sbin)) + + (when (file-exists? "/var/run/shepherd/socket") + (format #t "Removing stale shepherd socket...\n") + (delete-file "/var/run/shepherd/socket")) (unless (file-exists? "/servers/startup") (format #t "Creating essential device nodes...\n") (make-hurd-device-nodes)) + (let ((profile/hurd (readlink* (string-append profile "/hurd")))) + (when (file-exists? "/hurd") + (format #t "Removing stale /hurd link\n") + (delete-file "/hurd")) + (format #t "Linking /hurd from ~a...\n" profile/hurd) + (symlink profile/hurd "/hurd")) + (format #t "Setting-up essential translators...\n") - (setenv "PATH" (string-append system "/profile/bin")) (set-hurd-device-translators) (format #t "Starting pager...\n") -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 21 04:18:04 2024 Received: (at 73927) by debbugs.gnu.org; 21 Oct 2024 08:18:05 +0000 Received: from localhost ([127.0.0.1]:50008 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2nc4-0003fY-Aj for submit@debbugs.gnu.org; Mon, 21 Oct 2024 04:18:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42866) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2nby-0003dS-7E for 73927@debbugs.gnu.org; Mon, 21 Oct 2024 04:17:58 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t2nbS-0003Rw-NQ; Mon, 21 Oct 2024 04:17:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=P0PHZ7Z+mClmqxZMoGyaY70WFWhoB6kPXaCkEj9nTZg=; b=iCfvt0E2EpG0+Z6w296y TeCgXYwWgUjvdtEQKZpx0W7TDbCHMLcBBELoODiE59htP8ebwt5as0gYJHrxIzJsNjdfrYBNOW/mQ HFOe+HKK5Xr2h+MsDxlzd2pezQZ/RLnmWfAEeLAQIpfNesy/vwhKYrsq8wMNKQzpp5uWedgZ84hOG upKRCTkvWAGBUAX+FkWT6/Y+rrfnsXnDQgIeTWmWtegnqQJ8BVPXly4qm29saTW0wAgzABvK+yfyh 6L++zgc2nIqnfLNNeobjuazN/LlAkXCRwGCFbPWIRRia+jkYM4KD26/brDjwz/94bX/jQ2EvfvL/d U/dlVoSjGLu8qg==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH 07/16] maint: Add installer dependencies to the manifest. Date: Mon, 21 Oct 2024 10:17:03 +0200 Message-ID: X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * manifest.scm: Add guile-newt, guile-parted, guile-webutils. Change-Id: Idcf46320d29c15f36da05f66e81b7779e37c1bf6 --- manifest.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/manifest.scm b/manifest.scm index 27e1d62566..ccd6268461 100644 --- a/manifest.scm +++ b/manifest.scm @@ -51,4 +51,9 @@ "mumi" "nss-certs" "openssl" ;required if using 'smtpEncryption = tls' - "patman")))) + "patman")) + ;; For installer + (specifications->manifest + (list "guile-newt" + "guile-parted" + "guile-webutils")))) -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 21 04:18:17 2024 Received: (at 73927) by debbugs.gnu.org; 21 Oct 2024 08:18:17 +0000 Received: from localhost ([127.0.0.1]:50027 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2ncG-0003hE-VZ for submit@debbugs.gnu.org; Mon, 21 Oct 2024 04:18:17 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36382) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2nc2-0003eC-8z for 73927@debbugs.gnu.org; Mon, 21 Oct 2024 04:18:03 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t2nbW-0003Sf-OE; Mon, 21 Oct 2024 04:17:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=o//sxzi7UsEAJ8SJ0uGFJbDjqXm2SNbLKOgriJMAJug=; b=rbiayfFPB98D2SUYO4sc OVX4Py4aO9V/1CUHUF6Zjc6YQEhd8dyt2oF4/hCsZ05oPaTeY0bkWycT3A4DjFSkzGLqZUntkozhO OANwflKoUcJRzjvxyvXwtaOPptU2+9/6IaZUZ7Z1A9tUNTLzr5r5W2Rea5QCiLvZjsmOAuH9v0qik S5/BfC8IGXrQU/GMnJXG7xB4+DKxXs+M6DklovTHbuSUbZNBdm/AmDe+n6uPUP5zEm61wiJVYlrE1 sCWbpEJTjwT4pHP3iwQuqV2zmm31iDeboSG6w8nW6TmYkj8P3iwK7NdHXVicIqqCqxEkDXPK+xUF1 ZnJO3Nu9DUXxXA==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH 09/16] installer: Align comments. Date: Mon, 21 Oct 2024 10:17:05 +0200 Message-ID: X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Josselin Poiret , Ludovic Courtès , Mathieu Othacehe Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/installer.scm (installer-program): Align comments. Change-Id: I50c173c46ea9bfdb3da0562146bc969d46f0edd9 --- gnu/installer.scm | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/gnu/installer.scm b/gnu/installer.scm index 5cd99e4013..3dfcb7581a 100644 --- a/gnu/installer.scm +++ b/gnu/installer.scm @@ -355,22 +355,22 @@ (define (installer-program) (define set-installer-path ;; Add the specified binary to PATH for later use by the installer. #~(let* ((inputs - '#$(list bash ;start subshells - connman ;call connmanctl + '#$(list bash ;start subshells + connman ;call connmanctl cryptsetup - dosfstools ;mkfs.fat - e2fsprogs ;mkfs.ext4 - lvm2-static ;dmsetup + dosfstools ;mkfs.fat + e2fsprogs ;mkfs.ext4 + lvm2-static ;dmsetup btrfs-progs - jfsutils ;jfs_mkfs - ntfs-3g ;mkfs.ntfs - xfsprogs ;mkfs.xfs - kbd ;chvt - util-linux ;mkwap + jfsutils ;jfs_mkfs + ntfs-3g ;mkfs.ntfs + xfsprogs ;mkfs.xfs + kbd ;chvt + util-linux ;mkwap nano shadow - tar ;dump - gzip ;dump + tar ;dump + gzip ;dump coreutils))) (with-output-to-port (%make-void-port "w") (lambda () -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 21 04:18:17 2024 Received: (at 73927) by debbugs.gnu.org; 21 Oct 2024 08:18:18 +0000 Received: from localhost ([127.0.0.1]:50029 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2ncH-0003hG-Eu for submit@debbugs.gnu.org; Mon, 21 Oct 2024 04:18:17 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42870) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2nbz-0003de-7Z for 73927@debbugs.gnu.org; Mon, 21 Oct 2024 04:18:03 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t2nbT-0003S3-NH; Mon, 21 Oct 2024 04:17:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=yK00Fpp7FvviPVDnKSLTliUmQx+JHOKJWcurU/NILrU=; b=jN7RU7HVL+BeP1lOHkd0 kBXNdoCMcnebEQibrVY73RvJyQLeX/AlUkGZv0sFDr+ZTYij+90Plhj06S36zXjtDl/1dSgEwGmd2 fnKefOmUlrFo/i/6N+fZMAJ7k3iLvubslbEjhfZbjEaSnWiauvAkCLUFSuMj46vCbsBGNHs83JjGl hoBoBF863dWf3gviFqOgXSZZCeFCSustrLi7PsQ2IwjU/3145dB0xE2wzlL2r7kdFSPPGRO73P0da kohdu9BASM3TckNsN+nKMuxg5+QHOTPEgq2KtAcavBIRBDv+PupsSB6c+fCFH5fCRksK1DsFx7eQR EBF/XgrzML6T5Q==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH 08/16] installer: Remove unused (newt) imports. Date: Mon, 21 Oct 2024 10:17:04 +0200 Message-ID: <8746be641d712c99f14991b084649659ba384aa6.1729494414.git.janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Josselin Poiret , Ludovic Courtès , Mathieu Othacehe Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/installer/newt/ethernet.scm, gnu/installer/newt/keymap.scm, gnu/installer/newt/locale.scm, gnu/installer/newt/parameters.scm, gnu/installer/newt/services.scm: Remove (newt). Change-Id: Ia6624aaf73491024da54b8ffee7358941b187fdf --- gnu/installer/newt/ethernet.scm | 1 - gnu/installer/newt/keymap.scm | 1 - gnu/installer/newt/locale.scm | 1 - gnu/installer/newt/parameters.scm | 1 - gnu/installer/newt/services.scm | 1 - 5 files changed, 5 deletions(-) diff --git a/gnu/installer/newt/ethernet.scm b/gnu/installer/newt/ethernet.scm index d75a640519..53e440fd60 100644 --- a/gnu/installer/newt/ethernet.scm +++ b/gnu/installer/newt/ethernet.scm @@ -27,7 +27,6 @@ (define-module (gnu installer newt ethernet) #:use-module (ice-9 match) #:use-module (srfi srfi-34) #:use-module (srfi srfi-35) - #:use-module (newt) #:export (run-ethernet-page)) (define (ethernet-services) diff --git a/gnu/installer/newt/keymap.scm b/gnu/installer/newt/keymap.scm index c5d4be6792..109ec55e0a 100644 --- a/gnu/installer/newt/keymap.scm +++ b/gnu/installer/newt/keymap.scm @@ -24,7 +24,6 @@ (define-module (gnu installer newt keymap) #:use-module (gnu installer newt page) #:use-module (guix i18n) #:use-module (guix records) - #:use-module (newt) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:use-module (srfi srfi-34) diff --git a/gnu/installer/newt/locale.scm b/gnu/installer/newt/locale.scm index 01171e253f..a226b39ba6 100644 --- a/gnu/installer/newt/locale.scm +++ b/gnu/installer/newt/locale.scm @@ -22,7 +22,6 @@ (define-module (gnu installer newt locale) #:use-module (gnu installer steps) #:use-module (gnu installer newt page) #:use-module (guix i18n) - #:use-module (newt) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:use-module (srfi srfi-34) diff --git a/gnu/installer/newt/parameters.scm b/gnu/installer/newt/parameters.scm index 8fb1aa3abb..7c61266e4d 100644 --- a/gnu/installer/newt/parameters.scm +++ b/gnu/installer/newt/parameters.scm @@ -23,7 +23,6 @@ (define-module (gnu installer newt parameters) #:use-module (guix build syscalls) #:use-module (guix i18n) #:use-module (ice-9 match) - #:use-module (newt) #:export (run-parameters-page)) (define (run-proxy-page) diff --git a/gnu/installer/newt/services.scm b/gnu/installer/newt/services.scm index b22024602c..d1035b6524 100644 --- a/gnu/installer/newt/services.scm +++ b/gnu/installer/newt/services.scm @@ -28,7 +28,6 @@ (define-module (gnu installer newt services) #:use-module (guix i18n) #:use-module (srfi srfi-34) #:use-module (srfi srfi-35) - #:use-module (newt) #:export (run-services-page)) (define (run-desktop-environments-cbt-page) -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 21 04:18:18 2024 Received: (at 73927) by debbugs.gnu.org; 21 Oct 2024 08:18:18 +0000 Received: from localhost ([127.0.0.1]:50031 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2ncH-0003hO-Uw for submit@debbugs.gnu.org; Mon, 21 Oct 2024 04:18:18 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36396) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2nc3-0003eJ-81 for 73927@debbugs.gnu.org; Mon, 21 Oct 2024 04:18:04 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t2nbX-0003Ss-NM; Mon, 21 Oct 2024 04:17:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=YWNSWcmINKhnMV8UXOKL7aNKl6P/JUbqiUnTq7ngZK4=; b=sLMXEgAbut2x2PHwFxH5 LcaRtPB5f25rCPlGze71U+UaB89lHf3O+ieEyqSRSqDXIHNTx64i0qzSeMeP9PaVObChRmOgzyUgE brJDMPKei9agpOSvOPEnz/tyeCirJJ3JRiH+8iJCkTwb7BCJq+FY5+MsUeSstHyRKTFQ0wrX0g5dP g6KPWLbdLzH2innwKLXAfLlJG3zlR+Xqp+IATnciV/SNmjM8bj5lYYIfFXIe/DEUCAgWTxNxpXYnw ApiW1Rp1oQtjBjjBADADj4zPS38Q9d7pI9Xr9gpHIQJfezjMTF24lY+ksIiCZDZHbdKM3bNJ6ZXKO L1ji0Loy72vlSA==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH 10/16] installer: Use "partitioning-page" consistently. Date: Mon, 21 Oct 2024 10:17:06 +0200 Message-ID: <47db8b65d7464d87799b1693ac44778ea066bc19.1729494414.git.janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Josselin Poiret , Ludovic Courtès , Mathieu Othacehe Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Having `partition-page' function call `RUN-partititionING-page' where all other proxy functions call `RUN-' hurts my brain while refactoring. * gnu/installer/record.scm ()[partition-page]: Rename to... [partitioning-page]: ...this. * gnu/installer/newt.scm (partitioning-page, newt-installer): Update accordingly. * gnu/installer.scm (installer-steps): Update accordingly. Change-Id: I6b2f3459a3d0a7a89260224b7d8438676e3411ba --- gnu/installer.scm | 3 ++- gnu/installer/newt.scm | 5 +++-- gnu/installer/record.scm | 5 +++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/gnu/installer.scm b/gnu/installer.scm index 3dfcb7581a..3a05843cab 100644 --- a/gnu/installer.scm +++ b/gnu/installer.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2019, 2020, 2022 Ludovic Courtès ;;; Copyright © 2019, 2020 Tobias Geerinckx-Rice ;;; Copyright © 2020 Florian Pelz +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -312,7 +313,7 @@ (define (installer-steps) (id 'partition) (description (G_ "Partitioning")) (compute (lambda _ - ((installer-partition-page current-installer)))) + ((installer-partitioning-page current-installer)))) (configuration-formatter user-partitions->configuration)) (installer-step diff --git a/gnu/installer/newt.scm b/gnu/installer/newt.scm index e1c4453168..6d8ea35fff 100644 --- a/gnu/installer/newt.scm +++ b/gnu/installer/newt.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018, 2020 Mathieu Othacehe +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -193,7 +194,7 @@ (define (hostname-page) (define (user-page) (run-user-page)) -(define (partition-page) +(define (partitioning-page) (run-partitioning-page)) (define (services-page) @@ -220,7 +221,7 @@ (define newt-installer (timezone-page timezone-page) (hostname-page hostname-page) (user-page user-page) - (partition-page partition-page) + (partitioning-page partitioning-page) (services-page services-page) (welcome-page welcome-page) (parameters-menu parameters-menu) diff --git a/gnu/installer/record.scm b/gnu/installer/record.scm index 5e0264682f..334af44a0c 100644 --- a/gnu/installer/record.scm +++ b/gnu/installer/record.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018, 2020 Mathieu Othacehe ;;; Copyright © 2020 Florian Pelz +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -37,7 +38,7 @@ (define-module (gnu installer record) installer-timezone-page installer-hostname-page installer-user-page - installer-partition-page + installer-partitioning-page installer-services-page installer-welcome-page installer-parameters-menu @@ -86,7 +87,7 @@ (define-record-type* ;; procedure void -> void (user-page installer-user-page) ;; procedure void -> void - (partition-page installer-partition-page) + (partitioning-page installer-partitioning-page) ;; procedure void -> void (services-page installer-services-page) ;; procedure (logo #:pci-database) -> void -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 21 04:18:18 2024 Received: (at 73927) by debbugs.gnu.org; 21 Oct 2024 08:18:19 +0000 Received: from localhost ([127.0.0.1]:50033 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2ncI-0003hV-G5 for submit@debbugs.gnu.org; Mon, 21 Oct 2024 04:18:18 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36400) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2nc4-0003eQ-NR for 73927@debbugs.gnu.org; Mon, 21 Oct 2024 04:18:05 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t2nbY-0003T2-II; Mon, 21 Oct 2024 04:17:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=EWf9eMGS45EBeCb9dB2HmJzsTUhAmZflOuernXTWF60=; b=hd9MCIc5JGPhsc6Ef0Jc jiKirBoH0uXLo0Q5B4IFlhFKtC1RWySyjMy8AAWtk+sdDcslubMGdvtJN1xSO3eDlMF1BwZVxuVfL lDgE8E9p5P06YWZhlemm6B32k+MBSBd+y+KUT9erpMDTUvgRddF3dO6RKo3huTWgHygddCcKNJr+5 uy2BxknRz4uz2si27yl+wkjVacJx7upObucsNUdnqfVTkssEv1PBGWA2A721zluORNVLtNDEQHi9V Nr+lsPmgCbi5Z29o1I0JtiI9JOAs5QyBEBdaXWVC3IhQ0Ad5LmQFifrFVV+yznDqR1fgiwcdZrwCg lBNkSixEnsvtqQ==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH 11/16] installer: Fix file-name typos. Date: Mon, 21 Oct 2024 10:17:07 +0200 Message-ID: <288e8e12e0a9a1ed6b7a713501c3e8e8a8b8757a.1729494414.git.janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Josselin Poiret , Ludovic Courtès , Mathieu Othacehe Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/installer/newt/page.scm (run-dump-page): Typo file-name. * gnu/installer/utils.scm (open-new-log-port): Likewise. Change-Id: I837991a0ee5054b3afa8328205e23ac6f9fbae8d --- gnu/installer/newt/page.scm | 7 ++++--- gnu/installer/utils.scm | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/gnu/installer/newt/page.scm b/gnu/installer/newt/page.scm index e1623a51fd..64a2916826 100644 --- a/gnu/installer/newt/page.scm +++ b/gnu/installer/newt/page.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2018 Mathieu Othacehe ;;; Copyright © 2019, 2020, 2022 Ludovic Courtès ;;; Copyright © 2019 Tobias Geerinckx-Rice +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -950,10 +951,10 @@ (define* (run-dump-page base-dir file-choices) ('exit-component (let ((result (map (match-lambda - ((edit checkbox filename) + ((edit checkbox file-name) (if (components=? edit argument) - (abort-to-prompt prompt-tag filename) - (cons filename (eq? #\x + (abort-to-prompt prompt-tag file-name) + (cons file-name (eq? #\x (checkbox-value checkbox)))))) components))) (destroy-form-and-pop form) diff --git a/gnu/installer/utils.scm b/gnu/installer/utils.scm index 6838410166..c722e9af8f 100644 --- a/gnu/installer/utils.scm +++ b/gnu/installer/utils.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018, 2020 Mathieu Othacehe ;;; Copyright © 2019, 2020, 2022 Ludovic Courtès +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -283,11 +284,11 @@ (define-syntax syslog (define (open-new-log-port) (define now (localtime (time-second (current-time)))) - (define filename + (define file-name (format #f "/tmp/installer.~a.log" (strftime "%F.%T" now))) - (open filename (logior O_RDWR - O_CREAT))) + (open file-name (logior O_RDWR + O_CREAT))) (define installer-log-port (let ((port #f)) -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 21 04:18:19 2024 Received: (at 73927) by debbugs.gnu.org; 21 Oct 2024 08:18:19 +0000 Received: from localhost ([127.0.0.1]:50035 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2ncI-0003hc-UQ for submit@debbugs.gnu.org; Mon, 21 Oct 2024 04:18:19 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36402) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2nc5-0003eU-GE for 73927@debbugs.gnu.org; Mon, 21 Oct 2024 04:18:06 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t2nbZ-0003TB-VK; Mon, 21 Oct 2024 04:17:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=CSK8I5KJT1wTYDX2mJIFIiHQotVgmlMrUDo05NicsEs=; b=VAO01MIergcuUbRJiEbO 1ZwJH6eWI2eN9yQPlqzAPgDbxzhtEM4jE3Fa+h34iSRr3lsBTDDk/4GMcSaTJM5aqM950d4j96ylY Bbl2WEtxhlRBnMWArmTw7FDSidCxhIJLDbdtoxxrVYwV+DoRJxzrlhBmFJ2tmt3DhEjdaWhp2hH6I WuP05AVA2jtgaKeRaU4mledRbPJdHEHZ5XkWPCX/AWd9TjIq23Hm7trNAX/WDdZ3+4fIXaHgP+Bvf 4yMQSJytCw/5uXwVcZMODBNy1o/WaoeOd3ONJGsqaxKBp9X9MfY/VEhQ/mzi/TPvF/6snWXFI/1gV h9maGgkLyNbeYg==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH 12/16] installer: Use `%' for parameter %run-command-in-installer. Date: Mon, 21 Oct 2024 10:17:08 +0200 Message-ID: X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Josselin Poiret , Ludovic Courtès , Mathieu Othacehe Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/installer/utils.scm (run-command-in-installer): Rename to... (%run-command-in-installer): ...this. * gnu/installer.scm (installer-program): Update accordingly. * gnu/installer/parted.scm (remove-logical-devices, create-btrfs-file-system, create-ext4-file-system, create-fat16-file-system, create-fat32-file-system, create-jfs-file-system, create-ntfs-file-system, create-xfs-file-system, create-swap-partition, luks-format-and-open, luks-ensure-open, luks-close): Update accordingly. Change-Id: I96ebc59ebc85fd8ebccb0cc57130b4e7532d287f --- gnu/installer.scm | 2 +- gnu/installer/parted.scm | 27 ++++++++++++++------------- gnu/installer/utils.scm | 6 +++--- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/gnu/installer.scm b/gnu/installer.scm index 3a05843cab..21809e4259 100644 --- a/gnu/installer.scm +++ b/gnu/installer.scm @@ -465,7 +465,7 @@ (define (installer-program) (installer-init current-installer) (lambda () (parameterize - ((run-command-in-installer + ((%run-command-in-installer (installer-run-command current-installer))) (catch #t (lambda () diff --git a/gnu/installer/parted.scm b/gnu/installer/parted.scm index dbdec1bba8..e59df3d8e6 100644 --- a/gnu/installer/parted.scm +++ b/gnu/installer/parted.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2019-2020, 2022, 2024 Ludovic Courtès ;;; Copyright © 2020 Tobias Geerinckx-Rice ;;; Copyright © 2022 Josselin Poiret +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -363,7 +364,7 @@ (define* (force-device-sync device) (define (remove-logical-devices) "Remove all active logical devices." - ((run-command-in-installer) "dmsetup" "remove_all")) + ((%run-command-in-installer) "dmsetup" "remove_all")) (define (installer-root-partition-path) "Return the root partition path, or #f if it could not be detected." @@ -1183,7 +1184,7 @@ (define (set-user-partitions-file-name user-partitions) (define (create-btrfs-file-system partition) "Create a btrfs file-system for PARTITION file-name." - ((run-command-in-installer) "mkfs.btrfs" "-f" partition)) + ((%run-command-in-installer) "mkfs.btrfs" "-f" partition)) (define (create-ext4-file-system partition) "Create an ext4 file-system for PARTITION file-name." @@ -1192,32 +1193,32 @@ (define (create-ext4-file-system partition) ;; up and adding new files would fail with ENOSPC despite there being plenty ;; of free space and inodes: ;; . - ((run-command-in-installer) "mkfs.ext4" "-F" partition + ((%run-command-in-installer) "mkfs.ext4" "-F" partition "-O" "large_dir")) (define (create-fat16-file-system partition) "Create a fat16 file-system for PARTITION file-name." - ((run-command-in-installer) "mkfs.fat" "-F16" partition)) + ((%run-command-in-installer) "mkfs.fat" "-F16" partition)) (define (create-fat32-file-system partition) "Create a fat32 file-system for PARTITION file-name." - ((run-command-in-installer) "mkfs.fat" "-F32" partition)) + ((%run-command-in-installer) "mkfs.fat" "-F32" partition)) (define (create-jfs-file-system partition) "Create a JFS file-system for PARTITION file-name." - ((run-command-in-installer) "jfs_mkfs" "-f" partition)) + ((%run-command-in-installer) "jfs_mkfs" "-f" partition)) (define (create-ntfs-file-system partition) "Create a JFS file-system for PARTITION file-name." - ((run-command-in-installer) "mkfs.ntfs" "-F" "-f" partition)) + ((%run-command-in-installer) "mkfs.ntfs" "-F" "-f" partition)) (define (create-xfs-file-system partition) "Create an XFS file-system for PARTITION file-name." - ((run-command-in-installer) "mkfs.xfs" "-f" partition)) + ((%run-command-in-installer) "mkfs.xfs" "-f" partition)) (define (create-swap-partition partition) "Set up swap area on PARTITION file-name." - ((run-command-in-installer) "mkswap" "-f" partition)) + ((%run-command-in-installer) "mkswap" "-f" partition)) (define (call-with-luks-key-file password proc) "Write PASSWORD in a temporary file and pass it to PROC as argument." @@ -1246,9 +1247,9 @@ (define (luks-format-and-open user-partition) (lambda (key-file) (installer-log-line "formatting and opening LUKS entry ~s at ~s" label file-name) - ((run-command-in-installer) "cryptsetup" "-q" "luksFormat" + ((%run-command-in-installer) "cryptsetup" "-q" "luksFormat" file-name key-file) - ((run-command-in-installer) "cryptsetup" "open" "--type" "luks" + ((%run-command-in-installer) "cryptsetup" "open" "--type" "luks" "--key-file" key-file file-name label))))) (define (luks-ensure-open user-partition) @@ -1262,14 +1263,14 @@ (define (luks-ensure-open user-partition) (lambda (key-file) (installer-log-line "opening LUKS entry ~s at ~s" label file-name) - ((run-command-in-installer) "cryptsetup" "open" "--type" "luks" + ((%run-command-in-installer) "cryptsetup" "open" "--type" "luks" "--key-file" key-file file-name label)))))) (define (luks-close user-partition) "Close the encrypted partition pointed by USER-PARTITION." (let ((label (user-partition-crypt-label user-partition))) (installer-log-line "closing LUKS entry ~s" label) - ((run-command-in-installer) "cryptsetup" "close" label))) + ((%run-command-in-installer) "cryptsetup" "close" label))) (define (format-user-partitions user-partitions) "Format the records in USER-PARTITIONS list with diff --git a/gnu/installer/utils.scm b/gnu/installer/utils.scm index c722e9af8f..170f036537 100644 --- a/gnu/installer/utils.scm +++ b/gnu/installer/utils.scm @@ -50,7 +50,7 @@ (define-module (gnu installer utils) run-external-command-with-handler/tty run-external-command-with-line-hooks run-command - run-command-in-installer + %run-command-in-installer syslog-port %syslog-line-hook @@ -222,13 +222,13 @@ (define* (run-command command #:key (tty? #f)) (pause) succeeded?) -(define run-command-in-installer +(define %run-command-in-installer (make-parameter (lambda (. args) (raise (condition (&serious) - (&message (message "run-command-in-installer not set"))))))) + (&message (message "%run-command-in-installer not set"))))))) ;;; -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 21 04:18:20 2024 Received: (at 73927) by debbugs.gnu.org; 21 Oct 2024 08:18:20 +0000 Received: from localhost ([127.0.0.1]:50037 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2ncJ-0003hk-IP for submit@debbugs.gnu.org; Mon, 21 Oct 2024 04:18:20 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36408) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2nc6-0003eY-Dy for 73927@debbugs.gnu.org; Mon, 21 Oct 2024 04:18:07 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t2nba-0003TK-TT; Mon, 21 Oct 2024 04:17:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=z4dZ6KyAzFhF7tUzPFd3nYzp9ZEnAxoW67m1LqaIbwU=; b=rHnMP6338BAZQ3zy0JJr M/lDCa5usLIlP+2Y2uebrl29fhQfZqzQg58/iUxq0CDroRU5c0w/xDAU/gqU15xZruf0e0LT03It6 pjFx0jvpVkGk8xSrMk+BT1V6J0FfBk787DyWmFhJ7ePxwaLIeo58ASzP8FiRRJpsWnxqHDLLCsplO W4+ugGqQo+KkUPj+02zleK11SykTKG9VLD759DtzAqIXGUSX5+w7+NiozvsPf2AlAVeG2TLfvK6dS YqiS3JRiHGWXptDLzSP05kAcEpDup0hNCPVt7U1Jv/D5BJ0bbGpjTSlKCliwODdUagXsWRP6Bo7kH GtUSy6vu4VcUXQ==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH 13/16] installer: Add dry-run? Date: Mon, 21 Oct 2024 10:17:09 +0200 Message-ID: <5c147111fed1208e96f5e54619ceefd5bfc073f8.1729494414.git.janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Josselin Poiret , Ludovic Courtès , Mathieu Othacehe Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) This allows running the installer without root privileges. Do something like ./pre-inst-env guix repl ,use (guix) ,use (gnu installer) (installer-program #:dry-run? #t) ,build $1 => "/gnu/store/...-installer-program" and run /gnu/store/...-installer-program * gnu/installer/newt.scm (locale-page): Add #:dry-run? parameter. (keymap-page): Likewise. * gnu/installer/newt/keymap.scm (run-keymap-page): Likewise. * gnu/installer/steps.scm (run-installer-steps): Likewise. Use it to skip writing to socket. * gnu/installer/newt/final.scm (run-final-page): Rename to... (run-final-page-install): ...this. (dry-run-final-page, run-final-page): New procedures. * gnu/installer/parted.scm (bootloader-configuration): Cater for empty user partitions. * gnu/installer/utils.scm (dry-run-command): New procedure. * gnu/installer.scm (compute-locale-step): Add #:dry-run? parameter. Use it to avoid actually applying locale. (compute-keymap-step): Add dry-run? parameter. Pass it to keymap-page. (installer-program): Add #:dry-run? parameter. If #:true avoid writing to /proc, use dry-run-command, skip sync and reboot, and pass dry-run? to... (installer-steps): ...here. Add #:dry-run? parameter. Use it to disable skip network, substitutes, partitioning pages, and pass it to... compute-locale-step, compute-keymap-step, and final-page. Change-Id: I0ff4c3b0a0c69539af617c27ba37654beed44619 --- gnu/installer.scm | 81 ++++++++++++++++++++------------ gnu/installer/newt.scm | 14 +++--- gnu/installer/newt/final.scm | 20 +++++++- gnu/installer/newt/keymap.scm | 5 +- gnu/installer/newt/locale.scm | 6 ++- gnu/installer/newt/partition.scm | 1 + gnu/installer/parted.scm | 29 +++++++----- gnu/installer/steps.scm | 16 +++++-- gnu/installer/utils.scm | 4 ++ 9 files changed, 116 insertions(+), 60 deletions(-) diff --git a/gnu/installer.scm b/gnu/installer.scm index 21809e4259..39a83c4455 100644 --- a/gnu/installer.scm +++ b/gnu/installer.scm @@ -134,7 +134,8 @@ (define apply-locale (define* (compute-locale-step #:key locales-name iso639-languages-name - iso3166-territories-name) + iso3166-territories-name + dry-run?) "Return a gexp that run the locale-page of INSTALLER, and install the selected locale. The list of locales, languages and territories passed to locale-page are computed in derivations named respectively LOCALES-NAME, @@ -177,8 +178,11 @@ (define* (compute-locale-step #:key ((installer-locale-page current-installer) #:supported-locales #$locales-loader #:iso639-languages #$iso639-loader - #:iso3166-territories #$iso3166-loader))) - (#$apply-locale result) + #:iso3166-territories #$iso3166-loader + #:dry-run? #$dry-run?))) + (if #$dry-run? + '() + (#$apply-locale result)) result)))) (define apply-keymap @@ -188,7 +192,7 @@ (define apply-keymap (kmscon-update-keymap (default-keyboard-model) layout variant options)))) -(define* (compute-keymap-step context) +(define (compute-keymap-step context dry-run?) "Return a gexp that runs the keymap-page of INSTALLER and install the selected keymap." #~(lambda (current-installer) @@ -200,15 +204,16 @@ (define* (compute-keymap-step context) "/share/X11/xkb/rules/base.xml"))) (lambda (models layouts) ((installer-keymap-page current-installer) - layouts '#$context))))) + layouts '#$context #$dry-run?))))) (and result (#$apply-keymap result)) result))) -(define (installer-steps) +(define* (installer-steps #:key dry-run?) (let ((locale-step (compute-locale-step #:locales-name "locales" #:iso639-languages-name "iso639-languages" - #:iso3166-territories-name "iso3166-territories")) + #:iso3166-territories-name "iso3166-territories" + #:dry-run? dry-run?)) (timezone-data #~(string-append #$tzdata "/share/zoneinfo/zone.tab"))) #~(lambda (current-installer) @@ -216,7 +221,7 @@ (define (installer-steps) (lambda () ((installer-parameters-page current-installer) (lambda _ - (#$(compute-keymap-step 'param) + (#$(compute-keymap-step 'param dry-run?) current-installer))))) (list ;; Ask the user to choose a locale among those supported by @@ -262,8 +267,10 @@ (define (installer-steps) (id 'keymap) (description (G_ "Keyboard mapping selection")) (compute (lambda _ - (#$(compute-keymap-step 'default) - current-installer))) + (if #$dry-run? + '("en" "US" #f) + (#$(compute-keymap-step 'default dry-run?) + current-installer)))) (configuration-formatter keyboard-layout->configuration)) ;; Ask the user to input a hostname for the system. @@ -280,14 +287,18 @@ (define (installer-steps) (id 'network) (description (G_ "Network selection")) (compute (lambda _ - ((installer-network-page current-installer))))) + (if #$dry-run? + '() + ((installer-network-page current-installer)))))) ;; Ask whether to enable substitute server discovery. (installer-step (id 'substitutes) (description (G_ "Substitute server discovery")) (compute (lambda _ - ((installer-substitutes-page current-installer))))) + (if #$dry-run? + '() + ((installer-substitutes-page current-installer)))))) ;; Prompt for users (name, group and home directory). (installer-step @@ -313,7 +324,9 @@ (define (installer-steps) (id 'partition) (description (G_ "Partitioning")) (compute (lambda _ - ((installer-partitioning-page current-installer)))) + (if #$dry-run? + '() + ((installer-partitioning-page current-installer))))) (configuration-formatter user-partitions->configuration)) (installer-step @@ -322,7 +335,7 @@ (define (installer-steps) (compute (lambda (result prev-steps) ((installer-final-page current-installer) - result prev-steps)))))))) + result prev-steps #$dry-run?)))))))) (define (provenance-sexp) "Return an sexp representing the currently-used channels, for logging @@ -343,7 +356,7 @@ (define (provenance-sexp) `(channel ,(channel-name channel) ,url ,(channel-commit channel)))) channels)))) -(define (installer-program) +(define* (installer-program #:key dry-run?) "Return a file-like object that runs the given INSTALLER." (define init-gettext ;; Initialize gettext support, so that installer messages can be @@ -377,7 +390,7 @@ (define (installer-program) (lambda () (set-path-environment-variable "PATH" '("bin" "sbin") inputs))))) - (define steps (installer-steps)) + (define steps (installer-steps #:dry-run? dry-run?)) (define modules (scheme-modules* (string-append (current-source-directory) "/..") @@ -425,9 +438,10 @@ (define (installer-program) ;; Enable core dump generation. (setrlimit 'core #f #f) - (call-with-output-file "/proc/sys/kernel/core_pattern" - (lambda (port) - (format port %core-dump))) + (unless #$dry-run? + (call-with-output-file "/proc/sys/kernel/core_pattern" + (lambda (port) + (format port %core-dump)))) ;; Initialize gettext support so that installers can use ;; (guix i18n) module. @@ -466,24 +480,29 @@ (define (installer-program) (lambda () (parameterize ((%run-command-in-installer - (installer-run-command current-installer))) + (if #$dry-run? + dry-run-command + (installer-run-command current-installer)))) (catch #t (lambda () (define results (run-installer-steps #:rewind-strategy 'menu #:menu-proc (installer-menu-page current-installer) - #:steps steps)) - - (match (result-step results 'final) - ('success - ;; We did it! Let's reboot! - (sync) - (stop-service 'root)) - (_ - ;; The installation failed, exit so that it is - ;; restarted by login. - #f))) + #:steps steps + #:dry-run? #$dry-run?)) + + (let ((result (result-step results 'final))) + (unless #$dry-run? + (match (result-step results 'final) + ('success + ;; We did it! Let's reboot! + (sync) + (stop-service 'root)) + (_ + ;; The installation failed, exit so that it is + ;; restarted by login. + #f))))) (const #f) (lambda (key . args) (installer-log-line "crashing due to uncaught exception: ~s ~s" diff --git a/gnu/installer/newt.scm b/gnu/installer/newt.scm index 6d8ea35fff..d53bc058b3 100644 --- a/gnu/installer/newt.scm +++ b/gnu/installer/newt.scm @@ -158,17 +158,19 @@ (define (newt-run-command . args) (term-signal term-sig) (stop-signal stop-sig))))))))))) -(define (final-page result prev-steps) - (run-final-page result prev-steps)) +(define (final-page result prev-steps dry-run?) + (run-final-page result prev-steps dry-run?)) (define* (locale-page #:key supported-locales iso639-languages - iso3166-territories) + iso3166-territories + dry-run?) (run-locale-page #:supported-locales supported-locales #:iso639-languages iso639-languages - #:iso3166-territories iso3166-territories)) + #:iso3166-territories iso3166-territories + #:dry-run? dry-run?)) (define (timezone-page zonetab) (run-timezone-page zonetab)) @@ -179,8 +181,8 @@ (define* (welcome-page logo #:key pci-database) (define (menu-page steps) (run-menu-page steps)) -(define* (keymap-page layouts context) - (run-keymap-page layouts #:context context)) +(define (keymap-page layouts context dry-run?) + (run-keymap-page layouts #:context context #:dry-run? dry-run?)) (define (network-page) (run-network-page)) diff --git a/gnu/installer/newt/final.scm b/gnu/installer/newt/final.scm index 9f950a0551..c4e53f6d79 100644 --- a/gnu/installer/newt/final.scm +++ b/gnu/installer/newt/final.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018, 2020 Mathieu Othacehe ;;; Copyright © 2019, 2020 Ludovic Courtès +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -106,7 +107,7 @@ (define* (run-install-shell locale (newt-resume) install-ok?)) -(define (run-final-page result prev-steps) +(define (run-final-page-install result prev-steps) (define (wait-for-clients) (unless (null? (current-clients)) (installer-log-line "waiting with clients before starting final step") @@ -133,3 +134,20 @@ (define (run-final-page result prev-steps) (if install-ok? (run-install-success-page) (run-install-failed-page)))) + +(define (dry-run-final-page result prev-steps) + (installer-log-line "proceeding with final step -- dry-run") + (let* ((configuration (format-configuration prev-steps result)) + (user-partitions (result-step result 'partition)) + (locale (result-step result 'locale)) + (users (result-step result 'user)) + (file (configuration->file configuration)) + (install-ok? (run-config-display-page #:locale locale))) + (if install-ok? + (run-install-success-page) + (run-install-failed-page)))) + +(define (run-final-page result prev-steps dry-run?) + (if dry-run? + (dry-run-final-page result prev-steps) + (run-final-page-install result prev-steps))) diff --git a/gnu/installer/newt/keymap.scm b/gnu/installer/newt/keymap.scm index 109ec55e0a..57f6d6530c 100644 --- a/gnu/installer/newt/keymap.scm +++ b/gnu/installer/newt/keymap.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2018, 2020 Mathieu Othacehe ;;; Copyright © 2019 Ludovic Courtès ;;; Copyright © 2020 Florian Pelz +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -153,7 +154,7 @@ (define (toggleable-latin-layout layout variant) "grp:alt_shift_toggle")) (list layout variant #f))) -(define* (run-keymap-page layouts #:key (context #f)) +(define* (run-keymap-page layouts #:key context dry-run?) "Run a page asking the user to select a keyboard layout and variant. LAYOUTS is a list of supported X11-KEYMAP-LAYOUT. For non-Latin keyboard layouts, a second layout and toggle options will be added automatically. Return a list @@ -201,7 +202,7 @@ (define* (run-keymap-page layouts #:key (context #f)) "xkeyboard-config"))))) (toggleable-latin-layout layout variant))) - (let* ((result (run-installer-steps #:steps keymap-steps)) + (let* ((result (run-installer-steps #:steps keymap-steps #:dry-run? dry-run?)) (layout (result-step result 'layout)) (variant (result-step result 'variant))) (and layout diff --git a/gnu/installer/newt/locale.scm b/gnu/installer/newt/locale.scm index a226b39ba6..0be9db449e 100644 --- a/gnu/installer/newt/locale.scm +++ b/gnu/installer/newt/locale.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018 Mathieu Othacehe ;;; Copyright © 2019 Ludovic Courtès +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -92,7 +93,8 @@ (define (run-modifier-page modifiers modifier->text) (define* (run-locale-page #:key supported-locales iso639-languages - iso3166-territories) + iso3166-territories + dry-run?) "Run a page asking the user to select a locale language and possibly territory, codeset and modifier. Use SUPPORTED-LOCALES as the list of glibc available locales. ISO639-LANGUAGES is an association list associating a @@ -212,4 +214,4 @@ (define* (run-locale-page #:key ;; step, turn the result into a glibc locale string and return it. (result->locale-string supported-locales - (run-installer-steps #:steps locale-steps))) + (run-installer-steps #:steps locale-steps #:dry-run? dry-run?))) diff --git a/gnu/installer/newt/partition.scm b/gnu/installer/newt/partition.scm index 37656696c1..48dd306080 100644 --- a/gnu/installer/newt/partition.scm +++ b/gnu/installer/newt/partition.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2018, 2019, 2022 Mathieu Othacehe ;;; Copyright © 2019, 2020 Ludovic Courtès ;;; Copyright © 2020 Tobias Geerinckx-Rice +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; diff --git a/gnu/installer/parted.scm b/gnu/installer/parted.scm index e59df3d8e6..b36b238d8b 100644 --- a/gnu/installer/parted.scm +++ b/gnu/installer/parted.scm @@ -1461,19 +1461,22 @@ (define (root-user-partition? partition) (define (bootloader-configuration user-partitions) "Return the bootloader configuration field for USER-PARTITIONS." - (let* ((root-partition (find root-user-partition? - user-partitions)) - (root-partition-disk (user-partition-disk-file-name root-partition))) - `((bootloader-configuration - ,@(if (efi-installation?) - `((bootloader grub-efi-bootloader) - (targets (list ,(default-esp-mount-point)))) - `((bootloader grub-bootloader) - (targets (list ,root-partition-disk)))) - - ;; XXX: Assume we defined the 'keyboard-layout' field of - ;; right above. - (keyboard-layout keyboard-layout))))) + (let ((root-partition (find root-user-partition? user-partitions))) + (match user-partitions + (() '()) + (_ + (let ((root-partition-disk (user-partition-disk-file-name + root-partition))) + `((bootloader-configuration + ,@(if (efi-installation?) + `((bootloader grub-efi-bootloader) + (targets (list ,(default-esp-mount-point)))) + `((bootloader grub-bootloader) + (targets (list ,root-partition-disk)))) + + ;; XXX: Assume we defined the 'keyboard-layout' field of + ;; right above. + (keyboard-layout keyboard-layout)))))))) (define (user-partition-missing-modules user-partitions) "Return the list of kernel modules missing from the default set of kernel diff --git a/gnu/installer/steps.scm b/gnu/installer/steps.scm index 0c505e40e4..de0a852f02 100644 --- a/gnu/installer/steps.scm +++ b/gnu/installer/steps.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018, 2019 Mathieu Othacehe ;;; Copyright © 2020-2022 Ludovic Courtès +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -84,7 +85,8 @@ (define-record-type* (define* (run-installer-steps #:key steps (rewind-strategy 'previous) - (menu-proc (const #f))) + (menu-proc (const #f)) + dry-run?) "Run the COMPUTE procedure of all records in STEPS sequentially, inside a the 'installer-step prompt. When aborted to with a parameter of 'abort, fallback to a previous install-step, accordingly to the @@ -191,10 +193,14 @@ (define* (run-installer-steps #:key ;; prematurely. (sigaction SIGPIPE SIG_IGN) - (with-server-socket - (run '() - #:todo-steps steps - #:done-steps '()))) + (if dry-run? + (run '() + #:todo-steps steps + #:done-steps '()) + (with-server-socket + (run '() + #:todo-steps steps + #:done-steps '())))) (define (find-step-by-id steps id) "Find and return the step in STEPS whose id is equal to ID." diff --git a/gnu/installer/utils.scm b/gnu/installer/utils.scm index 170f036537..a8eb6cee83 100644 --- a/gnu/installer/utils.scm +++ b/gnu/installer/utils.scm @@ -49,6 +49,7 @@ (define-module (gnu installer utils) run-external-command-with-handler run-external-command-with-handler/tty run-external-command-with-line-hooks + dry-run-command run-command %run-command-in-installer @@ -222,6 +223,9 @@ (define* (run-command command #:key (tty? #f)) (pause) succeeded?) +(define (dry-run-command . args) + (format #t "dry-run-command: skipping: ~a\n" args)) + (define %run-command-in-installer (make-parameter (lambda (. args) -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 21 04:18:21 2024 Received: (at 73927) by debbugs.gnu.org; 21 Oct 2024 08:18:21 +0000 Received: from localhost ([127.0.0.1]:50039 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2ncK-0003hs-PS for submit@debbugs.gnu.org; Mon, 21 Oct 2024 04:18:21 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36424) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2ncA-0003fv-6X for 73927@debbugs.gnu.org; Mon, 21 Oct 2024 04:18:10 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t2nbe-0003Ty-Hc; Mon, 21 Oct 2024 04:17:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=Ppe8hOhH87LBYDPktBYAQOvm/YbN/xHgkOUNWh7OPSQ=; b=qLDaqec1vxSbJZjzZ1yk Z/W6GMBZ74b7bZCb3y5nZvVS5CRx2NkxzEbgjUyXQzc7ZTiD1hx9Rc/bkHH/9VeAJGx68b6JBzlqw Iuf3JZ5w7ftUR6CHanz+Rn7yJMwLpZ3DGZoIMMtgAE6YpU/KVbEMFOl/5C6XqHbi5Yg1RX/Zn54qT vV5UAW1XPS1wxv52KHiVaxRfE0PhmNS19A7vVVWrHS5rPH1y1to7YPu2AIHw8Ih8V4xCm7LM7oCeA WcOKQ4Oa7dcL+iee2uZWorITrXeqC+Hk+umekFZrbCp8drgOigoy8iJr1gOdPeOhPn/zKZKCN8Rn2 t0WUoTDTYoMw/Q==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH 15/16] installer: Add static-networking template. Date: Mon, 21 Oct 2024 10:17:11 +0200 Message-ID: X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Josselin Poiret , Ludovic Courtès , Mathieu Othacehe Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/installer/services.scm (%system-services): Add static-networking-service-type. Change-Id: Iec6336f8d1f49e8b801e978d5c9eeb4f83a6e748 --- gnu/installer/services.scm | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/gnu/installer/services.scm b/gnu/installer/services.scm index d5a382606c..8b117d9a20 100644 --- a/gnu/installer/services.scm +++ b/gnu/installer/services.scm @@ -149,6 +149,28 @@ (define (%system-services) (name (G_ "DHCP client (dynamic IP address assignment)")) (type 'network-management) (snippet '((service dhcp-client-service-type)))) + (system-service + (name (G_ "Static networking service.")) + (type 'network-management) + (snippet `((service + static-networking-service-type + (list %loopback-static-networking + (static-networking + (addresses + (list + (network-address + (device "eth0") + ,(comment (G_ ";; Fill-in your IP.\n")) + (value "192.168.178.10/24")))) + (routes + (list (network-route + (destination "default") + ,(comment (G_ ";; Fill-in your gateway IP.\n")) + (gateway "192.168.178.1")))) + (requirement '()) + (provision '(networking)) + ,(comment (G_ ";; Fill-in your nameservers.\n")) + (name-servers '("192.168.178.1")))))))) ;; Dealing with documents. (system-service -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 21 04:18:23 2024 Received: (at 73927) by debbugs.gnu.org; 21 Oct 2024 08:18:23 +0000 Received: from localhost ([127.0.0.1]:50041 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2ncL-0003hz-4P for submit@debbugs.gnu.org; Mon, 21 Oct 2024 04:18:22 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36420) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2nc9-0003fT-2o for 73927@debbugs.gnu.org; Mon, 21 Oct 2024 04:18:10 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t2nbd-0003Tl-I8; Mon, 21 Oct 2024 04:17:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=CO77OUD4YdLp+ufdU12tqmVO1rAM4U4zjXzd12CqZ70=; b=PM6VaRkSyXZrcPytUWi5 uJwBl59g5AesyN5xjZhSxBg64vT0ztl6gmOqRZ8w2Rjt88nUjzM6jIHSdOKLHHrjWvmn9d5g+HKC5 3TGZTvT+pZkD/kgLF4MVanuKoxSUAqpVEWi2P2yKjylMQu7Rw4uW5vmd8vaKsXaa5A2FWE+FQfG3W xlt3S2Hne12KKaodwg/IZSLHS9FXHsG4QuuTA8YQObEW9mJuB4KV6pyaowjKv5OoMr64H/nhOIZHF 3+AipLHAhccNYJRd31PFGMtZRPBC+ixK87IQV56oGf8KbFcJIsAGa+XLreNh6mus5tddru1+Pbo5W rnXQIJgeFLzo+w==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH 14/16] installer: Add "Kernel" page to select the Hurd. Date: Mon, 21 Oct 2024 10:17:10 +0200 Message-ID: X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Josselin Poiret , Ludovic Courtès , Mathieu Othacehe Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) This adds a "Kernel" page to the installer with the option to (cross-) install the Hurd, if applicable (only available on x86 machines for now). * gnu/installer/newt.scm (kernel-page): New procedure. (newt-installer)[kernel-page]: New field. * gnu/installer/kernel.scm, gnu/installer/newt/kernel.scm: New files. * gnu/local.mk (INSTALLER_MODULES): Add them. * gnu/installer.scm (installer-steps): Use them to select kernel if applicable. * gnu/installer/newt/partition.scm (run-fs-type-page): Add ext2 for the hurd. (run-partitioning-page-partition): Remove `entire-encrypted' option when installing the Hurd. * gnu/installer/services.scm (system-services->configuration): Cater for the Hurd with %base-services/hurd, and with %base-packages/hurd that must always be set. (%system-services): Change to procedure. When installing the the Hurd, do not recommend `ntp-service-type' and USE `openssh-sans-x' package for `openssh-service-type'. (system-service-none): New variable. * gnu/installer/newt/services.scm (run-network-management-page): Include it when installing the Hurd. (run-desktop-environments-cbt-page): When installing the Hurd, recommend to not select any desktop enviroment. Update users. * gnu/installer/parted.scm (create-ext2-file-system): New procedure. (user-fs-type-name, user-fs-type->mount-type, partition-filesystem-user-type, format-user-partitions): Support `ext2'. ( partition->user-partition): Use `ext2' when installing the Hurd. (auto-partition!): Likewise. No swap partition when installing the Hurd. * gnu/installer/final.scm (install-system): Cater for cross installation of the Hurd. (bootloader-configuration): Use `grub-minimal-bootloader' when installing the Hurd. (user-partition-missing-modules): Cater for empty user-partitions. (initrd-configuration, user-partitions->configuration): Cater for the Hurd. * gnu/installer/steps.scm (format-configuration, configuration->file): Cater for the Hurd. * gnu/system/hurd.scm (%desktop-services/hurd): New variable. Change-Id: Ifafb27b8a2f933944c77223a27ec151757237e36 * gnu/installer/services.scm (%system-services): Change-Id: I15d535a7a8a917e5f3492f8c01d922d652c32ee5 geert none Change-Id: Ib6c5665638018f59a2690f603fad0702e042fb8b Change-Id: I01b854390240be60ce9fef8c9510a90bc6843ef3 geert Change-Id: Ibb7205443969fc92d4fe62d4dfb4f956d03229b9 --- gnu/installer.scm | 14 ++++++++ gnu/installer/final.scm | 10 ++++-- gnu/installer/kernel.scm | 34 ++++++++++++++++++ gnu/installer/newt.scm | 5 +++ gnu/installer/newt/kernel.scm | 45 +++++++++++++++++++++++ gnu/installer/newt/partition.scm | 9 ++++- gnu/installer/newt/services.scm | 31 +++++++++------- gnu/installer/parted.scm | 62 +++++++++++++++++++++++--------- gnu/installer/record.scm | 3 ++ gnu/installer/services.scm | 46 ++++++++++++++++++------ gnu/installer/steps.scm | 14 +++++--- gnu/local.mk | 2 ++ gnu/system/hurd.scm | 3 ++ 13 files changed, 231 insertions(+), 47 deletions(-) create mode 100644 gnu/installer/kernel.scm create mode 100644 gnu/installer/newt/kernel.scm diff --git a/gnu/installer.scm b/gnu/installer.scm index 39a83c4455..64f6273c55 100644 --- a/gnu/installer.scm +++ b/gnu/installer.scm @@ -281,6 +281,18 @@ (define* (installer-steps #:key dry-run?) ((installer-hostname-page current-installer)))) (configuration-formatter hostname->configuration)) + ;; Ask the user to select the kernel for the system, + ;; for x86 systems only. + (installer-step + (id 'kernel) + (description (G_ "Kernel")) + (compute (lambda _ + (if (target-x86?) + ((installer-kernel-page current-installer)) + '()))) + (configuration-formatter (lambda (result) + (kernel->configuration result #$dry-run?)))) + ;; Provide an interface above connmanctl, so that the user can select ;; a network susceptible to acces Internet. (installer-step @@ -419,6 +431,7 @@ (define* (installer-program #:key dry-run?) (gnu installer dump) (gnu installer final) (gnu installer hostname) + (gnu installer kernel) (gnu installer locale) (gnu installer parted) (gnu installer services) @@ -431,6 +444,7 @@ (define* (installer-program #:key dry-run?) (gnu services herd) (guix i18n) (guix build utils) + (guix utils) ((system repl debug) #:select (terminal-width)) (ice-9 match) diff --git a/gnu/installer/final.scm b/gnu/installer/final.scm index 069426a3b8..5fcf223315 100644 --- a/gnu/installer/final.scm +++ b/gnu/installer/final.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018, 2020 Mathieu Othacehe ;;; Copyright © 2019, 2020, 2022 Ludovic Courtès +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -25,6 +26,7 @@ (define-module (gnu installer final) #:use-module (gnu services herd) #:use-module (guix build syscalls) #:use-module (guix build utils) + #:use-module (guix utils) #:use-module (gnu build accounts) #:use-module (gnu build install) #:use-module (gnu build linux-container) @@ -164,8 +166,12 @@ (define* (install-system locale #:key (users '())) "/tmp/installer-system-init-options" read)) (const '()))) - (install-command (append (list "guix" "system" "init" - "--fallback") + (install-command (append `( "guix" "system" "init" + "--fallback" + ,@(if (target-hurd?) + '("--target=i586-pc-gnu" + "--skip-checks") + '())) options (list (%installer-configuration-file) (%installer-target-dir)))) diff --git a/gnu/installer/kernel.scm b/gnu/installer/kernel.scm new file mode 100644 index 0000000000..059659ec75 --- /dev/null +++ b/gnu/installer/kernel.scm @@ -0,0 +1,34 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2024 Janneke Nieuwenhuizen +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu installer kernel) + #:use-module (gnu system hurd) + #:export (kernel->configuration)) + +(define (kernel->configuration kernel dry-run?) + (if (equal? kernel "Hurd") + `((kernel %hurd-default-operating-system-kernel) + (kernel-arguments '("noide")) + (firmware '()) + (hurd hurd) + (locale-libcs (list glibc/hurd)) + (name-service-switch #f) + (essential-services (hurd-default-essential-services this-operating-system)) + (privileged-programs '()) + (setuid-programs %setuid-programs/hurd)) + '())) diff --git a/gnu/installer/newt.scm b/gnu/installer/newt.scm index d53bc058b3..1fe710340f 100644 --- a/gnu/installer/newt.scm +++ b/gnu/installer/newt.scm @@ -25,6 +25,7 @@ (define-module (gnu installer newt) #:use-module (gnu installer newt final) #:use-module (gnu installer newt parameters) #:use-module (gnu installer newt hostname) + #:use-module (gnu installer newt kernel) #:use-module (gnu installer newt keymap) #:use-module (gnu installer newt locale) #:use-module (gnu installer newt menu) @@ -193,6 +194,9 @@ (define (substitutes-page) (define (hostname-page) (run-hostname-page)) +(define (kernel-page) + (run-kernel-page)) + (define (user-page) (run-user-page)) @@ -216,6 +220,7 @@ (define newt-installer (exit-error exit-error) (final-page final-page) (keymap-page keymap-page) + (kernel-page kernel-page) (locale-page locale-page) (menu-page menu-page) (network-page network-page) diff --git a/gnu/installer/newt/kernel.scm b/gnu/installer/newt/kernel.scm new file mode 100644 index 0000000000..3117247312 --- /dev/null +++ b/gnu/installer/newt/kernel.scm @@ -0,0 +1,45 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2024 Janneke Nieuwenhuizen +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu installer newt kernel) + #:use-module (gnu installer newt page) + #:use-module (guix i18n) + #:use-module (guix utils) + #:export (run-kernel-page)) + +(define (run-kernel-page) + (let* ((kernels `(,@(if (target-x86?) '("Hurd") '()) + "Linux Libre")) + (result + (run-listbox-selection-page + #:title (G_ "Kernel") + #:info-text + (G_ "Please select a kernel. When in doubt, choose \"Linux Libre\". +The Hurd is offered as a technology preview and development aid; many packages \ +are not yet available in Guix, such as a desktop environment or even a windowing \ +system (X, Wayland).") + #:listbox-items kernels + #:listbox-item->text identity + #:listbox-default-item "Linux Libre" + #:button-text (G_ "Back") + #:button-callback-procedure + (lambda _ + (abort-to-prompt 'installer-step 'abort))))) + (when (equal? result "Hurd") + (%current-target-system "i586-pc-gnu")) + result)) diff --git a/gnu/installer/newt/partition.scm b/gnu/installer/newt/partition.scm index 48dd306080..b88393405b 100644 --- a/gnu/installer/newt/partition.scm +++ b/gnu/installer/newt/partition.scm @@ -26,6 +26,7 @@ (define-module (gnu installer newt partition) #:use-module (gnu installer newt page) #:use-module (gnu installer newt utils) #:use-module (guix i18n) + #:use-module (guix utils) #:use-module (ice-9 format) #:use-module (ice-9 match) #:use-module (srfi srfi-1) @@ -147,6 +148,8 @@ (define (run-fs-type-page) #:title (G_ "File-system type") #:listbox-items '(btrfs ext4 jfs xfs swap + ;; This is for the Hurd + ext2 ;; These lack basic Unix features. Their only use ;; on GNU is for interoperation, e.g., with UEFI. fat32 fat16 ntfs) @@ -767,7 +770,11 @@ (define (run-partitioning-page) (define (run-page devices) (let* ((items `((entire . ,(G_ "Guided - using the entire disk")) - (entire-encrypted . ,(G_ "Guided - using the entire disk with encryption")) + ,@(if (target-hurd?) + '() + `((entire-encrypted + . + ,(G_ "Guided - using the entire disk with encryption")))) (manual . ,(G_ "Manual")))) (result (run-listbox-selection-page #:info-text (G_ "Please select a partitioning method.") diff --git a/gnu/installer/newt/services.scm b/gnu/installer/newt/services.scm index d1035b6524..848683e8c7 100644 --- a/gnu/installer/newt/services.scm +++ b/gnu/installer/newt/services.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018 Mathieu Othacehe ;;; Copyright © 2019, 2020 Ludovic Courtès -;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen +;;; Copyright © 2020, 2024 Janneke Nieuwenhuizen ;;; Copyright © 2021 Tobias Geerinckx-Rice ;;; Copyright © 2021 Leo Famulari ;;; @@ -26,6 +26,7 @@ (define-module (gnu installer newt services) #:use-module (gnu installer newt page) #:use-module (gnu installer newt utils) #:use-module (guix i18n) + #:use-module (guix utils) #:use-module (srfi srfi-34) #:use-module (srfi srfi-35) #:export (run-services-page)) @@ -33,11 +34,13 @@ (define-module (gnu installer newt services) (define (run-desktop-environments-cbt-page) "Run a page allowing the user to choose between various desktop environments." - (let ((items (filter desktop-system-service? %system-services))) + (let ((items (filter desktop-system-service? (%system-services)))) (run-checkbox-tree-page - #:info-text (G_ "Please select the desktop environment(s) you wish to \ + #:info-text (if (target-hurd?) + (G_ "Currently, none of these is available for the Hurd.") + (G_ "Please select the desktop environment(s) you wish to \ install. If you select multiple desktop environments here, you will be able \ -to choose from them later when you log in.") +to choose from them later when you log in.")) #:title (G_ "Desktop environment") #:items items #:selection (map system-service-recommended? items) @@ -51,7 +54,7 @@ (define (run-networking-cbt-page) "Run a page allowing the user to select networking services." (let ((items (filter (lambda (service) (eq? 'networking (system-service-type service))) - %system-services))) + (%system-services)))) (run-checkbox-tree-page #:info-text (G_ "You can now select networking services to run on your \ system.") @@ -69,7 +72,7 @@ (define (run-printing-services-cbt-page) (let ((items (filter (lambda (service) (eq? 'document (system-service-type service))) - %system-services))) + (%system-services)))) (run-checkbox-tree-page #:info-text (G_ "You can now select the CUPS printing service to run on your \ system.") @@ -88,7 +91,7 @@ (define (run-console-services-cbt-page) (let ((items (filter (lambda (service) (eq? 'administration (system-service-type service))) - %system-services))) + (%system-services)))) (run-checkbox-tree-page #:title (G_ "Console services") #:info-text (G_ "Select miscellaneous services to run on your \ @@ -103,7 +106,11 @@ (define (run-console-services-cbt-page) (define (run-network-management-page) "Run a page to select among several network management methods." - (let ((title (G_ "Network management"))) + (let ((title (G_ "Network management")) + (items (filter (lambda (service) + (eq? 'network-management + (system-service-type service))) + (%system-services)))) (run-listbox-selection-page #:title title #:info-text (G_ "Choose the method to manage network connections. @@ -112,10 +119,10 @@ (define (run-network-management-page) client may be enough for a server.") #:info-textbox-width 70 #:listbox-height 7 - #:listbox-items (filter (lambda (service) - (eq? 'network-management - (system-service-type service))) - %system-services) + #:listbox-items `(,@items + ,@(if (target-hurd?) + (list system-service-none) + '())) #:listbox-item->text (compose G_ system-service-name) #:sort-listbox-items? #f #:button-text (G_ "Exit") diff --git a/gnu/installer/parted.scm b/gnu/installer/parted.scm index b36b238d8b..e9a0cc36d0 100644 --- a/gnu/installer/parted.scm +++ b/gnu/installer/parted.scm @@ -152,7 +152,7 @@ (define-record-type* (crypt-password user-partition-crypt-password ; (default #f)) (fs-type user-partition-fs-type - (default 'ext4)) + (default (if (target-hurd?) 'ext2 'ext4))) (bootable? user-partition-bootable? (default #f)) (esp? user-partition-esp? @@ -228,6 +228,7 @@ (define (efi-installation?) (define (user-fs-type-name fs-type) "Return the name of FS-TYPE as specified by libparted." (case fs-type + ((ext2) "ext2") ((ext4) "ext4") ((btrfs) "btrfs") ((fat16) "fat16") @@ -240,6 +241,7 @@ (define (user-fs-type-name fs-type) (define (user-fs-type->mount-type fs-type) "Return the mount type of FS-TYPE." (case fs-type + ((ext2) "ext2") ((ext4) "ext4") ((btrfs) "btrfs") ((fat16) "vfat") @@ -255,6 +257,7 @@ (define (partition-filesystem-user-type partition) (and fs-type (let ((name (filesystem-type-name fs-type))) (cond + ((string=? name "ext2") 'ext2) ((string=? name "ext4") 'ext4) ((string=? name "btrfs") 'btrfs) ((string=? name "fat16") 'fat16) @@ -296,7 +299,7 @@ (define (partition->user-partition partition) (file-name (partition-get-path partition)) (disk-file-name (device-path device)) (fs-type (or (partition-filesystem-user-type partition) - 'ext4)) + (if (target-hurd?) 'ext2 'ext4))) (mount-point (and (esp-partition? partition) (default-esp-mount-point))) (bootable? (boot-partition? partition)) @@ -1053,7 +1056,7 @@ (define* (auto-partition! disk (size new-esp-size) (mount-point (default-esp-mount-point)))) (user-partition - (fs-type 'ext4) + (fs-type (if (target-hurd?) 'ext2 'ext4)) (bootable? #t) (bios-grub? #t) (size bios-grub-size)))) @@ -1065,13 +1068,13 @@ (define* (auto-partition! disk `(,@(if start-partition `(,start-partition) '()) - ,@(if encrypted? + ,@(if (or encrypted? (target-hurd?)) '() `(,(user-partition (fs-type 'swap) (size swap-size)))) ,(user-partition - (fs-type 'ext4) + (fs-type (if (target-hurd?) 'ext2 'ext4)) (bootable? has-extended?) (crypt-label (and encrypted? "cryptroot")) (size "100%") @@ -1083,7 +1086,7 @@ (define* (auto-partition! disk `(,start-partition) '()) ,(user-partition - (fs-type 'ext4) + (fs-type (if (target-hurd?) 'ext2 'ext4)) (bootable? has-extended?) (crypt-label (and encrypted? "cryptroot")) (size "33%") @@ -1105,7 +1108,7 @@ (define* (auto-partition! disk (type (if has-extended? 'logical 'normal)) - (fs-type 'ext4) + (fs-type (if (target-hurd?) 'ext2 'ext4)) (crypt-label (and encrypted? "crypthome")) (size "100%") (mount-point "/home"))))))) @@ -1186,6 +1189,15 @@ (define (create-btrfs-file-system partition) "Create a btrfs file-system for PARTITION file-name." ((%run-command-in-installer) "mkfs.btrfs" "-f" partition)) +(define (create-ext2-file-system partition) + "Create an ext2 file-system for PARTITION file-name, when TARGET-HURD?, +for the Hurd." + (apply (%run-command-in-installer) + `("mkfs.ext2" ,@(if (target-hurd?) + '("-o" "hurd") + '()) + "-F" ,partition))) + (define (create-ext4-file-system partition) "Create an ext4 file-system for PARTITION file-name." ;; Enable the 'large_dir' feature so users can have a store of several TiBs. @@ -1291,6 +1303,10 @@ (define (format-user-partitions user-partitions) (and need-formatting? (not (eq? type 'extended)) (create-btrfs-file-system file-name))) + ((ext2) + (and need-formatting? + (not (eq? type 'extended)) + (create-ext2-file-system file-name))) ((ext4) (and need-formatting? (not (eq? type 'extended)) @@ -1463,7 +1479,11 @@ (define (bootloader-configuration user-partitions) "Return the bootloader configuration field for USER-PARTITIONS." (let ((root-partition (find root-user-partition? user-partitions))) (match user-partitions - (() '()) + (() (if (target-hurd?) + '(bootloader-configuration + (bootloader grub-minimal-bootloader) + (targets "/dev/sdaX")) + '())) (_ (let ((root-partition-disk (user-partition-disk-file-name root-partition))) @@ -1471,7 +1491,9 @@ (define (bootloader-configuration user-partitions) ,@(if (efi-installation?) `((bootloader grub-efi-bootloader) (targets (list ,(default-esp-mount-point)))) - `((bootloader grub-bootloader) + `((bootloader ,(if (target-hurd?) + 'grub-minimal-bootloader + 'grub-bootloader)) (targets (list ,root-partition-disk)))) ;; XXX: Assume we defined the 'keyboard-layout' field of @@ -1491,22 +1513,28 @@ (define (user-partition-missing-modules user-partitions) (const '()))) (delete-duplicates (map user-partition-file-name - (cons root devices))))))) + (filter identity + (cons root devices)))))))) (define (initrd-configuration user-partitions) "Return an 'initrd-modules' field with everything needed for USER-PARTITIONS, or return nothing." - (match (user-partition-missing-modules user-partitions) - (() - '()) - ((modules ...) - `((initrd-modules (append ',modules - %base-initrd-modules)))))) + (if (target-hurd?) + '((initrd #f) + (initrd-modules '())) + (match (user-partition-missing-modules user-partitions) + (() + '()) + ((modules ...) + `((initrd-modules (append ',modules + %base-initrd-modules))))))) (define (user-partitions->configuration user-partitions) "Return the configuration field for USER-PARTITIONS." (let* ((swap-user-partitions (find-swap-user-partitions user-partitions)) - (swap-devices (map user-partition-file-name swap-user-partitions)) + (swap-devices (if (target-hurd?) + '() + (map user-partition-file-name swap-user-partitions))) (encrypted-partitions (filter user-partition-crypt-label user-partitions))) `((bootloader ,@(bootloader-configuration user-partitions)) diff --git a/gnu/installer/record.scm b/gnu/installer/record.scm index 334af44a0c..22adad279c 100644 --- a/gnu/installer/record.scm +++ b/gnu/installer/record.scm @@ -30,6 +30,7 @@ (define-module (gnu installer record) installer-exit installer-exit-error installer-final-page + installer-kernel-page installer-keymap-page installer-locale-page installer-menu-page @@ -69,6 +70,8 @@ (define-record-type* (exit-error installer-exit-error) ;; procedure void -> void (final-page installer-final-page) + ;; procedure void -> void + (kernel-page installer-kernel-page) ;; procedure (layouts context) -> (list layout variant options) (keymap-page installer-keymap-page) ;; procedure: (#:key supported-locales iso639-languages iso3166-territories) diff --git a/gnu/installer/services.scm b/gnu/installer/services.scm index 1cb9dc579c..d5a382606c 100644 --- a/gnu/installer/services.scm +++ b/gnu/installer/services.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018 Mathieu Othacehe ;;; Copyright © 2019, 2022 Ludovic Courtès -;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen +;;; Copyright © 2020, 2024 Janneke Nieuwenhuizen ;;; Copyright © 2021 Tobias Geerinckx-Rice ;;; Copyright © 2021 Leo Famulari ;;; Copyright © 2023 Denys Nykula @@ -24,6 +24,7 @@ (define-module (gnu installer services) #:use-module (guix records) #:use-module (guix read-print) + #:use-module (guix utils) #:use-module (ice-9 match) #:use-module (srfi srfi-1) #:export (system-service? @@ -34,6 +35,7 @@ (define-module (gnu installer services) system-service-packages desktop-system-service? + system-service-none %system-services system-services->configuration)) @@ -55,7 +57,13 @@ (define-record-type* (packages system-service-packages ;list of sexps (default '()))) -(define %system-services +(define system-service-none + (system-service + (name (G_ "None")) + (type 'network-management) + (snippet '()))) + +(define (%system-services) (let-syntax ((desktop-environment (syntax-rules () ((_ fields ...) (system-service @@ -105,7 +113,11 @@ (define %system-services (G_ "\ ;; To configure OpenSSH, pass an 'openssh-configuration' ;; record as a second argument to 'service' below.\n")) - (service openssh-service-type)))) + ,(if (target-hurd?) + '(service openssh-service-type + (openssh-configuration + (openssh openssh-sans-x))) + '(service openssh-service-type))))) (system-service (name (G_ "Tor anonymous network router")) (type 'networking) @@ -115,7 +127,7 @@ (define %system-services (system-service (name (G_ "Network time service (NTP), to set the clock automatically")) (type 'administration) - (recommended? #t) + (recommended? (not (target-hurd?))) (snippet '((service ntp-service-type)))) (system-service (name (G_ "GPM mouse daemon, to use the mouse on the console")) @@ -154,8 +166,12 @@ (define (system-services->configuration services) (packages (append-map system-service-packages services)) (desktop? (find desktop-system-service? services)) (base (if desktop? - '%desktop-services - '%base-services)) + (if (target-hurd?) + '%desktop-services/hurd + '%desktop-services) + (if (target-hurd?) + '%base-services/hurd + '%base-services))) (native-console-font (match (getenv "LANGUAGE") ((or "be" "bg" "el" "eo" "kk" "ky" "mk" "mn" "ru" "sr" "tg" "uk") @@ -181,18 +197,28 @@ (define (system-services->configuration services) (if (null? snippets) `(,@(if (null? packages) - '() + (if (target-hurd?) + `(,@package-heading + (packages %base-packages/hurd)) + '()) `(,@package-heading (packages (append (list ,@packages) - %base-packages)))) + ,(if (target-hurd?) + '%base-packages/hurd + '%base-packages))))) ,@service-heading (services ,services)) `(,@(if (null? packages) - '() + (if (target-hurd?) + `(,@package-heading + (packages %base-packages/hurd)) + '()) `(,@package-heading (packages (append (list ,@packages) - %base-packages)))) + ,(if (target-hurd?) + '%base-packages/hurd + '%base-packages))))) ,@service-heading (services (append (list ,@snippets diff --git a/gnu/installer/steps.scm b/gnu/installer/steps.scm index de0a852f02..34dd14c9d5 100644 --- a/gnu/installer/steps.scm +++ b/gnu/installer/steps.scm @@ -23,6 +23,7 @@ (define-module (gnu installer steps) #:use-module (guix build utils) #:use-module (guix i18n) #:use-module (guix read-print) + #:use-module (guix utils) #:use-module (gnu installer utils) #:use-module (ice-9 match) #:use-module (srfi srfi-1) @@ -240,17 +241,20 @@ (define (format-configuration steps results) ,(comment (G_ "\ ;; Indicate which modules to import to access the variables ;; used in this configuration.\n")) - (use-modules (gnu)) + ,@(if (target-hurd?) + '((use-modules (gnu) (gnu system hurd)) + (use-package-modules hurd ssh)) + '((use-modules (gnu)))) (use-service-modules cups desktop networking ssh xorg)))) `(,@modules ,(vertical-space 1) (operating-system ,@configuration)))) (define* (configuration->file configuration - #:key (filename (%installer-configuration-file))) - "Write the given CONFIGURATION to FILENAME." - (mkdir-p (dirname filename)) - (call-with-output-file filename + #:key (file-name (%installer-configuration-file))) + "Write the given CONFIGURATION to FILE-NAME." + (mkdir-p (dirname file-name)) + (call-with-output-file file-name (lambda (port) ;; TRANSLATORS: This is a comment within a Scheme file. Each line must ;; start with ";; " (two semicolons and a space). Please keep line diff --git a/gnu/local.mk b/gnu/local.mk index 6d0c20f5be..8d35272bc8 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -859,6 +859,7 @@ INSTALLER_MODULES = \ %D%/installer/final.scm \ %D%/installer/hardware.scm \ %D%/installer/hostname.scm \ + %D%/installer/kernel.scm \ %D%/installer/keymap.scm \ %D%/installer/locale.scm \ %D%/installer/newt.scm \ @@ -877,6 +878,7 @@ INSTALLER_MODULES = \ %D%/installer/newt/final.scm \ %D%/installer/newt/parameters.scm \ %D%/installer/newt/hostname.scm \ + %D%/installer/newt/kernel.scm \ %D%/installer/newt/keymap.scm \ %D%/installer/newt/locale.scm \ %D%/installer/newt/menu.scm \ diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm index 283bae6f10..9a351529e8 100644 --- a/gnu/system/hurd.scm +++ b/gnu/system/hurd.scm @@ -48,6 +48,7 @@ (define-module (gnu system hurd) #:export (%base-packages/hurd %base-services/hurd %base-services+qemu-networking/hurd + %desktop-services/hurd %hurd-default-operating-system %hurd-default-operating-system-kernel %setuid-programs/hurd)) @@ -107,6 +108,8 @@ (define %base-services+qemu-networking/hurd %qemu-static-networking)) %base-services/hurd)) +(define %desktop-services/hurd %base-services/hurd) + (define %setuid-programs/hurd ;; Default set of setuid-root programs. (map file-like->setuid-program -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 21 04:18:23 2024 Received: (at 73927) by debbugs.gnu.org; 21 Oct 2024 08:18:23 +0000 Received: from localhost ([127.0.0.1]:50043 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2ncN-0003iE-4N for submit@debbugs.gnu.org; Mon, 21 Oct 2024 04:18:23 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36428) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2ncB-0003gA-5n for 73927@debbugs.gnu.org; Mon, 21 Oct 2024 04:18:11 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t2nbf-0003UF-Lb; Mon, 21 Oct 2024 04:17:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=UD0FCWC596sW0UY4a+ZDml1YISyYWhbrNqPqCxOOTZc=; b=jYl/1++HaL2ndP6wfaAs Bh3vqYFB6Zbz3CVsUofnu4iRFO+/nl99siAF7dYK238R1TOObuYWI+DeOhYyQXXFxrSJncYaabmht zBfWajI1eHiQHML25egl1h3I/HZElotEA9i4Dgtk2whhJPM3pbUJZMjoS+z+3f4rFD3hkcI/by3Kr PB4OePEyY0NLsZW8HZHtSknNdxnFCFQW1UN6+oGoqAy77PgaX+VL4XO1I7qTb3eAAY6UV8glCc8ia xyQwn/66BvtLcQ3fxJ0TkOvVcwCizEEP26iiqEo7jHDlumXxnGqwrZI9t94xicKdbn5Iu6IB8rXTh d0w9oZimvGkS0g==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH 16/16] DRAFT installer: Support dry-run from Guile via store. Date: Mon, 21 Oct 2024 10:17:12 +0200 Message-ID: <623ba69960b842b24ec321b155ea722221c75ea8.1729494414.git.janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Josselin Poiret , Ludovic Courtès , Mathieu Othacehe Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) This supports running the installer quasi-directly from Guile by only building a Guile installer-script in the store. Do something like: ./pre-inst-env guile -c '((@ (gnu installer) run-installer) #:dry-run? #t)' sudo -E ./pre-inst-env guile -c '((@ (gnu installer) run-installer))' * gnu/installer.scm (installer-script, run-installer): New procedures. Change-Id: I8cc1746845ec99f738e35fa91bb2342a674cfa88 --- gnu/installer.scm | 84 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 82 insertions(+), 2 deletions(-) diff --git a/gnu/installer.scm b/gnu/installer.scm index 64f6273c55..617578665e 100644 --- a/gnu/installer.scm +++ b/gnu/installer.scm @@ -21,10 +21,14 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu installer) + #:use-module (guix build utils) + #:use-module (guix derivations) #:use-module (guix discovery) - #:use-module (guix packages) #:use-module (guix gexp) #:use-module (guix modules) + #:use-module (guix monads) + #:use-module (guix packages) + #:use-module (guix store) #:use-module (guix utils) #:use-module (guix ui) #:use-module ((guix self) #:select (make-config.scm)) @@ -56,7 +60,9 @@ (define-module (gnu installer) #:use-module (ice-9 match) #:use-module (srfi srfi-1) #:use-module (web uri) - #:export (installer-program)) + #:export (installer-program + installer-steps + run-installer)) (define module-to-import? ;; Return true for modules that should be imported. For (gnu system …) and @@ -562,3 +568,77 @@ (define* (installer-program #:key dry-run?) (execl #$(program-file "installer-real" installer-builder #:guile guile-3.0-latest) "installer-real")))) + +(define* (installer-script #:key dry-run? + (steps (installer-steps #:dry-run? dry-run?))) + (program-file + "installer-script" + #~(begin + (use-modules (gnu installer) + (gnu installer record) + (gnu installer keymap) + (gnu installer steps) + (gnu installer dump) + (gnu installer final) + (gnu installer hostname) + (gnu installer kernel) + (gnu installer locale) + (gnu installer parted) + (gnu installer services) + (gnu installer timezone) + (gnu installer user) + (gnu installer utils) + (gnu installer newt) + ((gnu installer newt keymap) + #:select (keyboard-layout->configuration)) + (gnu services herd) + (guix i18n) + (guix build utils) + (guix utils) + ((system repl debug) + #:select (terminal-width)) + (ice-9 match) + (ice-9 textual-ports)) + (terminal-width 200) + (let* ((current-installer newt-installer) + (steps (#$steps current-installer))) + (catch #t + (lambda _ + ((installer-init current-installer)) + (parameterize ((%run-command-in-installer + (if #$dry-run? + dry-run-command + (installer-run-command current-installer))) + (%installer-configuration-file + (if #$dry-run? + "config.scm" + (%installer-configuration-file)))) + (let ((results (run-installer-steps + #:rewind-strategy 'menu + #:menu-proc + (installer-menu-page current-installer) + #:steps steps + #:dry-run? #$dry-run?))) + (result-step results 'final)))) + (const #f) + (lambda (key . args) + (sleep 10) + ((installer-exit current-installer)) + (display-backtrace (make-stack #t) (current-error-port)) + (apply throw key args))))))) + +(define* (run-installer #:key dry-run?) + "To run the installer from Guile without building it: + ./pre-inst-env guile -c '((@ (gnu installer) run-installer) #:dry-run? #t)' +when using #:dry-run? #t, no root access is required and the LOCALE, KEYMAP, +and PARTITION pages are skipped." + (let* ((script (installer-script #:dry-run? dry-run?)) + (store (open-connection)) + (drv (run-with-store store + (lower-object script))) + (program (match (derivation->output-paths drv) + ((("out" . program)) program))) + (outputs (build-derivations store (list drv)))) + (close-connection store) + (format #t "running installer: ~a\n" program) + (invoke "./pre-inst-env" "guile" program))) -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 21 14:15:06 2024 Received: (at 73927) by debbugs.gnu.org; 21 Oct 2024 18:15:06 +0000 Received: from localhost ([127.0.0.1]:53296 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2wvq-0006hT-Es for submit@debbugs.gnu.org; Mon, 21 Oct 2024 14:15:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42814) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2wvo-0006gU-2p for 73927@debbugs.gnu.org; Mon, 21 Oct 2024 14:15:04 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t2wvH-0000S5-JB; Mon, 21 Oct 2024 14:14:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=FRL6OkiIHRMCvfsjGVUnuylpLVJWToUle8X9lBC3+y4=; b=Ym+tGqWFCZHEWVtjaqmZ XVHXvpBfV7vXaJM9wcmFyg86YakcyGRAuz9XOnCVUqRYUnFXs+TRcJhfxj+ZXdc9MCCknNFkGohJv 2ewLzhUYdhC09RNrh+GkXzNuCSkeA5O0V5WWRgFUX2PWHvdJ/NLzNVTg4aPKErQ2FE8f5bJ4Pz8fN C4ZSJTnNfSGmkMHW8+ryGDITShW04ZPC8ExoKUli10UcfIUa3qJ3b4Y6sopiNEU/UpqU3JmtCZaGY JLzkKfuwYvi7rVPXk/9Rj9WEd8hdmWG1jjXtm9gNPY93Hjpshtoh2PK+f/6cYyxO1YSY/NjlWbGmi 7+LyNX+aqpdVOQ==; From: Mathieu Othacehe To: Janneke Nieuwenhuizen Subject: Re: [bug#73927] [PATCH 14/16] installer: Add "Kernel" page to select the Hurd. In-Reply-To: (Janneke Nieuwenhuizen's message of "Mon, 21 Oct 2024 10:17:10 +0200") References: Date: Mon, 21 Oct 2024 20:14:24 +0200 Message-ID: <87ttd5cohr.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 Cc: 73927@debbugs.gnu.org, Josselin Poiret , Ludovic =?utf-8?Q?Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hello Janneke, Really great to see that extension to the installer :) The installer patches look OK to me, I will try to test them on real hardware soon. > Change-Id: I15d535a7a8a917e5f3492f8c01d922d652c32ee5 > > geert none > > Change-Id: Ib6c5665638018f59a2690f603fad0702e042fb8b > > Change-Id: I01b854390240be60ce9fef8c9510a90bc6843ef3 > > geert > > Change-Id: Ibb7205443969fc92d4fe62d4dfb4f956d03229b9 ^ Maybe something to cleanup? > + ;; Ask the user to select the kernel for the system, > + ;; for x86 systems only. > + (installer-step > + (id 'kernel) > + (description (G_ "Kernel")) > + (compute (lambda _ > + (if (target-x86?) > + ((installer-kernel-page current-installer)) > + '()))) > + (configuration-formatter (lambda (result) > + (kernel->configuration result #$dry-run?)))) > + If I remember correctly, new installer steps require some adaptations in the (gnu installer tests) module. Is make check-system TESTS="gui-installed-os" working correctly? Thanks, Mathieu From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 21 14:18:46 2024 Received: (at 73927) by debbugs.gnu.org; 21 Oct 2024 18:18:46 +0000 Received: from localhost ([127.0.0.1]:53311 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2wzO-0006tb-Fu for submit@debbugs.gnu.org; Mon, 21 Oct 2024 14:18:46 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33352) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2wzM-0006tO-6k for 73927@debbugs.gnu.org; Mon, 21 Oct 2024 14:18:44 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t2wyo-0000rG-4n; Mon, 21 Oct 2024 14:18:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=QsQJAKf/n9pJ245ovfLp5bvo+w4U9NN+BXMusAs5uTY=; b=Xc/+j3VAN1+4xbLeGhJd dz8DcKXhbq5LXNUZAGpsgGZipSsYG3kRw4oSlqXSkeX6hoqVN4ERWQRz+Oep3Hqv3w/D+UNsTUPVv pRUsAxsOoNvOnQXOAZLJZGpd7Dz35Iy9XsZ+O8ES1HtUvt4nQ5L7QpOGvjRBmpRyTtGQ5QViVUsRN d1x/AjpSOcsVxEPbtV/8r4UA2S0h5q9m74wx578RcQpWZCxgOX5LTdPNy+pa5Y7+F+nTId71dKwBy KgCAbLNF9w42m9vtezVzOli79VvKw+gtSYqRHyTo4pGoWv2ypLqy3zXkPp7DVE0OeWxGFr/F0vn8u 34V3/TDhfQ3wbQ==; From: Mathieu Othacehe To: Janneke Nieuwenhuizen Subject: Re: [bug#73927] [PATCH 16/16] DRAFT installer: Support dry-run from Guile via store. In-Reply-To: <623ba69960b842b24ec321b155ea722221c75ea8.1729494414.git.janneke@gnu.org> (Janneke Nieuwenhuizen's message of "Mon, 21 Oct 2024 10:17:12 +0200") References: <623ba69960b842b24ec321b155ea722221c75ea8.1729494414.git.janneke@gnu.org> Date: Mon, 21 Oct 2024 20:18:07 +0200 Message-ID: <87plntcobk.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 Cc: 73927@debbugs.gnu.org, Josselin Poiret , Ludovic =?utf-8?Q?Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hello, > This supports running the installer quasi-directly from Guile by only building > a Guile installer-script in the store. Do something like: > > ./pre-inst-env guile -c '((@ (gnu installer) run-installer) #:dry-run? #t)' > > sudo -E ./pre-inst-env guile -c '((@ (gnu installer) run-installer))' I remember resorting to a similar hack, back in 2018 when writing the installer. Maybe we should go the extra mile and integrate that one to a proper guix command, such as `guix system installer` that would call `run-installer` with dry-run set to #t. WDYT? Thanks, Mathieu From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 22 04:22:13 2024 Received: (at 73927) by debbugs.gnu.org; 22 Oct 2024 08:22:13 +0000 Received: from localhost ([127.0.0.1]:54535 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t3A9c-0005IJ-QV for submit@debbugs.gnu.org; Tue, 22 Oct 2024 04:22:13 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49768) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t3A9Z-0005I1-9M for 73927@debbugs.gnu.org; Tue, 22 Oct 2024 04:22:11 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t3A90-00089R-K7; Tue, 22 Oct 2024 04:21:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=1SiLJfeIaJxibwbi1zXObmLyaxGCFl8iRIj/DsvtnPk=; b=WmqLzkPPOjotNaEtXZr7 6TVQXp4EU8XimPknKnw5Vo8vjcLaR2zxsRtyDSq1sRrksaagKI1yQo8W6kBlRy4XBUEuQEobS5ClL dXPGFS9GcVInQcJZiHRjfQK6YxArIxoKRirnZnP86fR/3oDyI2XpaXTEaw5pQFEDOcAzCm9VF6o7I /IStvngjRnYVWmHs7oXNOQYTJSI+w5v63UHOVTP3Y6kCh8D7mPK+OyxNsYp+NixuVbBl3hGcdu7+b FtjK5kDZGQ/NCZl07U7GT3D9OHOWVbMglOOO4J+HGiH2Q5pgjG4qaGeNV4x1PPD/LevimnKq2XTlI TLr6PnG2XI6iLQ==; From: To: Mathieu Othacehe Subject: Re: [bug#73927] [PATCH 16/16] DRAFT installer: Support dry-run from Guile via store. In-Reply-To: <87plntcobk.fsf@gnu.org> (Mathieu Othacehe's message of "Mon, 21 Oct 2024 20:18:07 +0200") Organization: AvatarAcademy.nl References: <623ba69960b842b24ec321b155ea722221c75ea8.1729494414.git.janneke@gnu.org> <87plntcobk.fsf@gnu.org> X-Url: http://AvatarAcademy.nl Date: Tue, 22 Oct 2024 10:21:29 +0200 Message-ID: <87y12gczue.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 Cc: 73927@debbugs.gnu.org, Josselin Poiret , Ludovic =?utf-8?Q?Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Mathieu Othacehe writes: Hello Mathieu, >> This supports running the installer quasi-directly from Guile by only bu= ilding >> a Guile installer-script in the store. Do something like: >> >> ./pre-inst-env guile -c '((@ (gnu installer) run-installer) #:dry-ru= n? #t)' >> >> sudo -E ./pre-inst-env guile -c '((@ (gnu installer) run-installer))' > > I remember resorting to a similar hack, back in 2018 when writing the > installer. Maybe we should go the extra mile and integrate that one to a > proper guix command, such as `guix system installer` that would call > `run-installer` with dry-run set to #t. WDYT? Sure, sounds nice, and being able to run it with dry-run? #f is also nice but I guess that would be doable :) So you also don't see a way to move the installer-steps list out of the gexp without adding the extra dependencies? Greetings, Janneke --=20 Janneke Nieuwenhuizen | GNU LilyPond https://LilyPond.org Freelance IT https://www.JoyOfSource.com | Avatar=C2=AE https://AvatarAcade= my.com From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 22 04:54:03 2024 Received: (at 73927) by debbugs.gnu.org; 22 Oct 2024 08:54:03 +0000 Received: from localhost ([127.0.0.1]:54612 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t3AeQ-0006n9-Pm for submit@debbugs.gnu.org; Tue, 22 Oct 2024 04:54:03 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37140) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t3AeN-0006md-T5 for 73927@debbugs.gnu.org; Tue, 22 Oct 2024 04:54:02 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t3Adp-0003Q5-Sg; Tue, 22 Oct 2024 04:53:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=yKqiDQqKtLjsgBwvmAfGn8eX4iZTJiKIMjUvkyRM+j0=; b=SG7FOf4tWs7RrHXtY0aM gfVydw0wmKrPknLa9n5JUH3bWfCTTvBPnE4eH8GEPRl5xdv+511fLuRiihp3ErdnDsQmNXA/lZ/8X jOf0065PhBwPgXdGZLZW+i15svIlPhXp0+IK1s/tPo6p5k9WIN7BOGci0/sv3tBQfGDycmMbBxIRQ qlAWGw6U3hK7Uf6idJfzPhBKigrcatVKcjllDl828+gs8w3ZQIAoVOzlVhYVEJvmsyV6vmes37ZPD U2x3E6LmoaM/uihKt2PqLPtVoUhcSf4MFwsHsVjXZWy++qHkb6+MAq6LbEVGIDtHGRCr4A7xtIJ9u CRXvX6CLaWoHtA==; From: To: Mathieu Othacehe Subject: Re: [bug#73927] [PATCH 14/16] installer: Add "Kernel" page to select the Hurd. In-Reply-To: <87ttd5cohr.fsf@gnu.org> (Mathieu Othacehe's message of "Mon, 21 Oct 2024 20:14:24 +0200") Organization: AvatarAcademy.nl References: <87ttd5cohr.fsf@gnu.org> X-Url: http://AvatarAcademy.nl Date: Tue, 22 Oct 2024 10:53:21 +0200 Message-ID: <87v7xkcyda.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 Cc: 73927@debbugs.gnu.org, Josselin Poiret , Ludovic =?utf-8?Q?Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Mathieu Othacehe writes: Hello Mathieu, > Really great to see that extension to the installer :) Thanks! > The installer patches look OK to me, I will try to test them > on real hardware soon. >> Change-Id: I15d535a7a8a917e5f3492f8c01d922d652c32ee5 >> >> geert none >> >> Change-Id: Ib6c5665638018f59a2690f603fad0702e042fb8b >> >> Change-Id: I01b854390240be60ce9fef8c9510a90bc6843ef3 >> >> geert >> >> Change-Id: Ibb7205443969fc92d4fe62d4dfb4f956d03229b9 > > ^ > Maybe something to cleanup? Oops, sorry :) Cleaned it up locally. >> + ;; Ask the user to select the kernel for the system, >> + ;; for x86 systems only. >> + (installer-step >> + (id 'kernel) >> + (description (G_ "Kernel")) >> + (compute (lambda _ >> + (if (target-x86?) >> + ((installer-kernel-page current-installer)) >> + '()))) >> + (configuration-formatter (lambda (result) >> + (kernel->configuration result #$dr= y-run?)))) >> + > > If I remember correctly, new installer steps require some adaptations in > the (gnu installer tests) module. > > Is make check-system TESTS=3D"gui-installed-os" working correctly? Ah, right; that fails. I'll look into it, thanks for the pointer. Where are the .ppm files saved/how do I get at them? Greetings, Janneke --=20 Janneke Nieuwenhuizen | GNU LilyPond https://LilyPond.org Freelance IT https://www.JoyOfSource.com | Avatar=C2=AE https://AvatarAcade= my.com From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 22 10:34:50 2024 Received: (at 73927) by debbugs.gnu.org; 22 Oct 2024 14:34:50 +0000 Received: from localhost ([127.0.0.1]:56855 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t3FyE-0006aI-4L for submit@debbugs.gnu.org; Tue, 22 Oct 2024 10:34:50 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45582) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t3Fy9-0006a0-UH for 73927@debbugs.gnu.org; Tue, 22 Oct 2024 10:34:47 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t3Fxb-0007h5-6N; Tue, 22 Oct 2024 10:34:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=Nz2URt+C0WWVoxsTlpoOk6nlgUk7eQ5V0m/IBdDF5Fg=; b=A1KBtPOuIPw4sq5Ig3dY 1ckOq55l59z4156Ojg2sivFmKnPj1IPQSidHZ02hXfChAKERycxbhlWQAvHHL1HdKD7xFnJL5JSvL DfrahCsBtE4oPv2VNYy4ivd+kSehfixI9i9dk+ubv+5yI8B172EnAZVP6noSQ6sipvnP/YeqILlfO iSwd+7RgmxHt4SFzugKwhaC7HpDoLChimevZfWi+Fn296ChnA2MdGDzXkaetIS9RJKlwDpUvjFmVR f+u3wSORFlCzCqoHnrQresvjoz4nCTBYHwE8jFbvF8dEIYZFmfzOAcWD/gIrWpbCVK9TuZfEJ9fFW nfMLCMz45JrrUw==; From: To: Mathieu Othacehe Subject: Re: [bug#73927] [PATCH 14/16] installer: Add "Kernel" page to select the Hurd. In-Reply-To: <87v7xkcyda.fsf@gnu.org> (janneke@gnu.org's message of "Tue, 22 Oct 2024 10:53:21 +0200") Organization: AvatarAcademy.nl References: <87ttd5cohr.fsf@gnu.org> <87v7xkcyda.fsf@gnu.org> X-Url: http://AvatarAcademy.nl Date: Tue, 22 Oct 2024 16:34:06 +0200 Message-ID: <87ldygcild.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 Cc: 73927@debbugs.gnu.org, Josselin Poiret , Ludovic =?utf-8?Q?Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain Hi, >> The installer patches look OK to me, I will try to test them >> on real hardware soon. Just a heads-up: While I'm pretty sure that the the config.scm is OK (if you don't select any options, use static networking and fill in your IP and gateway), I haven't had any luck yet installing it. The guile-fibers for the hurd does currently (?) not cross-build from 32 bit, i.e. guix build guile-fibers --target=i586-pc-gnu --system=i686-linux fails, and I had no luck with a 64bit machine, getting i/o errors while running guix init. No idea which device fails on me there. > Ah, right; that fails. I'll look into it, thanks for the pointer. > Where are the .ppm files saved/how do I get at them? Hmm, I could use some help here. I tried the almost trivial patch attached, but that fails and it's not clear to my why. Possibly I don't understand the code because it seems to me that the screenshot names go out of sync after the locale page. Also, the roundtrip time to test something out is pretty bad... Greetings, Janneke --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-squash-installer-Add-Kernel-page-to-select-the-Hurd.patch Content-Transfer-Encoding: quoted-printable >From 22d12407d3b291318b76ac167d22104cc2852a85 Mon Sep 17 00:00:00 2001 Message-ID: <22d12407d3b291318b76ac167d22104cc2852a85.1729607385.git.jannek= e@gnu.org> From: Janneke Nieuwenhuizen Date: Tue, 22 Oct 2024 11:00:59 +0200 Subject: [PATCH] squash! installer: Add "Kernel" page to select the Hurd. * gnu/installer/tests.scm (choose-kernel): New procedure. * gnu/tests/install.scm (gui-test-program): Use it. --- gnu/installer/tests.scm | 11 +++++++++++ gnu/tests/install.scm | 5 ++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/gnu/installer/tests.scm b/gnu/installer/tests.scm index 8785cd9a9f..a9a5d5d988 100644 --- a/gnu/installer/tests.scm +++ b/gnu/installer/tests.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2020 Ludovic Court=C3=A8s ;;; Copyright =C2=A9 2020 Mathieu Othacehe +;;; Copyright =C2=A9 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -35,6 +36,7 @@ (define-module (gnu installer tests) =20 choose-locale+keyboard enter-host-name+passwords + choose-kernel choose-services choose-partitioning start-installation @@ -211,6 +213,15 @@ (define* (enter-host-name+passwords port (password ,password))) names passwords)))))) =20 +(define* (choose-kernel port #:key (kernel "Linux Libre")) + "Converse over PORT with the guided installer to choose the specified +KERNEL." + (converse port + ((list-selection (title "Kernel") + (multiple-choices? #f) + (items _)) + kernel))) + (define* (choose-services port #:key (choose-desktop-environment? (const #f)) diff --git a/gnu/tests/install.scm b/gnu/tests/install.scm index 36dbd9111f..6be582373d 100644 --- a/gnu/tests/install.scm +++ b/gnu/tests/install.scm @@ -3,7 +3,7 @@ ;;; Copyright =C2=A9 2017, 2019, 2021 Tobias Geerinckx-Rice ;;; Copyright =C2=A9 2020 Mathieu Othacehe ;;; Copyright =C2=A9 2020 Danny Milosavljevic -;;; Copyright =C2=A9 2020 Jan (janneke) Nieuwenhuizen +;;; Copyright =C2=A9 2020, 2024 Janneke Nieuwenhuizen ;;; Copyright =C2=A9 2020, 2021, 2022 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. @@ -1869,6 +1869,9 @@ (define* (gui-test-program marionette #$marionette) (screenshot "installer-services.ppm") =20 + (marionette-eval* '(choose-kernel installer-socket) #$marionette) + (screenshot "installer-kernel.ppm") + (marionette-eval* '(choose-services installer-socket #:choose-desktop-environment? (const #$desktop?) base-commit: 80f8ef0a01f2cf39deebfecc344e5f04d87d4bd4 --=20 2.46.0 --=-=-= Content-Type: application/octet-stream Content-Disposition: attachment; filename=fail-with-kernel-page-fix.log Content-Transfer-Encoding: base64 T2N0IDIyIDExOjIwOjE5IGxvY2FsaG9zdCBpbnN0YWxsZXJbMTk0XTogcnVubmluZyBzdGVwICd3 ZWxjb21lJyANDQpPY3QgMjIgMTE6MjA6MTkgbG9jYWxob3N0IGluc3RhbGxlclsxOTRdOiBydW5u aW5nIGZvcm0gIzxuZXd0LWZvcm0gMWQyM2M0YzA+ICgiR05VIEd1aXggaW5zdGFsbCIpIHdpdGgg MSBjbGllbnRzIA0NCk9jdCAyMiAxMToyMDoxOSBsb2NhbGhvc3QgaW5zdGFsbGVyWzE5NF06IGZv cm0gIzxuZXd0LWZvcm0gMWQyM2M0YzA+ICgiR05VIEd1aXggaW5zdGFsbCIpOiBjbGllbnQgMjAg cmVwbGllZCAiR3JhcGhpY2FsIGluc3RhbGwgdXNpbmcgYSB0ZXJtaW5hbCBiYXNlZCBpbnRlcmZh Y2UiIA0NCk9jdCAyMiAxMToyMDoyMCBsb2NhbGhvc3QgaW5zdGFsbGVyWzE5NF06IHJ1bm5pbmcg c3RlcCAndGltZXpvbmUnIA0NCmNvbnZlcnNhdGlvbiBleHBlY3RpbmcgcGF0dGVybiAoKHF1b3Rl IGxpc3Qtc2VsZWN0aW9uKSAoKHF1b3RlIHRpdGxlKSAiVGltZXpvbmUiKSAoKHF1b3RlIG11bHRp cGxlLWNob2ljZXM/KSAjZikgKChxdW90ZSBpdGVtcykgXykpT2N0IDIyIDExOjIwOjIwIGxvY2Fs aG9zdCBpbnN0YWxsZXJbMTk0XTogcnVubmluZyBmb3JtICM8bmV3dC1mb3JtIDFkMjNhYjUwPiAo IlRpbWV6b25lIikgd2l0aCAxIGNsaWVudHMgDQ0KT2N0IDIyIDExOjIwOjIwIGxvY2FsaG9zdCBp bnN0YWxsZXJbMTk0XTogZm9ybSAjPG5ld3QtZm9ybSAxZDIzYWI1MD4gKCJUaW1lem9uZSIpOiBj bGllbnQgMjAgcmVwbGllZCAiRXVyb3BlIiANDQoNCk9jdCAyMiAxMToyMDoyMCBsb2NhbGhvc3Qg aW5zdGFsbGVyWzE5NF06IHJ1bm5pbmcgZm9ybSAjPG5ld3QtZm9ybSAxZDIzMzJmMD4gKCJUaW1l em9uZSIpIHdpdGggMSBjbGllbnRzIA0NCmNvbnZlcnNhdGlvbiBleHBlY3RpbmcgcGF0dGVybk9j dCAyMiAxMToyMDoyMCBsb2NhbGhvc3QgaW5zdGFsbGVyWzE5NF06IGZvcm0gIzxuZXd0LWZvcm0g MWQyMzMyZjA+ICgiVGltZXpvbmUiKTogY2xpZW50IDIwIHJlcGxpZWQgIlphZ3JlYiIgDQ0KT2N0 IDIyIDExOjIwOjIwIGxvY2FsaG9zdCBpbnN0YWxsZXJbMTk0XTogcnVubmluZyBzdGVwICdrZXlt YXAnIA0NCiAoKHF1b3RlIGxpc3Qtc2VsZWN0aW9uKSAoKHF1b3RlIHRpdGxlKSAiTGF5b3V0Iikg KChxdW90ZSBtdWx0aXBsZS1jaG9pY2VzPykgI2YpICgocXVvdGUgaXRlbXMpIF8pKQ0KT2N0IDIy IDExOjIwOjIxIGxvY2FsaG9zdCBpbnN0YWxsZXJbMTk0XTogcnVubmluZyBzdGVwICdsYXlvdXQn IA0NCk9jdCAyMiAxMToyMDoyMSBsb2NhbGhvc3QgaW5zdGFsbGVyWzE5NF06IHJ1bm5pbmcgZm9y bSAjPG5ld3QtZm9ybSAxZDIzMjlmMD4gKCJMYXlvdXQiKSB3aXRoIDEgY2xpZW50cyANDQpjb252 ZXJzYXRpb24gZXhwZWN0aW5nIHBhdHRlcm4gKChxdW90ZSBsaXN0LXNlbGVjdGlvbikgKChxdW90 ZSB0aXRsZSkgIlZhcmlhbnQiKSAoKHF1b3RlIG11bHRpcGxlLWNob2ljZXM/KSAjZikgKChxdW90 ZSBpdGVtcykgXykpT2N0IDIyIDExOjIwOjIxIGxvY2FsaG9zdCBpbnN0YWxsZXJbMTk0XTogZm9y bSAjPG5ld3QtZm9ybSAxZDIzMjlmMD4gKCJMYXlvdXQiKTogY2xpZW50IDIwIHJlcGxpZWQgIkVu Z2xpc2ggKFVTKSIgDQ0KT2N0IDIyIDExOjIwOjIxIGxvY2FsaG9zdCBpbnN0YWxsZXJbMTk0XTog cnVubmluZyBzdGVwICd2YXJpYW50JyANDQoNCk9jdCAyMiAxMToyMDoyMSBsb2NhbGhvc3QgaW5z dGFsbGVyWzE5NF06IHJ1bm5pbmcgZm9ybSAjPG5ld3QtZm9ybSAxZDIzMjg5MD4gKCJWYXJpYW50 Iikgd2l0aCAxIGNsaWVudHMgDQ0KT2N0IDIyIDExOjIwOjIxIGxvY2FsaG9zdCBpbnN0YWxsZXJb MTk0XTogZm9ybSAjPG5ld3QtZm9ybSAxZDIzMjg5MD4gKCJWYXJpYW50Iik6IGNsaWVudCAyMCBy ZXBsaWVkICJFbmdsaXNoIChpbnRsLiwgd2l0aCBBbHRHciBkZWFkIGtleXMpIiANDQpjb252ZXJz YXRpb24gZXhwZWN0aW5nIHBhdHRlcm4gKChxdW90ZSBpbnB1dCkgKChxdW90ZSB0aXRsZSkgIkhv c3RuYW1lIikgKChxdW90ZSB0ZXh0KSBfKSAoKHF1b3RlIGRlZmF1bHQpIF8pKQ0KY29udmVyc2F0 aW9uIGV4cGVjdGluZyBwYXR0ZU9jdCAyMiAxMToyMDoyMSBsb2NhbGhvc3QgaW5zdGFsbGVyWzE5 NF06IHJ1bm5pbmcgc3RlcCAnaG9zdG5hbWUnIA0NCk9jdCAyMiAxMToyMDoyMSBsb2NhbGhvc3Qg aW5zdGFsbGVyWzE5NF06IHJ1bm5pbmcgZm9ybSAjPG5ld3QtZm9ybSAxZDIzNGY2MD4gKCJIb3N0 bmFtZSIpIHdpdGggMSBjbGllbnRzIA0NCnJuICgocXVvdGUgaW5wdXQpICgocXVvdGUgdGl0bGUp ICJTeXN0ZW0gYWRtaW5pc3RyYXRvciBwYXNzd29yZCIpICgocXVvdGUgdGV4dCkgXykgKChxdW90 ZSBkZWZhdWx0KSBfKSlPY3QgMjIgMTE6MjA6MjEgbG9jYWxob3N0IGluc3RhbGxlclsxOTRdOiBm b3JtICM8bmV3dC1mb3JtIDFkMjM0ZjYwPiAoIkhvc3RuYW1lIik6IGNsaWVudCAyMCByZXBsaWVk ICJsaWJlcmlnaWxvIiANDQoNCk9jdCAyMiAxMToyMDoyMSBsb2NhbGhvc3QgaW5zdGFsbGVyWzE5 NF06IHJ1bm5pbmcgc3RlcCAna2VybmVsJyANDQpPY3QgMjIgMTE6MjA6MjEgbG9jYWxob3N0IGlu c3RhbGxlclsxOTRdOiBydW5uaW5nIGZvcm0gIzxuZXd0LWZvcm0gMWQyM2E4ZjA+ICgiS2VybmVs Iikgd2l0aCAxIGNsaWVudHMgDQ0Kc2hlcGhlcmQ6IFNlcnZpY2UgdXNlci1ob21lcyBoYXMgYmVl biBzdGFydGVkLg0Kc2hlcGhlcmQ6IFN0YXJ0aW5nIHNlcnZpY2UgdGVybS10dHkxLi4uDQpzaGVw aGVyZDogU2VydmljZSB0ZXJtLXR0eTEgc3RhcnRlZC4NCnNoZXBoZXJkOiBTZXJ2aWNlIHRlcm0t dHR5MSBydW5uaW5nIHdpdGggdmFsdWUgMTc3Lg0KaWNlLTkvZXZhbC5zY206MTU5Ojk6IEVSUk9S Og0KICAxLiAmcGF0dGVybi1ub3QtbWF0Y2hlZDoNCiAgICAgIHBhdHRlcm46ICgocXVvdGUgaW5w dXQpICgocXVvdGUgdGl0bGUpICJTeXN0ZW0gYWRtaW5pc3RyYXRvciBwYXNzd29yZCIpICgocXVv dGUgdGV4dCkgXykgKChxdW90ZSBkZWZhdWx0KSBfKSkNCiAgICAgIHNleHA6IChsaXN0LXNlbGVj dGlvbiAodGl0bGUgIktlcm5lbCIpIChtdWx0aXBsZS1jaG9pY2VzPyAjZikgKGl0ZW1zICgiSHVy ZCIgIkxpbnV4IExpYnJlIikpKQ0KQmFja3RyYWNlOgogICAgICAgICAgIDIgKHByaW1pdGl2ZS1s b2FkICIvZ251L3N0b3JlLzlnYTN2OTRjenluZGg2N3FmeHg5cjB6Y3l3Zz8iKQpJbiBpY2UtOS9l dmFsLnNjbToKICAgMTkxOjM1ICAxIChfICNmKQogICAgNjE5OjggIDAgKF8gIygjPGRpcmVjdG9y eSAoZ3VpbGUtdXNlcikgN2ZmZmY3ODUwYzgwPiAjPHZhcmlhYmw/PikpCgppY2UtOS9ldmFsLnNj bTo2MTk6ODogVGhyb3cgdG8ga2V5IGBtYXJpb25ldHRlLWV2YWwtZmFpbHVyZScgd2l0aCBhcmdz IGAoKHF1b3RlIChlbnRlci1ob3N0LW5hbWUrcGFzc3dvcmRzIGluc3RhbGxlci1zb2NrZXQgIzpo b3N0LW5hbWUgImxpYmVyaWdpbG8iICM6cm9vdC1wYXNzd29yZCAiZm9vIiAjOnVzZXJzIChxdW90 ZSAoKCJhbGljZSIgInBhc3MxIikgKCJib2IiICJwYXNzMiIpKSkpKSknLgo= --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable --=20 Janneke Nieuwenhuizen | GNU LilyPond https://LilyPond.org Freelance IT https://www.JoyOfSource.com | Avatar=C2=AE https://AvatarAcade= my.com --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 22 14:06:55 2024 Received: (at 73927) by debbugs.gnu.org; 22 Oct 2024 18:06:55 +0000 Received: from localhost ([127.0.0.1]:57184 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t3JHT-0007rB-84 for submit@debbugs.gnu.org; Tue, 22 Oct 2024 14:06:55 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60770) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t3JHR-0007qy-BR for 73927@debbugs.gnu.org; Tue, 22 Oct 2024 14:06:54 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t3JGs-0007PB-LN; Tue, 22 Oct 2024 14:06:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=uqucd26YOd7ea4j6OiV83qvimS9PPOGN2wAwYE6UWEQ=; b=VMGbeLLNXubUPhOo8DgA hyrgAbelYG4n0WF/Q+TpP97uGIbIeHfoh5Hd7gQypTWH/cDQ/cjZ/yoorGLe09sY+xmEN9QkwMvZk x0JJDpMrhIfDFlgum17fJ47fKL8n5s3pNbVMs7d7r2tanXmYKDW0QHd6mHGH6S7P+3jsM7Bu7xmzN Lr8vPUi0SrJyA/t5XPq+Qn6kAHobmp4nzmBeCaith9bqtHKh2b1l5w4PjEK3X+wgPVD5DQRuqf999 mtwSM238iIfTQ6/3INz+R8O0DGNFVxNLs02baehwQSI2Jhus63Ki3n3lbfMWG8a7Ox5vZlEqyp8u9 lYffVJtqLAnujw==; From: Mathieu Othacehe To: Subject: Re: [bug#73927] [PATCH 14/16] installer: Add "Kernel" page to select the Hurd. In-Reply-To: <87ldygcild.fsf@gnu.org> (janneke@gnu.org's message of "Tue, 22 Oct 2024 16:34:06 +0200") References: <87ttd5cohr.fsf@gnu.org> <87v7xkcyda.fsf@gnu.org> <87ldygcild.fsf@gnu.org> Date: Tue, 22 Oct 2024 20:06:01 +0200 Message-ID: <87sesoovw6.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 Cc: 73927@debbugs.gnu.org, Josselin Poiret , Ludovic =?utf-8?Q?Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hey, > Hmm, I could use some help here. I tried the almost trivial patch > attached, but that fails and it's not clear to my why. Possibly I don't > understand the code because it seems to me that the screenshot names > go out of sync after the locale page. Also, the roundtrip time to test > something out is pretty bad... The ppm stuff is just about keeping screenshots around to debug any test failures. According to the log that you sent, I would say that the issue is a mismatch between the installation step that is expected by the marionette and the actual installation step: --8<---------------cut here---------------start------------->8--- pattern: ((quote input) ((quote title) "System administrator password") ((quote text) _) ((quote default) _)). sexp: (list-selection (title "Kernel") (multiple-choices? #f) (items ("Hurd" "Linux Libre"))). --8<---------------cut here---------------end--------------->8--- The system administrator password page is expected but the kernel selection page is sent. It seems that you have chosen to display the Kernel selection page between the host-name page and the network selection page. I guess that by moving the Kernel step here: --8<---------------cut here---------------start------------->8--- ;; Prompt for users (name, group and home directory). (installer-step (id 'user) (description (G_ "User creation")) (compute (lambda _ ((installer-user-page current-installer)))) (configuration-formatter users->configuration)) -> Kernel step ;; Ask the user to choose one or many desktop environment(s). (installer-step (id 'services) (description (G_ "Services")) (compute (lambda _ ((installer-services-page current-installer)))) (configuration-formatter system-services->configuration)) --8<---------------cut here---------------end--------------->8--- the test would match with the actual installation step. Hope that will help, Thanks, Mathieu From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 22 15:19:23 2024 Received: (at 73927) by debbugs.gnu.org; 22 Oct 2024 19:19:23 +0000 Received: from localhost ([127.0.0.1]:57536 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t3KPZ-0003Dq-9n for submit@debbugs.gnu.org; Tue, 22 Oct 2024 15:19:23 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35340) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t3KPV-0003Dc-PI for 73927@debbugs.gnu.org; Tue, 22 Oct 2024 15:19:19 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t3KOw-0007as-0S; Tue, 22 Oct 2024 15:18:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=C9ggdLXnZp4vhghCOSBhEIIvSMTxBGTKzjfS2KEzh8g=; b=FEWf5XbTm/53j8CyZ9CZ 9NBWvMou7kUkNBkO3rhW6xTCBG6jYJkVIZ8Iv2D/Ks3rCRAJE9PLxVtDD/H8tqlOyUwRvS676oxwn DlODbL4Mmujj9x9h2MJav4LDVDIEGuypwbwdUlaBpo9kn/GVD8XyBlCuPvCN2xup+SxXAOyy3FtvV NLlD7Yt1cBp3Bb9ma6gqdptamkPx9AyMRPkouTmpewS4Wdt6mKxTWt5Dv07WyetosF43vpw+XzmGS 9NRRGRoCulPdzeQ1Imbr8o0XeKsi7DR3ZgHJpCXjbHaGFN2fq7erBKHs3X3L8wS4vJGHEgnmySkgh 6/22OCBUPMcItA==; From: To: Mathieu Othacehe Subject: [PATCH v2 14/16] installer: Add "Kernel" page to select the Hurd. In-Reply-To: <87sesoovw6.fsf@gnu.org> (Mathieu Othacehe's message of "Tue, 22 Oct 2024 20:06:01 +0200") Organization: AvatarAcademy.nl References: <87ttd5cohr.fsf@gnu.org> <87v7xkcyda.fsf@gnu.org> <87ldygcild.fsf@gnu.org> <87sesoovw6.fsf@gnu.org> X-Url: http://AvatarAcademy.nl Date: Tue, 22 Oct 2024 21:18:32 +0200 Message-ID: <874j54c5fb.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 Cc: 73927@debbugs.gnu.org, Josselin Poiret , Ludovic =?utf-8?Q?Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain Mathieu Othacehe writes: Hi, > The ppm stuff is just about keeping screenshots around to debug any test > failures. Ok. In any case we can see about that later. > According to the log that you sent, I would say that the issue > is a mismatch between the installation step that is expected by the > marionette and the actual installation step: > > pattern: ((quote input) ((quote title) "System administrator password") ((quote text) _) ((quote default) _)). > sexp: (list-selection (title "Kernel") (multiple-choices? #f) (items ("Hurd" "Linux Libre"))). > > > The system administrator password page is expected but the kernel > selection page is sent. Ah, the test combines host-name and users together, makes sense. Kind of obvious when you see it :) > It seems that you have chosen to display the Kernel selection page > between the host-name page and the network selection page. I guess that > by moving the Kernel step here: > > ;; Prompt for users (name, group and home directory). > (installer-step > (id 'user) > (description (G_ "User creation")) > (compute (lambda _ > ((installer-user-page current-installer)))) > (configuration-formatter users->configuration)) > > -> Kernel step > > ;; Ask the user to choose one or many desktop environment(s). > (installer-step > (id 'services) > (description (G_ "Services")) > (compute (lambda _ > ((installer-services-page current-installer)))) > (configuration-formatter system-services->configuration)) > > the test would match with the actual installation step. Good call. > Hope that will help, It does thanks; test passed! --8<---------------cut here---------------start------------->8--- make check-system TESTS="gui-installed-os" ... successfully built /gnu/store/68yvz94hgnicavcps2i96wpddsygq9fz-gui-installed-os.drv /gnu/store/84n7zjm5l41m279i72cfp7z0cxa9h20p-gui-installed-os --8<---------------cut here---------------end--------------->8--- Find v2 attached; as only this patch has changed. Greetings, Janneke --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=v2-0014-installer-Add-Kernel-page-to-select-the-Hurd.patch Content-Transfer-Encoding: quoted-printable >From e6bd56aa544deb45764baf3138668849aab2b86b Mon Sep 17 00:00:00 2001 Message-ID: In-Reply-To: <1fbb300ade6667d5390dbe1a2e8e82ff4af7d1a0.1729624171.git.janne= ke@gnu.org> References: <1fbb300ade6667d5390dbe1a2e8e82ff4af7d1a0.1729624171.git.jannek= e@gnu.org> From: Janneke Nieuwenhuizen Date: Sun, 20 Oct 2024 15:13:16 +0200 Subject: [PATCH v2 14/16] installer: Add "Kernel" page to select the Hurd. This adds a "Kernel" page to the installer with the option to (cross-) inst= all the Hurd, if applicable (only available on x86 machines for now). * gnu/installer/newt.scm (kernel-page): New procedure. (newt-installer)[kernel-page]: New field. * gnu/installer/kernel.scm, gnu/installer/newt/kernel.scm: New files. * gnu/local.mk (INSTALLER_MODULES): Add them. * gnu/installer.scm (installer-steps): Use them to select kernel if applicable. * gnu/installer/newt/partition.scm (run-fs-type-page): Add ext2 for the hur= d. (run-partitioning-page-partition): Remove `entire-encrypted' option when installing the Hurd. * gnu/installer/services.scm (system-services->configuration): Cater for the Hurd with %base-services/hurd, and with %base-packages/hurd that must always be set. (%system-services): Change to procedure. When installing the the Hurd, do = not recommend `ntp-service-type' and USE `openssh-sans-x' package for `openssh-service-type'. (system-service-none): New variable. * gnu/installer/newt/services.scm (run-network-management-page): Include it when installing the Hurd. (run-desktop-environments-cbt-page): When installing the Hurd, recommend to not select any desktop enviroment. Update users. * gnu/installer/parted.scm (create-ext2-file-system): New procedure. (user-fs-type-name, user-fs-type->mount-type, partition-filesystem-user-typ= e, format-user-partitions): Support `ext2'. ( partition->user-partition): Use `ext2' when installing the Hurd. (auto-partition!): Likewise. No swap partition when installing the Hurd. * gnu/installer/final.scm (install-system): Cater for cross installation of the Hurd. (bootloader-configuration): Use `grub-minimal-bootloader' when installing t= he Hurd. (user-partition-missing-modules): Cater for empty user-partitions. (initrd-configuration, user-partitions->configuration): Cater for the Hurd. * gnu/installer/steps.scm (format-configuration, configuration->file): Cater for the Hurd. * gnu/system/hurd.scm (%desktop-services/hurd): New variable. * gnu/installer/tests.scm (choose-kernel): New procedure. * gnu/tests/install.scm (gui-test-program): Use it. Change-Id: Ifafb27b8a2f933944c77223a27ec151757237e36 --- gnu/installer.scm | 14 ++++++++ gnu/installer/final.scm | 10 ++++-- gnu/installer/kernel.scm | 34 ++++++++++++++++++ gnu/installer/newt.scm | 5 +++ gnu/installer/newt/kernel.scm | 45 +++++++++++++++++++++++ gnu/installer/newt/partition.scm | 9 ++++- gnu/installer/newt/services.scm | 31 +++++++++------- gnu/installer/parted.scm | 62 +++++++++++++++++++++++--------- gnu/installer/record.scm | 3 ++ gnu/installer/services.scm | 46 ++++++++++++++++++------ gnu/installer/steps.scm | 14 +++++--- gnu/installer/tests.scm | 11 ++++++ gnu/local.mk | 2 ++ gnu/system/hurd.scm | 3 ++ gnu/tests/install.scm | 5 ++- 15 files changed, 246 insertions(+), 48 deletions(-) create mode 100644 gnu/installer/kernel.scm create mode 100644 gnu/installer/newt/kernel.scm diff --git a/gnu/installer.scm b/gnu/installer.scm index 39a83c4455..31c0ff7ff4 100644 --- a/gnu/installer.scm +++ b/gnu/installer.scm @@ -308,6 +308,18 @@ (define* (installer-steps #:key dry-run?) ((installer-user-page current-installer)))) (configuration-formatter users->configuration)) =20 + ;; Ask the user to select the kernel for the system, + ;; for x86 systems only. + (installer-step + (id 'kernel) + (description (G_ "Kernel")) + (compute (lambda _ + (if (target-x86?) + ((installer-kernel-page current-installer)) + '()))) + (configuration-formatter (lambda (result) + (kernel->configuration result #$dry-r= un?)))) + ;; Ask the user to choose one or many desktop environment(s). (installer-step (id 'services) @@ -419,6 +431,7 @@ (define* (installer-program #:key dry-run?) (gnu installer dump) (gnu installer final) (gnu installer hostname) + (gnu installer kernel) (gnu installer locale) (gnu installer parted) (gnu installer services) @@ -431,6 +444,7 @@ (define* (installer-program #:key dry-run?) (gnu services herd) (guix i18n) (guix build utils) + (guix utils) ((system repl debug) #:select (terminal-width)) (ice-9 match) diff --git a/gnu/installer/final.scm b/gnu/installer/final.scm index 069426a3b8..5fcf223315 100644 --- a/gnu/installer/final.scm +++ b/gnu/installer/final.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2018, 2020 Mathieu Othacehe ;;; Copyright =C2=A9 2019, 2020, 2022 Ludovic Court=C3=A8s +;;; Copyright =C2=A9 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -25,6 +26,7 @@ (define-module (gnu installer final) #:use-module (gnu services herd) #:use-module (guix build syscalls) #:use-module (guix build utils) + #:use-module (guix utils) #:use-module (gnu build accounts) #:use-module (gnu build install) #:use-module (gnu build linux-container) @@ -164,8 +166,12 @@ (define* (install-system locale #:key (users '())) "/tmp/installer-system-init-options" read)) (const '()))) - (install-command (append (list "guix" "system" "init" - "--fallback") + (install-command (append `( "guix" "system" "init" + "--fallback" + ,@(if (target-hurd?) + '("--target=3Di586-pc-gnu" + "--skip-checks") + '())) options (list (%installer-configuration-file) (%installer-target-dir)))) diff --git a/gnu/installer/kernel.scm b/gnu/installer/kernel.scm new file mode 100644 index 0000000000..059659ec75 --- /dev/null +++ b/gnu/installer/kernel.scm @@ -0,0 +1,34 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2024 Janneke Nieuwenhuizen +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu installer kernel) + #:use-module (gnu system hurd) + #:export (kernel->configuration)) + +(define (kernel->configuration kernel dry-run?) + (if (equal? kernel "Hurd") + `((kernel %hurd-default-operating-system-kernel) + (kernel-arguments '("noide")) + (firmware '()) + (hurd hurd) + (locale-libcs (list glibc/hurd)) + (name-service-switch #f) + (essential-services (hurd-default-essential-services this-operatin= g-system)) + (privileged-programs '()) + (setuid-programs %setuid-programs/hurd)) + '())) diff --git a/gnu/installer/newt.scm b/gnu/installer/newt.scm index d53bc058b3..1fe710340f 100644 --- a/gnu/installer/newt.scm +++ b/gnu/installer/newt.scm @@ -25,6 +25,7 @@ (define-module (gnu installer newt) #:use-module (gnu installer newt final) #:use-module (gnu installer newt parameters) #:use-module (gnu installer newt hostname) + #:use-module (gnu installer newt kernel) #:use-module (gnu installer newt keymap) #:use-module (gnu installer newt locale) #:use-module (gnu installer newt menu) @@ -193,6 +194,9 @@ (define (substitutes-page) (define (hostname-page) (run-hostname-page)) =20 +(define (kernel-page) + (run-kernel-page)) + (define (user-page) (run-user-page)) =20 @@ -216,6 +220,7 @@ (define newt-installer (exit-error exit-error) (final-page final-page) (keymap-page keymap-page) + (kernel-page kernel-page) (locale-page locale-page) (menu-page menu-page) (network-page network-page) diff --git a/gnu/installer/newt/kernel.scm b/gnu/installer/newt/kernel.scm new file mode 100644 index 0000000000..3117247312 --- /dev/null +++ b/gnu/installer/newt/kernel.scm @@ -0,0 +1,45 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2024 Janneke Nieuwenhuizen +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu installer newt kernel) + #:use-module (gnu installer newt page) + #:use-module (guix i18n) + #:use-module (guix utils) + #:export (run-kernel-page)) + +(define (run-kernel-page) + (let* ((kernels `(,@(if (target-x86?) '("Hurd") '()) + "Linux Libre")) + (result + (run-listbox-selection-page + #:title (G_ "Kernel") + #:info-text + (G_ "Please select a kernel. When in doubt, choose \"Linux Lib= re\". +The Hurd is offered as a technology preview and development aid; many pack= ages \ +are not yet available in Guix, such as a desktop environment or even a win= dowing \ +system (X, Wayland).") + #:listbox-items kernels + #:listbox-item->text identity + #:listbox-default-item "Linux Libre" + #:button-text (G_ "Back") + #:button-callback-procedure + (lambda _ + (abort-to-prompt 'installer-step 'abort))))) + (when (equal? result "Hurd") + (%current-target-system "i586-pc-gnu")) + result)) diff --git a/gnu/installer/newt/partition.scm b/gnu/installer/newt/partitio= n.scm index 48dd306080..b88393405b 100644 --- a/gnu/installer/newt/partition.scm +++ b/gnu/installer/newt/partition.scm @@ -26,6 +26,7 @@ (define-module (gnu installer newt partition) #:use-module (gnu installer newt page) #:use-module (gnu installer newt utils) #:use-module (guix i18n) + #:use-module (guix utils) #:use-module (ice-9 format) #:use-module (ice-9 match) #:use-module (srfi srfi-1) @@ -147,6 +148,8 @@ (define (run-fs-type-page) #:title (G_ "File-system type") #:listbox-items '(btrfs ext4 jfs xfs swap + ;; This is for the Hurd + ext2 ;; These lack basic Unix features. Their only = use ;; on GNU is for interoperation, e.g., with UEF= I. fat32 fat16 ntfs) @@ -767,7 +770,11 @@ (define (run-partitioning-page) (define (run-page devices) (let* ((items `((entire . ,(G_ "Guided - using the entire disk")) - (entire-encrypted . ,(G_ "Guided - using the entire disk wit= h encryption")) + ,@(if (target-hurd?) + '() + `((entire-encrypted + . + ,(G_ "Guided - using the entire disk with encryptio= n")))) (manual . ,(G_ "Manual")))) (result (run-listbox-selection-page #:info-text (G_ "Please select a partitioning method.") diff --git a/gnu/installer/newt/services.scm b/gnu/installer/newt/services.= scm index d1035b6524..848683e8c7 100644 --- a/gnu/installer/newt/services.scm +++ b/gnu/installer/newt/services.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2018 Mathieu Othacehe ;;; Copyright =C2=A9 2019, 2020 Ludovic Court=C3=A8s -;;; Copyright =C2=A9 2020 Jan (janneke) Nieuwenhuizen +;;; Copyright =C2=A9 2020, 2024 Janneke Nieuwenhuizen ;;; Copyright =C2=A9 2021 Tobias Geerinckx-Rice ;;; Copyright =C2=A9 2021 Leo Famulari ;;; @@ -26,6 +26,7 @@ (define-module (gnu installer newt services) #:use-module (gnu installer newt page) #:use-module (gnu installer newt utils) #:use-module (guix i18n) + #:use-module (guix utils) #:use-module (srfi srfi-34) #:use-module (srfi srfi-35) #:export (run-services-page)) @@ -33,11 +34,13 @@ (define-module (gnu installer newt services) (define (run-desktop-environments-cbt-page) "Run a page allowing the user to choose between various desktop environments." - (let ((items (filter desktop-system-service? %system-services))) + (let ((items (filter desktop-system-service? (%system-services)))) (run-checkbox-tree-page - #:info-text (G_ "Please select the desktop environment(s) you wish to= \ + #:info-text (if (target-hurd?) + (G_ "Currently, none of these is available for the Hu= rd.") + (G_ "Please select the desktop environment(s) you wis= h to \ install. If you select multiple desktop environments here, you will be ab= le \ -to choose from them later when you log in.") +to choose from them later when you log in.")) #:title (G_ "Desktop environment") #:items items #:selection (map system-service-recommended? items) @@ -51,7 +54,7 @@ (define (run-networking-cbt-page) "Run a page allowing the user to select networking services." (let ((items (filter (lambda (service) (eq? 'networking (system-service-type service))) - %system-services))) + (%system-services)))) (run-checkbox-tree-page #:info-text (G_ "You can now select networking services to run on you= r \ system.") @@ -69,7 +72,7 @@ (define (run-printing-services-cbt-page) (let ((items (filter (lambda (service) (eq? 'document (system-service-type service))) - %system-services))) + (%system-services)))) (run-checkbox-tree-page #:info-text (G_ "You can now select the CUPS printing service to run = on your \ system.") @@ -88,7 +91,7 @@ (define (run-console-services-cbt-page) (let ((items (filter (lambda (service) (eq? 'administration (system-service-type service))) - %system-services))) + (%system-services)))) (run-checkbox-tree-page #:title (G_ "Console services") #:info-text (G_ "Select miscellaneous services to run on your \ @@ -103,7 +106,11 @@ (define (run-console-services-cbt-page) =20 (define (run-network-management-page) "Run a page to select among several network management methods." - (let ((title (G_ "Network management"))) + (let ((title (G_ "Network management")) + (items (filter (lambda (service) + (eq? 'network-management + (system-service-type service))) + (%system-services)))) (run-listbox-selection-page #:title title #:info-text (G_ "Choose the method to manage network connections. @@ -112,10 +119,10 @@ (define (run-network-management-page) client may be enough for a server.") #:info-textbox-width 70 #:listbox-height 7 - #:listbox-items (filter (lambda (service) - (eq? 'network-management - (system-service-type service))) - %system-services) + #:listbox-items `(,@items + ,@(if (target-hurd?) + (list system-service-none) + '())) #:listbox-item->text (compose G_ system-service-name) #:sort-listbox-items? #f #:button-text (G_ "Exit") diff --git a/gnu/installer/parted.scm b/gnu/installer/parted.scm index b36b238d8b..e9a0cc36d0 100644 --- a/gnu/installer/parted.scm +++ b/gnu/installer/parted.scm @@ -152,7 +152,7 @@ (define-record-type* (crypt-password user-partition-crypt-password ; (default #f)) (fs-type user-partition-fs-type - (default 'ext4)) + (default (if (target-hurd?) 'ext2 'ext4))) (bootable? user-partition-bootable? (default #f)) (esp? user-partition-esp? @@ -228,6 +228,7 @@ (define (efi-installation?) (define (user-fs-type-name fs-type) "Return the name of FS-TYPE as specified by libparted." (case fs-type + ((ext2) "ext2") ((ext4) "ext4") ((btrfs) "btrfs") ((fat16) "fat16") @@ -240,6 +241,7 @@ (define (user-fs-type-name fs-type) (define (user-fs-type->mount-type fs-type) "Return the mount type of FS-TYPE." (case fs-type + ((ext2) "ext2") ((ext4) "ext4") ((btrfs) "btrfs") ((fat16) "vfat") @@ -255,6 +257,7 @@ (define (partition-filesystem-user-type partition) (and fs-type (let ((name (filesystem-type-name fs-type))) (cond + ((string=3D? name "ext2") 'ext2) ((string=3D? name "ext4") 'ext4) ((string=3D? name "btrfs") 'btrfs) ((string=3D? name "fat16") 'fat16) @@ -296,7 +299,7 @@ (define (partition->user-partition partition) (file-name (partition-get-path partition)) (disk-file-name (device-path device)) (fs-type (or (partition-filesystem-user-type partition) - 'ext4)) + (if (target-hurd?) 'ext2 'ext4))) (mount-point (and (esp-partition? partition) (default-esp-mount-point))) (bootable? (boot-partition? partition)) @@ -1053,7 +1056,7 @@ (define* (auto-partition! disk (size new-esp-size) (mount-point (default-esp-mount-point)))) (user-partition - (fs-type 'ext4) + (fs-type (if (target-hurd?) 'ext2 'ext4)) (bootable? #t) (bios-grub? #t) (size bios-grub-size)))) @@ -1065,13 +1068,13 @@ (define* (auto-partition! disk `(,@(if start-partition `(,start-partition) '()) - ,@(if encrypted? + ,@(if (or encrypted? (target-hurd?)) '() `(,(user-partition (fs-type 'swap) (size swap-size)))) ,(user-partition - (fs-type 'ext4) + (fs-type (if (target-hurd?) 'ext2 'ext4)) (bootable? has-extended?) (crypt-label (and encrypted? "cryptroot")) (size "100%") @@ -1083,7 +1086,7 @@ (define* (auto-partition! disk `(,start-partition) '()) ,(user-partition - (fs-type 'ext4) + (fs-type (if (target-hurd?) 'ext2 'ext4)) (bootable? has-extended?) (crypt-label (and encrypted? "cryptroot")) (size "33%") @@ -1105,7 +1108,7 @@ (define* (auto-partition! disk (type (if has-extended? 'logical 'normal)) - (fs-type 'ext4) + (fs-type (if (target-hurd?) 'ext2 'ext4)) (crypt-label (and encrypted? "crypthome")) (size "100%") (mount-point "/home"))))))) @@ -1186,6 +1189,15 @@ (define (create-btrfs-file-system partition) "Create a btrfs file-system for PARTITION file-name." ((%run-command-in-installer) "mkfs.btrfs" "-f" partition)) =20 +(define (create-ext2-file-system partition) + "Create an ext2 file-system for PARTITION file-name, when TARGET-HURD?, +for the Hurd." + (apply (%run-command-in-installer) + `("mkfs.ext2" ,@(if (target-hurd?) + '("-o" "hurd") + '()) + "-F" ,partition))) + (define (create-ext4-file-system partition) "Create an ext4 file-system for PARTITION file-name." ;; Enable the 'large_dir' feature so users can have a store of several T= iBs. @@ -1291,6 +1303,10 @@ (define (format-user-partitions user-partitions) (and need-formatting? (not (eq? type 'extended)) (create-btrfs-file-system file-name))) + ((ext2) + (and need-formatting? + (not (eq? type 'extended)) + (create-ext2-file-system file-name))) ((ext4) (and need-formatting? (not (eq? type 'extended)) @@ -1463,7 +1479,11 @@ (define (bootloader-configuration user-partitions) "Return the bootloader configuration field for USER-PARTITIONS." (let ((root-partition (find root-user-partition? user-partitions))) (match user-partitions - (() '()) + (() (if (target-hurd?) + '(bootloader-configuration + (bootloader grub-minimal-bootloader) + (targets "/dev/sdaX")) + '())) (_ (let ((root-partition-disk (user-partition-disk-file-name root-partition))) @@ -1471,7 +1491,9 @@ (define (bootloader-configuration user-partitions) ,@(if (efi-installation?) `((bootloader grub-efi-bootloader) (targets (list ,(default-esp-mount-point)))) - `((bootloader grub-bootloader) + `((bootloader ,(if (target-hurd?) + 'grub-minimal-bootloader + 'grub-bootloader)) (targets (list ,root-partition-disk)))) =20 ;; XXX: Assume we defined the 'keyboard-layout' field of @@ -1491,22 +1513,28 @@ (define (user-partition-missing-modules user-partit= ions) (const '()))) (delete-duplicates (map user-partition-file-name - (cons root devices))))))) + (filter identity + (cons root devices)))))))) =20 (define (initrd-configuration user-partitions) "Return an 'initrd-modules' field with everything needed for USER-PARTITIONS, or return nothing." - (match (user-partition-missing-modules user-partitions) - (() - '()) - ((modules ...) - `((initrd-modules (append ',modules - %base-initrd-modules)))))) + (if (target-hurd?) + '((initrd #f) + (initrd-modules '())) + (match (user-partition-missing-modules user-partitions) + (() + '()) + ((modules ...) + `((initrd-modules (append ',modules + %base-initrd-modules))))))) =20 (define (user-partitions->configuration user-partitions) "Return the configuration field for USER-PARTITIONS." (let* ((swap-user-partitions (find-swap-user-partitions user-partitions)) - (swap-devices (map user-partition-file-name swap-user-partitions)) + (swap-devices (if (target-hurd?) + '() + (map user-partition-file-name swap-user-partiti= ons))) (encrypted-partitions (filter user-partition-crypt-label user-partitions))) `((bootloader ,@(bootloader-configuration user-partitions)) diff --git a/gnu/installer/record.scm b/gnu/installer/record.scm index 334af44a0c..22adad279c 100644 --- a/gnu/installer/record.scm +++ b/gnu/installer/record.scm @@ -30,6 +30,7 @@ (define-module (gnu installer record) installer-exit installer-exit-error installer-final-page + installer-kernel-page installer-keymap-page installer-locale-page installer-menu-page @@ -69,6 +70,8 @@ (define-record-type* (exit-error installer-exit-error) ;; procedure void -> void (final-page installer-final-page) + ;; procedure void -> void + (kernel-page installer-kernel-page) ;; procedure (layouts context) -> (list layout variant options) (keymap-page installer-keymap-page) ;; procedure: (#:key supported-locales iso639-languages iso3166-territor= ies) diff --git a/gnu/installer/services.scm b/gnu/installer/services.scm index 1cb9dc579c..d5a382606c 100644 --- a/gnu/installer/services.scm +++ b/gnu/installer/services.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2018 Mathieu Othacehe ;;; Copyright =C2=A9 2019, 2022 Ludovic Court=C3=A8s -;;; Copyright =C2=A9 2020 Jan (janneke) Nieuwenhuizen +;;; Copyright =C2=A9 2020, 2024 Janneke Nieuwenhuizen ;;; Copyright =C2=A9 2021 Tobias Geerinckx-Rice ;;; Copyright =C2=A9 2021 Leo Famulari ;;; Copyright =C2=A9 2023 Denys Nykula @@ -24,6 +24,7 @@ (define-module (gnu installer services) #:use-module (guix records) #:use-module (guix read-print) + #:use-module (guix utils) #:use-module (ice-9 match) #:use-module (srfi srfi-1) #:export (system-service? @@ -34,6 +35,7 @@ (define-module (gnu installer services) system-service-packages =20 desktop-system-service? + system-service-none =20 %system-services system-services->configuration)) @@ -55,7 +57,13 @@ (define-record-type* (packages system-service-packages ;list of sexps (default '()))) =20 -(define %system-services +(define system-service-none + (system-service + (name (G_ "None")) + (type 'network-management) + (snippet '()))) + +(define (%system-services) (let-syntax ((desktop-environment (syntax-rules () ((_ fields ...) (system-service @@ -105,7 +113,11 @@ (define %system-services (G_ "\ ;; To configure OpenSSH, pass an 'openssh-configuration' ;; record as a second argument to 'service' below.\n")) - (service openssh-service-type)))) + ,(if (target-hurd?) + '(service openssh-service-type + (openssh-configuration + (openssh openssh-sans-x))) + '(service openssh-service-type))))) (system-service (name (G_ "Tor anonymous network router")) (type 'networking) @@ -115,7 +127,7 @@ (define %system-services (system-service (name (G_ "Network time service (NTP), to set the clock automatical= ly")) (type 'administration) - (recommended? #t) + (recommended? (not (target-hurd?))) (snippet '((service ntp-service-type)))) (system-service (name (G_ "GPM mouse daemon, to use the mouse on the console")) @@ -154,8 +166,12 @@ (define (system-services->configuration services) (packages (append-map system-service-packages services)) (desktop? (find desktop-system-service? services)) (base (if desktop? - '%desktop-services - '%base-services)) + (if (target-hurd?) + '%desktop-services/hurd + '%desktop-services) + (if (target-hurd?) + '%base-services/hurd + '%base-services))) (native-console-font (match (getenv "LANGUAGE") ((or "be" "bg" "el" "eo" "kk" "ky" "mk" "mn" "ru" "sr" "tg" "uk") @@ -181,18 +197,28 @@ (define (system-services->configuration services) =20 (if (null? snippets) `(,@(if (null? packages) - '() + (if (target-hurd?) + `(,@package-heading + (packages %base-packages/hurd)) + '()) `(,@package-heading (packages (append (list ,@packages) - %base-packages)))) + ,(if (target-hurd?) + '%base-packages/hurd + '%base-packages))))) =20 ,@service-heading (services ,services)) `(,@(if (null? packages) - '() + (if (target-hurd?) + `(,@package-heading + (packages %base-packages/hurd)) + '()) `(,@package-heading (packages (append (list ,@packages) - %base-packages)))) + ,(if (target-hurd?) + '%base-packages/hurd + '%base-packages))))) =20 ,@service-heading (services (append (list ,@snippets diff --git a/gnu/installer/steps.scm b/gnu/installer/steps.scm index de0a852f02..34dd14c9d5 100644 --- a/gnu/installer/steps.scm +++ b/gnu/installer/steps.scm @@ -23,6 +23,7 @@ (define-module (gnu installer steps) #:use-module (guix build utils) #:use-module (guix i18n) #:use-module (guix read-print) + #:use-module (guix utils) #:use-module (gnu installer utils) #:use-module (ice-9 match) #:use-module (srfi srfi-1) @@ -240,17 +241,20 @@ (define (format-configuration steps results) ,(comment (G_ "\ ;; Indicate which modules to import to access the variables ;; used in this configuration.\n")) - (use-modules (gnu)) + ,@(if (target-hurd?) + '((use-modules (gnu) (gnu system hurd)) + (use-package-modules hurd ssh)) + '((use-modules (gnu)))) (use-service-modules cups desktop networking ssh xorg))= )) `(,@modules ,(vertical-space 1) (operating-system ,@configuration)))) =20 (define* (configuration->file configuration - #:key (filename (%installer-configuration-fi= le))) - "Write the given CONFIGURATION to FILENAME." - (mkdir-p (dirname filename)) - (call-with-output-file filename + #:key (file-name (%installer-configuration-f= ile))) + "Write the given CONFIGURATION to FILE-NAME." + (mkdir-p (dirname file-name)) + (call-with-output-file file-name (lambda (port) ;; TRANSLATORS: This is a comment within a Scheme file. Each line m= ust ;; start with ";; " (two semicolons and a space). Please keep line diff --git a/gnu/installer/tests.scm b/gnu/installer/tests.scm index 8785cd9a9f..a9a5d5d988 100644 --- a/gnu/installer/tests.scm +++ b/gnu/installer/tests.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2020 Ludovic Court=C3=A8s ;;; Copyright =C2=A9 2020 Mathieu Othacehe +;;; Copyright =C2=A9 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -35,6 +36,7 @@ (define-module (gnu installer tests) =20 choose-locale+keyboard enter-host-name+passwords + choose-kernel choose-services choose-partitioning start-installation @@ -211,6 +213,15 @@ (define* (enter-host-name+passwords port (password ,password))) names passwords)))))) =20 +(define* (choose-kernel port #:key (kernel "Linux Libre")) + "Converse over PORT with the guided installer to choose the specified +KERNEL." + (converse port + ((list-selection (title "Kernel") + (multiple-choices? #f) + (items _)) + kernel))) + (define* (choose-services port #:key (choose-desktop-environment? (const #f)) diff --git a/gnu/local.mk b/gnu/local.mk index 6d0c20f5be..8d35272bc8 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -859,6 +859,7 @@ INSTALLER_MODULES =3D \ %D%/installer/final.scm \ %D%/installer/hardware.scm \ %D%/installer/hostname.scm \ + %D%/installer/kernel.scm \ %D%/installer/keymap.scm \ %D%/installer/locale.scm \ %D%/installer/newt.scm \ @@ -877,6 +878,7 @@ INSTALLER_MODULES =3D \ %D%/installer/newt/final.scm \ %D%/installer/newt/parameters.scm \ %D%/installer/newt/hostname.scm \ + %D%/installer/newt/kernel.scm \ %D%/installer/newt/keymap.scm \ %D%/installer/newt/locale.scm \ %D%/installer/newt/menu.scm \ diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm index 283bae6f10..9a351529e8 100644 --- a/gnu/system/hurd.scm +++ b/gnu/system/hurd.scm @@ -48,6 +48,7 @@ (define-module (gnu system hurd) #:export (%base-packages/hurd %base-services/hurd %base-services+qemu-networking/hurd + %desktop-services/hurd %hurd-default-operating-system %hurd-default-operating-system-kernel %setuid-programs/hurd)) @@ -107,6 +108,8 @@ (define %base-services+qemu-networking/hurd %qemu-static-networking)) %base-services/hurd)) =20 +(define %desktop-services/hurd %base-services/hurd) + (define %setuid-programs/hurd ;; Default set of setuid-root programs. (map file-like->setuid-program diff --git a/gnu/tests/install.scm b/gnu/tests/install.scm index 36dbd9111f..6be582373d 100644 --- a/gnu/tests/install.scm +++ b/gnu/tests/install.scm @@ -3,7 +3,7 @@ ;;; Copyright =C2=A9 2017, 2019, 2021 Tobias Geerinckx-Rice ;;; Copyright =C2=A9 2020 Mathieu Othacehe ;;; Copyright =C2=A9 2020 Danny Milosavljevic -;;; Copyright =C2=A9 2020 Jan (janneke) Nieuwenhuizen +;;; Copyright =C2=A9 2020, 2024 Janneke Nieuwenhuizen ;;; Copyright =C2=A9 2020, 2021, 2022 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. @@ -1869,6 +1869,9 @@ (define* (gui-test-program marionette #$marionette) (screenshot "installer-services.ppm") =20 + (marionette-eval* '(choose-kernel installer-socket) #$marionette) + (screenshot "installer-kernel.ppm") + (marionette-eval* '(choose-services installer-socket #:choose-desktop-environment? (const #$desktop?) --=20 2.46.0 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable --=20 Janneke Nieuwenhuizen | GNU LilyPond https://LilyPond.org Freelance IT https://www.JoyOfSource.com | Avatar=C2=AE https://AvatarAcade= my.com --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 25 05:41:03 2024 Received: (at 73927) by debbugs.gnu.org; 25 Oct 2024 09:41:03 +0000 Received: from localhost ([127.0.0.1]:37281 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4GoY-00020A-84 for submit@debbugs.gnu.org; Fri, 25 Oct 2024 05:41:03 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43742) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4GoU-0001za-0k for 73927@debbugs.gnu.org; Fri, 25 Oct 2024 05:40:59 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t4Gns-0003kV-9v; Fri, 25 Oct 2024 05:40:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=M64XvNZ8tGNU0qJTdyFJ3E1XQI5tAAk6yctQokyb4DI=; b=pt20apLZZprKGp s0dheC2LZdhGrtEwIvBJ6RBphI7HV/ZBJMJ/o1WPHmCxTpvODgvBVBjyKMJyicRvbc39PEy8tpfdu Egz5TuhJU1+NY/cZR/jlSUjCaCDPnmxNvbnxWXUCFxtRSjhme5/U7u0s1nVefgNeqQ4a8Ur5bGvL/ clfQ3ngzZZXa5k7QvvUtgRnZjlcSOAfZU2F2B4hi/5nK2p8jTGwyKN9pZ4gLNp1aQgzr8bzrqcoM+ lfzLFUT/pyQX/YTdD00qOv/trW6bXfwStttBzW7kInnWjeOQeTquwRpH0qTv3yEZIxpGqs9SGGAi5 1hHtyFyXkx1SEUv+sCHQ==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH v3 00/17] Installer support for (cross) installing the Hurd. Date: Fri, 25 Oct 2024 11:39:52 +0200 Message-ID: <20241025094011.8540-1-janneke@gnu.org> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) New in this series: * guix install now creates essential devices for the Hurd * by default, no EFI partition is created * the grub configuration for the HURD now caters for non-HURD-VM (chilhurds) * make check-system TESTS="gui-installed-os now also works for non-x86 which makes that besides creating a sensible config.scm, the installed Hurd now has a good chance to actually boot :) Also updated hurd-team. Greetings, Janneke Janneke Nieuwenhuizen (17): gnu: guile-fibers: Fix cross-build for the Hurd. guix system: When installing the Hurd, create essential devices. bootloader: grub: Remove hardcoded partition number for the Hurd. system: hurd: Remove qemu networking from %base-services/hurd. system: hurd: Add swap-services to hurd-default-essential-services. gnu: hurd: Support second boot. hurd-boot: Support second boot. maint: Add installer dependencies to the manifest. installer: Remove unused (newt) imports. installer: Align comments. installer: Use "partitioning-page" consistently. installer: Fix file-name typos. installer: Use `%' for parameter %run-command-in-installer. installer: Add dry-run? installer: Add "Kernel" page to select the Hurd. installer: Add static-networking template. installer: Support dry-run from Guile via store. gnu/bootloader/grub.scm | 42 ++++- gnu/build/hurd-boot.scm | 21 ++- gnu/installer.scm | 206 ++++++++++++++++++------ gnu/installer/final.scm | 10 +- gnu/installer/kernel.scm | 41 +++++ gnu/installer/newt.scm | 24 ++- gnu/installer/newt/ethernet.scm | 1 - gnu/installer/newt/final.scm | 20 ++- gnu/installer/newt/kernel.scm | 45 ++++++ gnu/installer/newt/keymap.scm | 6 +- gnu/installer/newt/locale.scm | 7 +- gnu/installer/newt/page.scm | 7 +- gnu/installer/newt/parameters.scm | 1 - gnu/installer/newt/partition.scm | 10 +- gnu/installer/newt/services.scm | 32 ++-- gnu/installer/parted.scm | 117 +++++++++----- gnu/installer/record.scm | 8 +- gnu/installer/services.scm | 68 ++++++-- gnu/installer/steps.scm | 30 ++-- gnu/installer/tests.scm | 11 ++ gnu/installer/utils.scm | 17 +- gnu/local.mk | 3 + gnu/packages/guile-xyz.scm | 11 +- gnu/packages/hurd.scm | 6 +- gnu/packages/patches/hurd-startup.patch | 82 ++++++++++ gnu/services/base.scm | 20 ++- gnu/services/virtualization.scm | 4 +- gnu/system.scm | 13 +- gnu/system/examples/bare-hurd.tmpl | 10 +- gnu/system/hurd.scm | 26 +-- gnu/system/images/hurd.scm | 2 +- gnu/tests/install.scm | 6 +- guix/scripts/system.scm | 6 +- manifest.scm | 7 +- 34 files changed, 724 insertions(+), 196 deletions(-) create mode 100644 gnu/installer/kernel.scm create mode 100644 gnu/installer/newt/kernel.scm create mode 100644 gnu/packages/patches/hurd-startup.patch base-commit: 2394a7f5fbf60dd6adc0a870366adb57166b6d8b -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 25 05:41:12 2024 Received: (at 73927) by debbugs.gnu.org; 25 Oct 2024 09:41:12 +0000 Received: from localhost ([127.0.0.1]:37289 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4Gof-00020s-IY for submit@debbugs.gnu.org; Fri, 25 Oct 2024 05:41:12 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43752) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4Gob-0001zq-2u for 73927@debbugs.gnu.org; Fri, 25 Oct 2024 05:41:08 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t4Gnz-0003lO-At; Fri, 25 Oct 2024 05:40:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=flD0+NLbFncv/7qoyAIgmBj3XyuhZ1e2BhQ6maNidi0=; b=Vf9jcRgZdLTrJazEwlXp HJikIEszj12MocIxTq2B9ML5cHxvObcgfSeKdMi3j4kGwtyyeA40dmwMYGVqceOIVK3tb0ckNVRld NMwZfqZiu1OTihMWK1R/EpxuPPEk7SoCENzOE26O5OtgD9SH+g4rMDavf2IUNq7WC0SxipMHZrlXk JhEwLZnwhwQnWr3rm0bhAmdFgjqyWA+6TWd7Cx/mD8HzV+qR9vziIzw7COxU3tvW0v4wK9MNSBIQx IcxX8seUyoomjbFjg9FCQdPUU15MZvtrdMQjOqDXOpyK7D59sh5kjeZ/rKn7RBKq5QEs16ElJlF1O kvYPIZJVlv5epA==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH v3 01/17] gnu: guile-fibers: Fix cross-build for the Hurd. Date: Fri, 25 Oct 2024 11:39:53 +0200 Message-ID: <20241025094011.8540-2-janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241025094011.8540-1-janneke@gnu.org> References: <20241025094011.8540-1-janneke@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/guile-xyz.scm (guile-fibers): When cross-building for the Hurd, add "fix-env" phase. Change-Id: Iebe12941bbfb2f5a6208f9364115e95f10e82ed6 --- gnu/packages/guile-xyz.scm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm index 5f34ea98a6..06d3b59dc3 100644 --- a/gnu/packages/guile-xyz.scm +++ b/gnu/packages/guile-xyz.scm @@ -9,7 +9,7 @@ ;;; Copyright © 2016, 2017, 2021 Alex Kost ;;; Copyright © 2016, 2017 Adonay "adfeno" Felipe Nogueira ;;; Copyright © 2016, 2021 Amirouche -;;; Copyright © 2016, 2019, 2021, 2023 Janneke Nieuwenhuizen +;;; Copyright © 2016, 2019, 2021, 2023, 2024 Janneke Nieuwenhuizen ;;; Copyright © 2017 Andy Wingo ;;; Copyright © 2017 David Thompson ;;; Copyright © 2017, 2018, 2019, 2020 Mathieu Othacehe @@ -875,7 +875,14 @@ (define-public guile-fibers (substitute* "tests/basic.scm" ((".*spawn-fiber-chain 5000000.*") "")) (substitute* "tests/channels.scm" - ((".*assert-run-fibers-terminates .*pingpong.*") ""))))))))) + ((".*assert-run-fibers-terminates .*pingpong.*") ""))))) + #$@(if (and (target-hurd?) (%current-target-system)) + #~((add-before 'build 'fixup-env + (lambda _ + (substitute* "env" + ((".*override.*" all) + (string-append "true #" all)))))) + '()))))) (native-inputs (list texinfo pkg-config autoconf-2.71 automake libtool guile-3.0 ;for 'guild compile -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 25 05:41:13 2024 Received: (at 73927) by debbugs.gnu.org; 25 Oct 2024 09:41:13 +0000 Received: from localhost ([127.0.0.1]:37293 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4Goi-00021B-N3 for submit@debbugs.gnu.org; Fri, 25 Oct 2024 05:41:13 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40712) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4God-000207-1Q for 73927@debbugs.gnu.org; Fri, 25 Oct 2024 05:41:08 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t4Go1-0003lu-SS; Fri, 25 Oct 2024 05:40:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=uGH+OmIi8UD3voHjYhCdE4fssUNdW+3qzlCWpWSm0cY=; b=MYX04lq1cqCvZL+krIbO vksBRxQYCvVF7nRE2by6ytS/Iw9zGyTjgTLnrfExc4NQ3mO/mz3mp8Y5j7dU4N1zmIr7x2ieBQf48 HrfBWS9kZFdmrVaWMX0yopUneVubvNi+q269apads8nVKxuyB00aATLe8RV59guKRZJ2GCUmcdjxe w3RQmtTwqpz2SFzFSbXNnwGIxGWTAOLjtKsYhVoS/RqujjGouNSWU7Y1ECH1Tdpgr9GUMfK52TWLS W/h0YjDI5sMT3ehnQycJgmKZrF4MI4y8Yt5KMwiiDS4SL6y6/8gZmOctwarYA0x2/b4EouC/D7jN5 8Gqfg7pJFgsqRA==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH v3 02/17] guix system: When installing the Hurd, create essential devices. Date: Fri, 25 Oct 2024 11:39:54 +0200 Message-ID: <20241025094011.8540-3-janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241025094011.8540-1-janneke@gnu.org> References: <20241025094011.8540-1-janneke@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * guix/scripts/system.scm (install): When installing the Hurd, invoke `make-hurd-device-nodes'. Change-Id: If84d5fe0b5bf4a93452f0b5241650f325d583543 --- guix/scripts/system.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 99c58f3812..7989b183ad 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -5,7 +5,7 @@ ;;; Copyright © 2017, 2019 Mathieu Othacehe ;;; Copyright © 2018 Ricardo Wurmus ;;; Copyright © 2019 Christopher Baines -;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen +;;; Copyright © 2020, 2024 Janneke Nieuwenhuizen ;;; Copyright © 2020 Julien Lepiller ;;; Copyright © 2020 Efraim Flashner ;;; Copyright © 2021 Brice Waegeneire @@ -63,6 +63,7 @@ (define-module (guix scripts system) #:autoload (guix progress) (progress-reporter/bar call-with-progress-reporter) #:use-module ((guix docker) #:select (%docker-image-max-layers)) + #:use-module (gnu build hurd-boot) #:use-module (gnu build image) #:use-module (gnu build install) #:autoload (gnu build file-systems) @@ -243,6 +244,9 @@ (define (maybe-copy to-copy) (delete-file-recursively state))) (chmod target #o755) + ;; For the Hurd to boot, it needs some essential device nodes. + (when (target-hurd?) + (make-hurd-device-nodes target)) (let ((os-dir (derivation->output-path os-drv)) (format (lift format %store-monad)) (populate (lift2 populate-root-file-system %store-monad))) -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 25 05:41:18 2024 Received: (at 73927) by debbugs.gnu.org; 25 Oct 2024 09:41:18 +0000 Received: from localhost ([127.0.0.1]:37305 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4Gon-00021r-CK for submit@debbugs.gnu.org; Fri, 25 Oct 2024 05:41:18 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40720) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4Gof-00020V-CA for 73927@debbugs.gnu.org; Fri, 25 Oct 2024 05:41:10 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t4Go4-0003mV-9C; Fri, 25 Oct 2024 05:40:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=iS7+3/AESJWRY83J3PsKmVkG2pCZUUpR5Nfk6jFjUR8=; b=oIB+PhG8pKSGlNPcZpM0 7hEWAYdylw/jAa+FUlsg/lFu+zSqSxdGtGR/cqmBHV3+kAxy+F6NCqhYhWukRwEUQ1JcKDAgUI4CD snFfPIvpC6HObjsXT8YdCyVJC3sAfhIG1QxkyIlugC86u+2MLT8XVdN4H3FkAQPXmZKOx1YM31bso U2FFVweOpczRuJHittd17QA4+zs3kbY0/9LFkY9VWbCZpnGWdLwZG94u3Kktm619q7UgOSJy3UdXP q7q8R3tC+rQu4LbeE9OTHa7ZRtsQv1ZS+LRiIZ+bgkbX7cLFc+v8A7j0OeKajLpGGUiVcutqCQCWs +1qkRiwWrNb21g==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH v3 03/17] bootloader: grub: Remove hardcoded partition number for the Hurd. Date: Fri, 25 Oct 2024 11:39:55 +0200 Message-ID: <20241025094011.8540-4-janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241025094011.8540-1-janneke@gnu.org> References: <20241025094011.8540-1-janneke@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) This supports using another than the default DISK0 PART1 and using LABEL or UUID as root file-system specifier. It still defaults to DISK0 PART1 if the file-system cannot be found, i.e., lives only at the build side: A virtual machine/childhurd build. * gnu/bootloader/grub.scm (%device-spec-regexp): New variable. (string->device-spec, device-spec->hurd-device): Use it in new procedures. (device->hurd-device): New procedure. (make-grub-configuration): Use them to remove hardcoded partition number (root-index 1). Change-Id: I49fa93dacc09883dfb4d695402c5eac2e0e17286 --- gnu/bootloader/grub.scm | 42 +++++++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index 2723eda5f4..c929af691b 100644 --- a/gnu/bootloader/grub.scm +++ b/gnu/bootloader/grub.scm @@ -3,7 +3,7 @@ ;;; Copyright © 2016 Chris Marusich ;;; Copyright © 2017 Leo Famulari ;;; Copyright © 2017, 2020 Mathieu Othacehe -;;; Copyright © 2019, 2020, 2023 Janneke Nieuwenhuizen +;;; Copyright © 2019, 2020, 2023, 2024 Janneke Nieuwenhuizen ;;; Copyright © 2019, 2020 Miguel Ángel Arruga Vivas ;;; Copyright © 2020 Maxim Cournoyer ;;; Copyright © 2020 Stefan @@ -34,6 +34,7 @@ (define-module (gnu bootloader grub) #:use-module (guix gexp) #:use-module (gnu artwork) #:use-module (gnu bootloader) + #:use-module (gnu build file-systems) #:use-module (gnu system uuid) #:use-module (gnu system file-systems) #:use-module (gnu system keyboard) @@ -45,6 +46,7 @@ (define-module (gnu bootloader grub) #:use-module (ice-9 regex) #:use-module (srfi srfi-1) #:use-module (srfi srfi-2) + #:use-module (srfi srfi-26) #:export (grub-theme grub-theme? grub-theme-image @@ -355,6 +357,34 @@ (define (grub-root-search device file) ((or #f (? string?)) #~(format #f "search --file --set ~a" #$file))))) +(define %device-spec-regexp "/dev/[hsvw]d([abcd])([0-9]*)") +(define (string->device-spec str) + "Return device spec STR as /dev/XdYZ, also catering for uuid or label." + (cond ((string-match %device-spec-regexp str) + str) + ((string->uuid str) + => + find-partition-by-uuid) + (else + (find-partition-by-label str)))) + +(define* (device-spec->hurd-device device-spec #:key (disk "w")) + "Return DEVICE-SPEC as a Hurd device spec: + part:PART-NUMBER:device:DISKdDISK-INDEX +Default to part:1:device:DISKd0 if partition cannot be found." + (let* ((m (and=> device-spec (cute string-match %device-spec-regexp <>))) + (disk-char (and m (and=> (match:substring m 1) (compose car string->list)))) + (disk-index (or (and disk-char (- (char->integer disk-char) (char->integer #\a))) + 0)) + (partition-number (or (and m (and=> (match:substring m 2) string->number)) + 1))) + (format #f "part:~a:device:~ad~a" partition-number disk disk-index))) + +(define* (device->hurd-device device #:key (disk "w")) + "Return DEVICE as a Hurd device spec: part:PART-NUMBER:device:DISKdDISK-INDEX." + (let ((device-spec (canonicalize-device-spec device))) + (device-spec->hurd-device device-spec #:disk disk))) + (define* (make-grub-configuration grub config entries #:key (locale #f) @@ -413,16 +443,16 @@ (define (menu-entry->gexp entry) ;; IDE driver ("hdX") and those understood by rumpdisk ("wdX" ;; in the "noide" case). (disk (if (member "noide" arguments) "w" "h")) - (modules (menu-entry-multiboot-modules entry)) - (root-index 1)) ; XXX EFI will need root-index 2 + (device-string (file-system-device->string device)) + (device-spec (and=> device-string string->device-spec)) + (modules (menu-entry-multiboot-modules entry))) #~(format port " menuentry ~s { - multiboot ~a root=part:~a:device:~ad0~a~a + multiboot ~a root=~a~a~a }~%" #$label #$kernel - #$root-index - #$disk + #$(device-spec->hurd-device device-spec #:disk disk) (string-join (list #$@arguments) " " 'prefix) (string-join (map string-join '#$modules) "\n module " 'prefix)))) -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 25 05:41:19 2024 Received: (at 73927) by debbugs.gnu.org; 25 Oct 2024 09:41:19 +0000 Received: from localhost ([127.0.0.1]:37307 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4Goo-000224-57 for submit@debbugs.gnu.org; Fri, 25 Oct 2024 05:41:18 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40722) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4Goh-00020b-MX for 73927@debbugs.gnu.org; Fri, 25 Oct 2024 05:41:12 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t4Go6-0003mr-Jk; Fri, 25 Oct 2024 05:40:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=v7eM2uVrdoqbOUffc/yD5r848jCktjuGgc/Sjl1V6h0=; b=WOrhMMd/ca8OAl2DeDCP T6leKqAK7KpPpjr6W3gWVgI695mT0C4hf+4t1sPitQDiYb4GjEi7C3QlmDd0f7hJgEN6N65mNbKsf 1t+FxCfqH0Wg6HnOKFes10OxDt/vqxjBnCM80N2oQrIoAcoWZpuJ8XwwBwbHhfuppL6KPZisGaT7W kKIE7SBU6cmM1S8lLgEBz3PcpnXOY4QNKekEMHxffBxr6YaPxeM0MUSqzor3iXIGvX+j2cmVbBR3y ORr1L8WQlCTb6xK6D0LF5i7uGLmNc8olZSNihp80WAjUd6IWtzoTUAgXaru7pGEyPku48CGCquoyv 4m8MUKtSx7Yi8Q==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH v3 04/17] system: hurd: Remove qemu networking from %base-services/hurd. Date: Fri, 25 Oct 2024 11:39:56 +0200 Message-ID: <20241025094011.8540-5-janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241025094011.8540-1-janneke@gnu.org> References: <20241025094011.8540-1-janneke@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) This allows us to use %base-services/hurd for services in a Hurd config for a real machine without removing static-networking. * gnu/system/hurd.scm (%base-services/hurd): Factor networking out to... (%base-services+qemu-networking/hurd): ..this new variable. * gnu/system/examples/bare-hurd.tmpl (%hurd-os): Use it. * gnu/services/virtualization.scm (%hurd-vm-operating-system): Use it. * gnu/system/images/hurd.scm (hurd-barebones-os): Use it. Add comment about QEMU and networking for a real machine. Change-Id: I777a63410383b9bf8b5740e4513dbc1e9fb0fd41 --- gnu/services/virtualization.scm | 4 ++-- gnu/system/examples/bare-hurd.tmpl | 10 ++++++++-- gnu/system/hurd.scm | 23 ++++++++++++++--------- gnu/system/images/hurd.scm | 2 +- 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/gnu/services/virtualization.scm b/gnu/services/virtualization.scm index d87e494348..d33dfa6ca7 100644 --- a/gnu/services/virtualization.scm +++ b/gnu/services/virtualization.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017 Ryan Moe ;;; Copyright © 2018, 2020-2024 Ludovic Courtès -;;; Copyright © 2020, 2021, 2023 Janneke Nieuwenhuizen +;;; Copyright © 2020, 2021, 2023, 2024 Janneke Nieuwenhuizen ;;; Copyright © 2021 Timotej Lazar ;;; Copyright © 2022 Oleg Pykhalov ;;; Copyright © 2022 Leo Nikkilä @@ -1643,7 +1643,7 @@ (define %hurd-vm-operating-system ;; /etc/guix/acl file in the childhurd. Thus, clear ;; 'authorize-key?' so that it's not overridden at activation ;; time. - (modify-services %base-services/hurd + (modify-services %base-services+qemu-networking/hurd (guix-service-type config => (guix-configuration (inherit config) diff --git a/gnu/system/examples/bare-hurd.tmpl b/gnu/system/examples/bare-hurd.tmpl index 463c7ee798..68c6d3c166 100644 --- a/gnu/system/examples/bare-hurd.tmpl +++ b/gnu/system/examples/bare-hurd.tmpl @@ -1,7 +1,7 @@ ;; -*-scheme-*- ;; This is an operating system configuration template -;; for a "bare bones" setup, with no X11 display server. +;; for a "bare bones" QEMU setup, with no X11 display server. ;; To build a disk image for a virtual machine, do ;; @@ -54,6 +54,12 @@ (permit-root-login #t) (allow-empty-passwords? #t) (password-authentication? #t))) - %base-services/hurd)))) + ;; For installing on a real (non-QEMU) machine, use: + ;; (static-networking-service-type + ;; (list %loopback-static-networking + ;; (static-networking + ;; ...))) + ;; %base-services/hurd + %base-services+qemu-networking/hurd)))) %hurd-os diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm index 6d6a20cf57..283bae6f10 100644 --- a/gnu/system/hurd.scm +++ b/gnu/system/hurd.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2020-2024 Ludovic Courtès -;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen +;;; Copyright © 2020, 2023, 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -47,6 +47,7 @@ (define-module (gnu system hurd) #:use-module (gnu system vm) #:export (%base-packages/hurd %base-services/hurd + %base-services+qemu-networking/hurd %hurd-default-operating-system %hurd-default-operating-system-kernel %setuid-programs/hurd)) @@ -79,14 +80,6 @@ (define %base-packages/hurd (define %base-services/hurd (append (list (service hurd-console-service-type (hurd-console-configuration (hurd hurd))) - (service static-networking-service-type - (list %loopback-static-networking - - ;; QEMU user-mode networking. To get "eth0", you need - ;; QEMU to emulate a device for which Mach has an - ;; in-kernel driver, for instance with: - ;; --device rtl8139,netdev=net0 --netdev user,id=net0 - %qemu-static-networking)) (service guix-service-type (guix-configuration (extra-options '("--disable-chroot" @@ -102,6 +95,18 @@ (define %base-services/hurd (tty (string-append "tty" (number->string n)))))) (iota 6 1)))) +(define %base-services+qemu-networking/hurd + (cons + (service static-networking-service-type + (list %loopback-static-networking + + ;; QEMU user-mode networking. To get "eth0", you need + ;; QEMU to emulate a device for which Mach has an + ;; in-kernel driver, for instance with: + ;; --device rtl8139,netdev=net0 --netdev user,id=net0 + %qemu-static-networking)) + %base-services/hurd)) + (define %setuid-programs/hurd ;; Default set of setuid-root programs. (map file-like->setuid-program diff --git a/gnu/system/images/hurd.scm b/gnu/system/images/hurd.scm index 9b618f7dc6..01c422a54f 100644 --- a/gnu/system/images/hurd.scm +++ b/gnu/system/images/hurd.scm @@ -60,7 +60,7 @@ (define hurd-barebones-os (permit-root-login #t) (allow-empty-passwords? #t) (password-authentication? #t))) - %base-services/hurd)))) + %base-services+qemu-networking/hurd)))) (define hurd-initialize-root-partition #~(lambda* (#:rest args) -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 25 05:41:26 2024 Received: (at 73927) by debbugs.gnu.org; 25 Oct 2024 09:41:26 +0000 Received: from localhost ([127.0.0.1]:37325 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4Gow-000234-0v for submit@debbugs.gnu.org; Fri, 25 Oct 2024 05:41:26 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40738) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4Gok-00020j-0j for 73927@debbugs.gnu.org; Fri, 25 Oct 2024 05:41:14 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t4Go8-0003nA-SB; Fri, 25 Oct 2024 05:40:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=dTzYYFac8op+rYUIIHwt/QGBGUyoFWbx3ZMvObbec1E=; b=hs0SBYvtQ+GZN13JE50k OI4p8ifv6WPF5p37lOxbbTs/gornym8NEdVP2FMhX17ApsYZ49XRyVcx4gczlGUwh4jAW0SVZTkmj padwYBVE1u9NV0hQV+mfX3M/bIgzvSVzyH94Jzn/+HzQawKgYY17qJHlZW9SfFIuIrYVfK5BVl44h g2bAA7zRNjOLsRCezLIAUj99NaFRobUlwxwdBabjbI2FKlJJwxzz3JDbDf5qkegG9BCVF7ll1XAbY 4HXyS8eozjcc4761L/A01LCHdXh1pE02qXM4ynRBeV+9UuYjWf0luyhx/XmMJWH3kM7jwj+L+3uhY +cGV0ytLxy8+jQ==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH v3 05/17] system: hurd: Add swap-services to hurd-default-essential-services. Date: Fri, 25 Oct 2024 11:39:57 +0200 Message-ID: <20241025094011.8540-6-janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241025094011.8540-1-janneke@gnu.org> References: <20241025094011.8540-1-janneke@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/services/base.scm (swap-service-type): Do not include 'udev' requirement for the Hurd. Use system* with "swapon", "swapoff" for the Hurd. * gnu/system.scm (hurd-default-essential-services): Add swap-services. * gnu/services/base.scm (swap-service-type): Change-Id: I1d4d445c614921752dc84aa0dd6ff42cdbf62aa8 --- gnu/services/base.scm | 20 +++++++++++++------- gnu/system.scm | 13 +++++++------ 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/gnu/services/base.scm b/gnu/services/base.scm index d0a57a8807..6201dea4b8 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -44,6 +44,7 @@ (define-module (gnu services base) #:autoload (guix diagnostics) (warning formatted-message &fix-hint) #:autoload (guix i18n) (G_) #:use-module (guix combinators) + #:use-module (guix utils) #:use-module (gnu services) #:use-module (gnu services admin) #:use-module (gnu services shepherd) @@ -2647,7 +2648,7 @@ (define device-lookup (with-imported-modules (source-module-closure '((gnu build file-systems))) (shepherd-service (provision (list (swap->shepherd-service-name swap))) - (requirement `(udev ,@requirements)) + (requirement `(,@(if (target-hurd?) '() '(udev)) ,@requirements)) (documentation "Enable the given swap space.") (modules `((gnu build file-systems) ,@%default-modules)) @@ -2655,16 +2656,21 @@ (define device-lookup (let ((device #$device-lookup)) (and device (begin - (restart-on-EINTR (swapon device - #$(if (swap-space? swap) - (swap-space->flags-bit-mask - swap) - 0))) + #$(if (target-hurd?) + #~(system* "swapon" device) + #~(restart-on-EINTR + (swapon device + #$(if (swap-space? swap) + (swap-space->flags-bit-mask + swap) + 0)))) #t))))) (stop #~(lambda _ (let ((device #$device-lookup)) (when device - (restart-on-EINTR (swapoff device))) + #$(if (target-hurd?) + #~(system* "swapoff" device) + #~(restart-on-EINTR (swapoff device)))) #f))) (respawn? #f)))) (description "Turn on the virtual memory swap area."))) diff --git a/gnu/system.scm b/gnu/system.scm index c19730b331..533a4154d6 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -845,11 +845,11 @@ (define (hurd-default-essential-services os) (let ((host-name (operating-system-host-name os)) (hosts-file (%operating-system-hosts-file os)) (entries (operating-system-directory-base-entries os))) - (list (service system-service-type entries) - %boot-service - %hurd-startup-service - %activation-service - (service shepherd-root-service-type) + (cons* (service system-service-type entries) + %boot-service + %hurd-startup-service + %activation-service + (service shepherd-root-service-type) (service user-processes-service-type) ;; Make sure that privileged-programs activation script @@ -873,7 +873,8 @@ (define (hurd-default-essential-services os) (list `("hosts" ,hosts-file))) (service hosts-service-type (local-host-entries host-name))) - (service profile-service-type (operating-system-packages os))))) + (service profile-service-type (operating-system-packages os)) + (swap-services os)))) (define* (operating-system-services os) "Return all the services of OS, including \"essential\" services." -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 25 05:41:27 2024 Received: (at 73927) by debbugs.gnu.org; 25 Oct 2024 09:41:27 +0000 Received: from localhost ([127.0.0.1]:37327 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4Gow-000236-Fk for submit@debbugs.gnu.org; Fri, 25 Oct 2024 05:41:26 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40752) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4Gok-00020t-O8 for 73927@debbugs.gnu.org; Fri, 25 Oct 2024 05:41:15 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t4Go9-0003nN-LH; Fri, 25 Oct 2024 05:40:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=LrRaWiUAjE/ABqaSMHGg0G+E2VouERezmvh7ze3qFEw=; b=MFGR+g5hqyIh6545isR3 UvIwimx1XJL1FcGeJlGNMjs6FSkiKbtLnOrIrIrp0VSlkiAqWYDjUKcjqc3jo1D0sL2ovSCiAjQ75 B+oUyDrwAW18dBTNnyICr3bUhofnNdDjA5oF193F+Gs8FGFY2z/3Xk+nnV+wayEyglbfWRr2OCG6R oNm4WpQsFzM6hVrNjparTA2Aj8cYdXE6Al4DhcK55wdV/Xdtkca4Nr/E4rNGID3nSjGsPORSqDwp7 4OCC26lLdo7Qw7QAQsOtBUbm5UQYYjhpBpFMvPkQKNLleuV1m0HiVFJqK97bESKw3Zhh6FWZmQJ6u kGEXoddOCQoymQ==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH v3 06/17] gnu: hurd: Support second boot. Date: Fri, 25 Oct 2024 11:39:58 +0200 Message-ID: <20241025094011.8540-7-janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241025094011.8540-1-janneke@gnu.org> References: <20241025094011.8540-1-janneke@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) This avoids hanging upon second boot and ensures a declarative /hurd and /dev. * gnu/packages/patches/hurd-startup.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/hurd.scm (hurd): Use it. [arguments]: In stage create-runsystem remove /dev/urandom. Change-Id: Ifcca5562c297204735c35132820a32ca0f273677 --- gnu/local.mk | 1 + gnu/packages/hurd.scm | 6 +- gnu/packages/patches/hurd-startup.patch | 82 +++++++++++++++++++++++++ 3 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/hurd-startup.patch diff --git a/gnu/local.mk b/gnu/local.mk index 911af88627..0a1357f114 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1540,6 +1540,7 @@ dist_patch_DATA = \ %D%/packages/patches/hubbub-sort-entities.patch \ %D%/packages/patches/hueplusplus-mbedtls.patch \ %D%/packages/patches/hurd-rumpdisk-no-hd.patch \ + %D%/packages/patches/hurd-startup.patch \ %D%/packages/patches/hwloc-1-test-btrfs.patch \ %D%/packages/patches/i7z-gcc-10.patch \ %D%/packages/patches/icecat-makeicecat.patch \ diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm index e6ea920714..9c1681f236 100644 --- a/gnu/packages/hurd.scm +++ b/gnu/packages/hurd.scm @@ -317,7 +317,8 @@ (define-public hurd (name "hurd") (source (origin (inherit (package-source hurd-headers)) - (patches (search-patches "hurd-rumpdisk-no-hd.patch")))) + (patches (search-patches "hurd-rumpdisk-no-hd.patch" + "hurd-startup.patch")))) (version (package-version hurd-headers)) (arguments `(#:tests? #f ;no "check" target @@ -388,6 +389,9 @@ (define-public hurd # Note: this /hurd/ gets substituted settrans --create /servers/socket/1 /hurd/pflocal +# Upon second boot, (file-exists? /dev/null) in hurd-boot-system hangs unless: +rm -f /dev/urandom + # parse multiboot arguments for i in \"$@\"; do case $i in diff --git a/gnu/packages/patches/hurd-startup.patch b/gnu/packages/patches/hurd-startup.patch new file mode 100644 index 0000000000..0b0dcc9537 --- /dev/null +++ b/gnu/packages/patches/hurd-startup.patch @@ -0,0 +1,82 @@ +This avoids hanging upon second boot and ensures a declarative /dev. + +Upstream status: Not presented upstream. + +From a15d281ea012ee360c45376e964d35f6292ac549 Mon Sep 17 00:00:00 2001 +From: Janneke Nieuwenhuizen +Date: Sat, 27 May 2023 17:28:22 +0200 +Subject: [PATCH] startup: Remove /hurd, /dev, create /servers. + +This avoids hanging upon second boot and ensures a declarative /hurd +and /dev. + +* startup/startup.c (rm_r, create_servers): New functions. +(main): Use them to remove /dev and create /servers. Remove /hurd +symlink. +--- + startup/startup.c | 42 ++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 42 insertions(+) + +diff --git a/startup/startup.c b/startup/startup.c +index feb7d265..5f380194 100644 +--- a/startup/startup.c ++++ b/startup/startup.c +@@ -732,6 +732,42 @@ parse_opt (int key, char *arg, struct argp_state *state) + return 0; + } + ++#include ++static int ++rm_r (char const *file_name) ++{ ++ int callback (char const *file_name, struct stat64 const *stat_buffer, ++ int type_flag, struct FTW *ftw_buffer) ++ { ++ fprintf (stderr, "startup: removing: %s\n", file_name); ++ return remove (file_name); ++ } ++ ++ return nftw64 (file_name, callback, 0, FTW_DEPTH | FTW_MOUNT | FTW_PHYS); ++} ++ ++void ++create_servers (void) ++{ ++ char const *servers[] = { ++ "/servers/startup", ++ "/servers/exec", ++ "/servers/proc", ++ "/servers/password", ++ "/servers/default-pager", ++ "/servers/crash-dump-core", ++ "/servers/kill", ++ "/servers/suspend", ++ 0, ++ }; ++ mkdir ("/servers", 0755); ++ for (char const **p = servers; *p; p++) ++ open (*p, O_WRONLY | O_APPEND | O_CREAT, 0444); ++ mkdir ("/servers/socket", 0755); ++ mkdir ("/servers/bus", 0755); ++ mkdir ("/servers/bus/pci", 0755); ++} ++ + int + main (int argc, char **argv, char **envp) + { +@@ -741,6 +777,12 @@ main (int argc, char **argv, char **envp) + mach_port_t consdev; + struct argp argp = { options, parse_opt, 0, doc }; + ++ /* GNU Guix creates fresh ones in boot-hurd-system. */ ++ unlink ("/hurd"); ++ rm_r ("/dev"); ++ mkdir ("/dev", 0755); ++ create_servers (); ++ + /* Parse the arguments. We don't want the vector reordered, we + should pass on to our child the exact arguments we got and just + ignore any arguments that aren't flags for us. ARGP_NO_ERRS +-- +2.40.1 + -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 25 05:41:27 2024 Received: (at 73927) by debbugs.gnu.org; 25 Oct 2024 09:41:27 +0000 Received: from localhost ([127.0.0.1]:37329 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4Gow-00023G-W6 for submit@debbugs.gnu.org; Fri, 25 Oct 2024 05:41:27 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40768) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4Gol-000210-ET for 73927@debbugs.gnu.org; Fri, 25 Oct 2024 05:41:16 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t4GoA-0003na-Bl; Fri, 25 Oct 2024 05:40:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=jHaKbg4o/jE+GpBXlbLJ5PGb1IQGQgzbQVVHRqpqhLg=; b=ZbrN4zqiSGcMSXL0KeNy 4OObyq50QJRIStmknQMJdGDGRB5Ge2PmECAaBXROsKubdVvLb+pLCSXihaQyaVHbB0QCCRWw+Gw62 nZhX3L2b4sGMyxd+xQOZZirlR1Qzmc7pi+OwAGbvP9NvdoTTjLvE3H4W2aXT+d1xRXphbNZK6W+Sq YKe/6Vz+8p6jG1DMoSMkY98Z7jf+/YzVSQjM0NeSH7cvaJJib/1tJ+CPh1lAmDJyRC4W92kdBC0an +F12QSBZmcjvASPAhCYzNrMZp2fLPWTMIrU3FviAI7NpgFmac2c4vI/uTaViJeNDc1lpL5gfeCsqj tqAcrlx/tRHpnQ==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH v3 07/17] hurd-boot: Support second boot. Date: Fri, 25 Oct 2024 11:39:59 +0200 Message-ID: <20241025094011.8540-8-janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241025094011.8540-1-janneke@gnu.org> References: <20241025094011.8540-1-janneke@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/build/hurd-boot.scm (boot-hurd-system): Check for stale shepherd socket and remove it. Be chattier about /hurd symlink replacement. Change-Id: I5e528c131ebeadb7ebc9727336a0f9301af3e68e --- gnu/build/hurd-boot.scm | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/gnu/build/hurd-boot.scm b/gnu/build/hurd-boot.scm index daf4fb41ab..23ace25d4f 100644 --- a/gnu/build/hurd-boot.scm +++ b/gnu/build/hurd-boot.scm @@ -322,18 +322,29 @@ (define* (boot-hurd-system #:key (on-error 'debug)) (let* ((args (command-line)) (system (find-long-option "gnu.system" args)) - (to-load (find-long-option "gnu.load" args))) + (to-load (find-long-option "gnu.load" args)) + (profile (string-append system "/profile")) + (bin (string-append profile "/bin")) + (sbin (string-append profile "/bin"))) - (false-if-exception (delete-file "/hurd")) - (let ((hurd/hurd (readlink* (string-append system "/profile/hurd")))) - (symlink hurd/hurd "/hurd")) + (setenv "PATH" (string-append bin ":" sbin)) + + (when (file-exists? "/var/run/shepherd/socket") + (format #t "Removing stale shepherd socket...\n") + (delete-file "/var/run/shepherd/socket")) (unless (file-exists? "/servers/startup") (format #t "Creating essential device nodes...\n") (make-hurd-device-nodes)) + (let ((profile/hurd (readlink* (string-append profile "/hurd")))) + (when (file-exists? "/hurd") + (format #t "Removing stale /hurd link\n") + (delete-file "/hurd")) + (format #t "Linking /hurd from ~a...\n" profile/hurd) + (symlink profile/hurd "/hurd")) + (format #t "Setting-up essential translators...\n") - (setenv "PATH" (string-append system "/profile/bin")) (set-hurd-device-translators) (format #t "Starting pager...\n") -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 25 05:41:27 2024 Received: (at 73927) by debbugs.gnu.org; 25 Oct 2024 09:41:27 +0000 Received: from localhost ([127.0.0.1]:37331 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4Gox-00023N-GC for submit@debbugs.gnu.org; Fri, 25 Oct 2024 05:41:27 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40772) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4Gom-000212-Bw for 73927@debbugs.gnu.org; Fri, 25 Oct 2024 05:41:16 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t4GoB-0003nl-8w; Fri, 25 Oct 2024 05:40:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=P0PHZ7Z+mClmqxZMoGyaY70WFWhoB6kPXaCkEj9nTZg=; b=kreuGKuJbSzxaU5LhpPE gINWBtBGRArI3iUBmwOVeQwde4Fc4RrfEwAtxfG9PU9fhd6x3LtI3Gv4S/MG+cnd9phj51XIwnx51 0HaH66FDTzYUMOXPyBNCcq8o7eyz0I279VzlJIJmFijh3sPfBXArTCb+BAAr3w6PDZs4J/HGGDlxP 5i+BNXachcT9JtlAZJ4A9p9+1beT4hjaqaM2nA90uN7eSOEYmtUpHrjziGGmNLRoyQ5019ubMdDLB B0JM6GjwZUzAzuqJk9rvX7sUyJIFON1TfgYcPdINc6BPfttBqG9SplnOBf1s4tFq+5w/FQjGNdcUO PPpa0PeoME7+eQ==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH v3 08/17] maint: Add installer dependencies to the manifest. Date: Fri, 25 Oct 2024 11:40:00 +0200 Message-ID: <20241025094011.8540-9-janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241025094011.8540-1-janneke@gnu.org> References: <20241025094011.8540-1-janneke@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * manifest.scm: Add guile-newt, guile-parted, guile-webutils. Change-Id: Idcf46320d29c15f36da05f66e81b7779e37c1bf6 --- manifest.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/manifest.scm b/manifest.scm index 27e1d62566..ccd6268461 100644 --- a/manifest.scm +++ b/manifest.scm @@ -51,4 +51,9 @@ "mumi" "nss-certs" "openssl" ;required if using 'smtpEncryption = tls' - "patman")))) + "patman")) + ;; For installer + (specifications->manifest + (list "guile-newt" + "guile-parted" + "guile-webutils")))) -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 25 05:41:28 2024 Received: (at 73927) by debbugs.gnu.org; 25 Oct 2024 09:41:28 +0000 Received: from localhost ([127.0.0.1]:37333 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4Gox-00023V-Ol for submit@debbugs.gnu.org; Fri, 25 Oct 2024 05:41:28 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36412) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4Gon-000214-7X for 73927@debbugs.gnu.org; Fri, 25 Oct 2024 05:41:17 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t4GoC-0003nw-4a; Fri, 25 Oct 2024 05:40:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=yK00Fpp7FvviPVDnKSLTliUmQx+JHOKJWcurU/NILrU=; b=Ay8dliY/wlhnWdV5MMx7 HjStxrOjmmt14DplfnCsDobhaQd2WdhbD+dSxFBU2rG5hw5HqpAZqLHmCr/2zDNKW7QIZAB5IKkp9 ebsAwWjp0fEpRSUHIy5P3PC6jqdCqY1v5OIlkIyk6v4vxvx9yoMlgafdrlgLTfC4jYeVygliWUzPy Xs7dpoqul7nSx0WMBTr7USfZgb/12spa5p7Q7u22RGRqfxpXvbBVUchn7svmXfzeL27Ur2ovnUDCb QkIuwRnGyPbS8G9Z1jViwwrEFJQaVQ4rsgbAepcwrqZiJbtQaesuIHBQx1Q94LE2GrI90GNGnIJLo ORxrdt2dMwiwEA==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH v3 09/17] installer: Remove unused (newt) imports. Date: Fri, 25 Oct 2024 11:40:01 +0200 Message-ID: <20241025094011.8540-10-janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241025094011.8540-1-janneke@gnu.org> References: <20241025094011.8540-1-janneke@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/installer/newt/ethernet.scm, gnu/installer/newt/keymap.scm, gnu/installer/newt/locale.scm, gnu/installer/newt/parameters.scm, gnu/installer/newt/services.scm: Remove (newt). Change-Id: Ia6624aaf73491024da54b8ffee7358941b187fdf --- gnu/installer/newt/ethernet.scm | 1 - gnu/installer/newt/keymap.scm | 1 - gnu/installer/newt/locale.scm | 1 - gnu/installer/newt/parameters.scm | 1 - gnu/installer/newt/services.scm | 1 - 5 files changed, 5 deletions(-) diff --git a/gnu/installer/newt/ethernet.scm b/gnu/installer/newt/ethernet.scm index d75a640519..53e440fd60 100644 --- a/gnu/installer/newt/ethernet.scm +++ b/gnu/installer/newt/ethernet.scm @@ -27,7 +27,6 @@ (define-module (gnu installer newt ethernet) #:use-module (ice-9 match) #:use-module (srfi srfi-34) #:use-module (srfi srfi-35) - #:use-module (newt) #:export (run-ethernet-page)) (define (ethernet-services) diff --git a/gnu/installer/newt/keymap.scm b/gnu/installer/newt/keymap.scm index c5d4be6792..109ec55e0a 100644 --- a/gnu/installer/newt/keymap.scm +++ b/gnu/installer/newt/keymap.scm @@ -24,7 +24,6 @@ (define-module (gnu installer newt keymap) #:use-module (gnu installer newt page) #:use-module (guix i18n) #:use-module (guix records) - #:use-module (newt) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:use-module (srfi srfi-34) diff --git a/gnu/installer/newt/locale.scm b/gnu/installer/newt/locale.scm index 01171e253f..a226b39ba6 100644 --- a/gnu/installer/newt/locale.scm +++ b/gnu/installer/newt/locale.scm @@ -22,7 +22,6 @@ (define-module (gnu installer newt locale) #:use-module (gnu installer steps) #:use-module (gnu installer newt page) #:use-module (guix i18n) - #:use-module (newt) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:use-module (srfi srfi-34) diff --git a/gnu/installer/newt/parameters.scm b/gnu/installer/newt/parameters.scm index 8fb1aa3abb..7c61266e4d 100644 --- a/gnu/installer/newt/parameters.scm +++ b/gnu/installer/newt/parameters.scm @@ -23,7 +23,6 @@ (define-module (gnu installer newt parameters) #:use-module (guix build syscalls) #:use-module (guix i18n) #:use-module (ice-9 match) - #:use-module (newt) #:export (run-parameters-page)) (define (run-proxy-page) diff --git a/gnu/installer/newt/services.scm b/gnu/installer/newt/services.scm index b22024602c..d1035b6524 100644 --- a/gnu/installer/newt/services.scm +++ b/gnu/installer/newt/services.scm @@ -28,7 +28,6 @@ (define-module (gnu installer newt services) #:use-module (guix i18n) #:use-module (srfi srfi-34) #:use-module (srfi srfi-35) - #:use-module (newt) #:export (run-services-page)) (define (run-desktop-environments-cbt-page) -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 25 05:41:28 2024 Received: (at 73927) by debbugs.gnu.org; 25 Oct 2024 09:41:28 +0000 Received: from localhost ([127.0.0.1]:37335 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4Goy-00023c-70 for submit@debbugs.gnu.org; Fri, 25 Oct 2024 05:41:28 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36424) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4Goo-00021H-67 for 73927@debbugs.gnu.org; Fri, 25 Oct 2024 05:41:18 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t4GoD-0003oC-2s; Fri, 25 Oct 2024 05:40:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=v/pW+YqpBk1rh8FIYn7q3YSdCaiGXFqk4xeKpH1/B20=; b=guSl/1sxnMYRjJfG77l9 E9e83rM8153fQhgFxUCMrtxIeUeZcPwHCIsbjxG3ppbom9dCv1Omy0A7iopg2XDvGnNMYTL3GR90K NPFeHaxI8Wy3NNbUCixBNDuZz39Uk2EPbruxehK0hlvCXfVGpv7d/aLY+5fDpTgxncemtvgXxoHVt 6OGMk3T/OHHS5PDb2vo0J7HCxkEfddordnLpXivzP0Y4vsCZdFrM5Wu+0lq/iSTnQcjjSkr3pIYDS FuoYNWUBW1f0F6njQe7SO0t+MynQi/Uc8gtfcsAGGGNVuTqrFFKb7ueNG7vpW/0pAeX4Ybs/8oGDz xWYrHz5oUoXSIw==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH v3 10/17] installer: Align comments. Date: Fri, 25 Oct 2024 11:40:02 +0200 Message-ID: <20241025094011.8540-11-janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241025094011.8540-1-janneke@gnu.org> References: <20241025094011.8540-1-janneke@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/installer.scm (installer-program): Align comments. Change-Id: I50c173c46ea9bfdb3da0562146bc969d46f0edd9 --- gnu/installer.scm | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/gnu/installer.scm b/gnu/installer.scm index 5cd99e4013..3dfcb7581a 100644 --- a/gnu/installer.scm +++ b/gnu/installer.scm @@ -355,22 +355,22 @@ (define init-gettext (define set-installer-path ;; Add the specified binary to PATH for later use by the installer. #~(let* ((inputs - '#$(list bash ;start subshells - connman ;call connmanctl + '#$(list bash ;start subshells + connman ;call connmanctl cryptsetup - dosfstools ;mkfs.fat - e2fsprogs ;mkfs.ext4 - lvm2-static ;dmsetup + dosfstools ;mkfs.fat + e2fsprogs ;mkfs.ext4 + lvm2-static ;dmsetup btrfs-progs - jfsutils ;jfs_mkfs - ntfs-3g ;mkfs.ntfs - xfsprogs ;mkfs.xfs - kbd ;chvt - util-linux ;mkwap + jfsutils ;jfs_mkfs + ntfs-3g ;mkfs.ntfs + xfsprogs ;mkfs.xfs + kbd ;chvt + util-linux ;mkwap nano shadow - tar ;dump - gzip ;dump + tar ;dump + gzip ;dump coreutils))) (with-output-to-port (%make-void-port "w") (lambda () -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 25 05:41:29 2024 Received: (at 73927) by debbugs.gnu.org; 25 Oct 2024 09:41:29 +0000 Received: from localhost ([127.0.0.1]:37337 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4Goy-00023k-I2 for submit@debbugs.gnu.org; Fri, 25 Oct 2024 05:41:28 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36434) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4Goo-00021P-SC for 73927@debbugs.gnu.org; Fri, 25 Oct 2024 05:41:19 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t4GoD-0003oL-PY; Fri, 25 Oct 2024 05:40:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=YWNSWcmINKhnMV8UXOKL7aNKl6P/JUbqiUnTq7ngZK4=; b=lZMi1J5AoiCAFQt1CFmD CdscRP8eR5OmBK1eRmSHT+hy71LDTEiU33XzEisZCOa5PyMNuz6SbkxTzDDwDmm4oGcXZPHJkTdAP hgs/vxr7QooO7WXz6tZaTzVZAYr5XSibRklHkYsha4ixmzUqd+7zWoJ1eHTBf2+WRCxud396cccMD yxwK91aQY0H/sNHHfvUticWZuuzzg/muo92/xg2eUN8G8WDBv2GeKUxuDEKASOv71cIM3lWu/GHdK C/Ml6QZP8OYsaEsXikpopX+uWLk4ncGADL7CnYEBork5Aq2nmiC0LYu5Wl1kUAxuJjanEAw8bL/FA 93iBRY3U+VjMZQ==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH v3 11/17] installer: Use "partitioning-page" consistently. Date: Fri, 25 Oct 2024 11:40:03 +0200 Message-ID: <20241025094011.8540-12-janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241025094011.8540-1-janneke@gnu.org> References: <20241025094011.8540-1-janneke@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Having `partition-page' function call `RUN-partititionING-page' where all other proxy functions call `RUN-' hurts my brain while refactoring. * gnu/installer/record.scm ()[partition-page]: Rename to... [partitioning-page]: ...this. * gnu/installer/newt.scm (partitioning-page, newt-installer): Update accordingly. * gnu/installer.scm (installer-steps): Update accordingly. Change-Id: I6b2f3459a3d0a7a89260224b7d8438676e3411ba --- gnu/installer.scm | 3 ++- gnu/installer/newt.scm | 5 +++-- gnu/installer/record.scm | 5 +++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/gnu/installer.scm b/gnu/installer.scm index 3dfcb7581a..3a05843cab 100644 --- a/gnu/installer.scm +++ b/gnu/installer.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2019, 2020, 2022 Ludovic Courtès ;;; Copyright © 2019, 2020 Tobias Geerinckx-Rice ;;; Copyright © 2020 Florian Pelz +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -312,7 +313,7 @@ (define (installer-steps) (id 'partition) (description (G_ "Partitioning")) (compute (lambda _ - ((installer-partition-page current-installer)))) + ((installer-partitioning-page current-installer)))) (configuration-formatter user-partitions->configuration)) (installer-step diff --git a/gnu/installer/newt.scm b/gnu/installer/newt.scm index e1c4453168..6d8ea35fff 100644 --- a/gnu/installer/newt.scm +++ b/gnu/installer/newt.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018, 2020 Mathieu Othacehe +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -193,7 +194,7 @@ (define (hostname-page) (define (user-page) (run-user-page)) -(define (partition-page) +(define (partitioning-page) (run-partitioning-page)) (define (services-page) @@ -220,7 +221,7 @@ (define newt-installer (timezone-page timezone-page) (hostname-page hostname-page) (user-page user-page) - (partition-page partition-page) + (partitioning-page partitioning-page) (services-page services-page) (welcome-page welcome-page) (parameters-menu parameters-menu) diff --git a/gnu/installer/record.scm b/gnu/installer/record.scm index 5e0264682f..334af44a0c 100644 --- a/gnu/installer/record.scm +++ b/gnu/installer/record.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018, 2020 Mathieu Othacehe ;;; Copyright © 2020 Florian Pelz +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -37,7 +38,7 @@ (define-module (gnu installer record) installer-timezone-page installer-hostname-page installer-user-page - installer-partition-page + installer-partitioning-page installer-services-page installer-welcome-page installer-parameters-menu @@ -86,7 +87,7 @@ (define-record-type* ;; procedure void -> void (user-page installer-user-page) ;; procedure void -> void - (partition-page installer-partition-page) + (partitioning-page installer-partitioning-page) ;; procedure void -> void (services-page installer-services-page) ;; procedure (logo #:pci-database) -> void -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 25 05:41:29 2024 Received: (at 73927) by debbugs.gnu.org; 25 Oct 2024 09:41:29 +0000 Received: from localhost ([127.0.0.1]:37339 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4Goz-00023s-2G for submit@debbugs.gnu.org; Fri, 25 Oct 2024 05:41:29 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36448) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4Gop-00021W-Nl for 73927@debbugs.gnu.org; Fri, 25 Oct 2024 05:41:20 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t4GoE-0003oY-KY; Fri, 25 Oct 2024 05:40:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=4OqNMgdUyx1UY5gvXxuwcZpY9gYVyyCNT8jhESXeCe0=; b=blsgfiQ3KoclBtkMx/xW Ax8dvwLWVgdQ7c26v7fzS1wGABkjD43E7vQUEPwPDVg7MCN9v8O+2Oavfbs5DSleqAvQOG6SSy6V5 Df0tPhf44fP2yd35vSeXgvES2pToR43t4KgaWz+i53RvTmfZhlt1yyyiovxYQqbuZ06HpMjwbM2iV 8yd6k4pio0Cne42soOMmEToODppIqobkOX4deAOG/4h+NJk0FrNohGrXOHFugYFjAz3+ka2R5RWAj ZfY6rGTnQ2ejRRBNLcvEMTSd4q4onbuoxuHhrWzrIIdom64R3dwExqOrBdwDCu7m/eTx8V6D8yihj ElQ3Y0FuW789gQ==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH v3 12/17] installer: Fix file-name typos. Date: Fri, 25 Oct 2024 11:40:04 +0200 Message-ID: <20241025094011.8540-13-janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241025094011.8540-1-janneke@gnu.org> References: <20241025094011.8540-1-janneke@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/installer/newt/page.scm (run-dump-page): Typo file-name. * gnu/installer/utils.scm (open-new-log-port): Likewise. Change-Id: I837991a0ee5054b3afa8328205e23ac6f9fbae8d --- gnu/installer/newt/page.scm | 7 ++++--- gnu/installer/utils.scm | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/gnu/installer/newt/page.scm b/gnu/installer/newt/page.scm index e1623a51fd..64a2916826 100644 --- a/gnu/installer/newt/page.scm +++ b/gnu/installer/newt/page.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2018 Mathieu Othacehe ;;; Copyright © 2019, 2020, 2022 Ludovic Courtès ;;; Copyright © 2019 Tobias Geerinckx-Rice +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -950,10 +951,10 @@ (define prompt-tag (make-prompt-tag)) ('exit-component (let ((result (map (match-lambda - ((edit checkbox filename) + ((edit checkbox file-name) (if (components=? edit argument) - (abort-to-prompt prompt-tag filename) - (cons filename (eq? #\x + (abort-to-prompt prompt-tag file-name) + (cons file-name (eq? #\x (checkbox-value checkbox)))))) components))) (destroy-form-and-pop form) diff --git a/gnu/installer/utils.scm b/gnu/installer/utils.scm index 6838410166..c722e9af8f 100644 --- a/gnu/installer/utils.scm +++ b/gnu/installer/utils.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018, 2020 Mathieu Othacehe ;;; Copyright © 2019, 2020, 2022 Ludovic Courtès +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -283,11 +284,11 @@ (define-syntax syslog (define (open-new-log-port) (define now (localtime (time-second (current-time)))) - (define filename + (define file-name (format #f "/tmp/installer.~a.log" (strftime "%F.%T" now))) - (open filename (logior O_RDWR - O_CREAT))) + (open file-name (logior O_RDWR + O_CREAT))) (define installer-log-port (let ((port #f)) -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 25 05:41:30 2024 Received: (at 73927) by debbugs.gnu.org; 25 Oct 2024 09:41:30 +0000 Received: from localhost ([127.0.0.1]:37341 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4Goz-00023z-Fn for submit@debbugs.gnu.org; Fri, 25 Oct 2024 05:41:30 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36450) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4Goq-00021e-Km for 73927@debbugs.gnu.org; Fri, 25 Oct 2024 05:41:21 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t4GoF-0003on-Gm; Fri, 25 Oct 2024 05:40:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=U4kA3Cn7YVnOWDyZQ7wvuUEs+F5B2zyc6Y0x9WZNyCo=; b=ODIGgLwRoFv/MymQInSu SU2I8cxX3OTu+mIDMBN/uwbONhEYBltWfihWoxRfC1x7eG/wz/xyLavioPNTlBtJWf9Mr1a4I1n9W LfirJMj4ASPNqFZ0FIb43FoZ8k3Qer9PgWjK8fcaYztNAwkdWIoD6y37aqazxLshreD5rKIA1CeYG n6hf2XoUGRwl/kBfQEqPqRKA5auLv5eze+fj1hMLhYJuWp16O0QbxTfyfO55Id6DgxyqPSMwv+oWY cqTyQYDiDHd9qksp57E7lOGAzQSt6JImV7TLizwqkaxtR1EqHEBEu6LYuDzepVlEuzRYvYnCQ+9DW 6LZHntH5wAaIWA==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH v3 13/17] installer: Use `%' for parameter %run-command-in-installer. Date: Fri, 25 Oct 2024 11:40:05 +0200 Message-ID: <20241025094011.8540-14-janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241025094011.8540-1-janneke@gnu.org> References: <20241025094011.8540-1-janneke@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/installer/utils.scm (run-command-in-installer): Rename to... (%run-command-in-installer): ...this. * gnu/installer.scm (installer-program): Update accordingly. * gnu/installer/parted.scm (remove-logical-devices, create-btrfs-file-system, create-ext4-file-system, create-fat16-file-system, create-fat32-file-system, create-jfs-file-system, create-ntfs-file-system, create-xfs-file-system, create-swap-partition, luks-format-and-open, luks-ensure-open, luks-close): Update accordingly. Change-Id: I96ebc59ebc85fd8ebccb0cc57130b4e7532d287f --- gnu/installer.scm | 2 +- gnu/installer/parted.scm | 27 ++++++++++++++------------- gnu/installer/utils.scm | 6 +++--- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/gnu/installer.scm b/gnu/installer.scm index 3a05843cab..21809e4259 100644 --- a/gnu/installer.scm +++ b/gnu/installer.scm @@ -465,7 +465,7 @@ (define steps (#$steps current-installer)) (installer-init current-installer) (lambda () (parameterize - ((run-command-in-installer + ((%run-command-in-installer (installer-run-command current-installer))) (catch #t (lambda () diff --git a/gnu/installer/parted.scm b/gnu/installer/parted.scm index dbdec1bba8..e59df3d8e6 100644 --- a/gnu/installer/parted.scm +++ b/gnu/installer/parted.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2019-2020, 2022, 2024 Ludovic Courtès ;;; Copyright © 2020 Tobias Geerinckx-Rice ;;; Copyright © 2022 Josselin Poiret +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -363,7 +364,7 @@ (define* (force-device-sync device) (define (remove-logical-devices) "Remove all active logical devices." - ((run-command-in-installer) "dmsetup" "remove_all")) + ((%run-command-in-installer) "dmsetup" "remove_all")) (define (installer-root-partition-path) "Return the root partition path, or #f if it could not be detected." @@ -1183,7 +1184,7 @@ (define (set-user-partitions-file-name user-partitions) (define (create-btrfs-file-system partition) "Create a btrfs file-system for PARTITION file-name." - ((run-command-in-installer) "mkfs.btrfs" "-f" partition)) + ((%run-command-in-installer) "mkfs.btrfs" "-f" partition)) (define (create-ext4-file-system partition) "Create an ext4 file-system for PARTITION file-name." @@ -1192,32 +1193,32 @@ (define (create-ext4-file-system partition) ;; up and adding new files would fail with ENOSPC despite there being plenty ;; of free space and inodes: ;; . - ((run-command-in-installer) "mkfs.ext4" "-F" partition + ((%run-command-in-installer) "mkfs.ext4" "-F" partition "-O" "large_dir")) (define (create-fat16-file-system partition) "Create a fat16 file-system for PARTITION file-name." - ((run-command-in-installer) "mkfs.fat" "-F16" partition)) + ((%run-command-in-installer) "mkfs.fat" "-F16" partition)) (define (create-fat32-file-system partition) "Create a fat32 file-system for PARTITION file-name." - ((run-command-in-installer) "mkfs.fat" "-F32" partition)) + ((%run-command-in-installer) "mkfs.fat" "-F32" partition)) (define (create-jfs-file-system partition) "Create a JFS file-system for PARTITION file-name." - ((run-command-in-installer) "jfs_mkfs" "-f" partition)) + ((%run-command-in-installer) "jfs_mkfs" "-f" partition)) (define (create-ntfs-file-system partition) "Create a JFS file-system for PARTITION file-name." - ((run-command-in-installer) "mkfs.ntfs" "-F" "-f" partition)) + ((%run-command-in-installer) "mkfs.ntfs" "-F" "-f" partition)) (define (create-xfs-file-system partition) "Create an XFS file-system for PARTITION file-name." - ((run-command-in-installer) "mkfs.xfs" "-f" partition)) + ((%run-command-in-installer) "mkfs.xfs" "-f" partition)) (define (create-swap-partition partition) "Set up swap area on PARTITION file-name." - ((run-command-in-installer) "mkswap" "-f" partition)) + ((%run-command-in-installer) "mkswap" "-f" partition)) (define (call-with-luks-key-file password proc) "Write PASSWORD in a temporary file and pass it to PROC as argument." @@ -1246,9 +1247,9 @@ (define (luks-format-and-open user-partition) (lambda (key-file) (installer-log-line "formatting and opening LUKS entry ~s at ~s" label file-name) - ((run-command-in-installer) "cryptsetup" "-q" "luksFormat" + ((%run-command-in-installer) "cryptsetup" "-q" "luksFormat" file-name key-file) - ((run-command-in-installer) "cryptsetup" "open" "--type" "luks" + ((%run-command-in-installer) "cryptsetup" "open" "--type" "luks" "--key-file" key-file file-name label))))) (define (luks-ensure-open user-partition) @@ -1262,14 +1263,14 @@ (define (luks-ensure-open user-partition) (lambda (key-file) (installer-log-line "opening LUKS entry ~s at ~s" label file-name) - ((run-command-in-installer) "cryptsetup" "open" "--type" "luks" + ((%run-command-in-installer) "cryptsetup" "open" "--type" "luks" "--key-file" key-file file-name label)))))) (define (luks-close user-partition) "Close the encrypted partition pointed by USER-PARTITION." (let ((label (user-partition-crypt-label user-partition))) (installer-log-line "closing LUKS entry ~s" label) - ((run-command-in-installer) "cryptsetup" "close" label))) + ((%run-command-in-installer) "cryptsetup" "close" label))) (define (format-user-partitions user-partitions) "Format the records in USER-PARTITIONS list with diff --git a/gnu/installer/utils.scm b/gnu/installer/utils.scm index c722e9af8f..170f036537 100644 --- a/gnu/installer/utils.scm +++ b/gnu/installer/utils.scm @@ -50,7 +50,7 @@ (define-module (gnu installer utils) run-external-command-with-handler/tty run-external-command-with-line-hooks run-command - run-command-in-installer + %run-command-in-installer syslog-port %syslog-line-hook @@ -222,13 +222,13 @@ (define succeeded? (pause) succeeded?) -(define run-command-in-installer +(define %run-command-in-installer (make-parameter (lambda (. args) (raise (condition (&serious) - (&message (message "run-command-in-installer not set"))))))) + (&message (message "%run-command-in-installer not set"))))))) ;;; -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 25 05:41:31 2024 Received: (at 73927) by debbugs.gnu.org; 25 Oct 2024 09:41:31 +0000 Received: from localhost ([127.0.0.1]:37343 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4Gp0-000247-4e for submit@debbugs.gnu.org; Fri, 25 Oct 2024 05:41:31 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36458) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4Gor-00021k-F7 for 73927@debbugs.gnu.org; Fri, 25 Oct 2024 05:41:22 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t4GoG-0003p0-C5; Fri, 25 Oct 2024 05:40:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=dxg4AghEitBtW8lq+fRNjTizJFjF4BUgn6y6LlotSic=; b=VbHHv6wqhkmyyFd/UVja LQ0U6shdePdGijr9G4hk4h1LbX9gtHjb5TUOh7PKHTSlSL2+YVwo9vXBIUyoEyqfohkGHNO9ARPec P3/nzuw7Ib8P5hizEMYgYgJJgdT9LMsQtwk99YOZO6KHBF3ekBotzSNiKlOgrX9sPgnezPV4FE5o9 3ajif8at2MNKaYlu6v2rIQ8sBjnB+6i7g9qFPFBwZeV2y0SfOVvn45izVyXHbRrQMDG86sAE5twDG 8DurvkoBJ8XMvoqYz7yGjX9eh3qMngckbwP2ALMY/OZZu97B37RPDIyXJWJuNYwv0skG7t2kk+1xg HRg3oN0k5lT83w==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH v3 14/17] installer: Add dry-run? Date: Fri, 25 Oct 2024 11:40:06 +0200 Message-ID: <20241025094011.8540-15-janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241025094011.8540-1-janneke@gnu.org> References: <20241025094011.8540-1-janneke@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) This allows running the installer without root privileges. Do something like ./pre-inst-env guix repl ,use (guix) ,use (gnu installer) (installer-program #:dry-run? #t) ,build $1 => "/gnu/store/...-installer-program" and run /gnu/store/...-installer-program * gnu/installer/newt.scm (locale-page): Add #:dry-run? parameter. (keymap-page): Likewise. * gnu/installer/newt/keymap.scm (run-keymap-page): Likewise. * gnu/installer/steps.scm (run-installer-steps): Likewise. Use it to skip writing to socket. * gnu/installer/newt/final.scm (run-final-page): Rename to... (run-final-page-install): ...this. (dry-run-final-page, run-final-page): New procedures. * gnu/installer/parted.scm (bootloader-configuration): Cater for empty user partitions. * gnu/installer/utils.scm (dry-run-command): New procedure. * gnu/installer.scm (compute-locale-step): Add #:dry-run? parameter. Use it to avoid actually applying locale. (compute-keymap-step): Add dry-run? parameter. Pass it to keymap-page. (installer-program): Add #:dry-run? parameter. If #:true avoid writing to /proc, use dry-run-command, skip sync and reboot, and pass dry-run? to... (installer-steps): ...here. Add #:dry-run? parameter. Use it to disable skip network, substitutes, partitioning pages, and pass it to... compute-locale-step, compute-keymap-step, and final-page. Change-Id: I0ff4c3b0a0c69539af617c27ba37654beed44619 --- gnu/installer.scm | 81 ++++++++++++++++++++------------ gnu/installer/newt.scm | 14 +++--- gnu/installer/newt/final.scm | 20 +++++++- gnu/installer/newt/keymap.scm | 5 +- gnu/installer/newt/locale.scm | 6 ++- gnu/installer/newt/partition.scm | 1 + gnu/installer/parted.scm | 29 +++++++----- gnu/installer/steps.scm | 16 +++++-- gnu/installer/utils.scm | 4 ++ 9 files changed, 116 insertions(+), 60 deletions(-) diff --git a/gnu/installer.scm b/gnu/installer.scm index 21809e4259..39a83c4455 100644 --- a/gnu/installer.scm +++ b/gnu/installer.scm @@ -134,7 +134,8 @@ (define apply-locale (define* (compute-locale-step #:key locales-name iso639-languages-name - iso3166-territories-name) + iso3166-territories-name + dry-run?) "Return a gexp that run the locale-page of INSTALLER, and install the selected locale. The list of locales, languages and territories passed to locale-page are computed in derivations named respectively LOCALES-NAME, @@ -177,8 +178,11 @@ (define (compiled-file-loader file name) ((installer-locale-page current-installer) #:supported-locales #$locales-loader #:iso639-languages #$iso639-loader - #:iso3166-territories #$iso3166-loader))) - (#$apply-locale result) + #:iso3166-territories #$iso3166-loader + #:dry-run? #$dry-run?))) + (if #$dry-run? + '() + (#$apply-locale result)) result)))) (define apply-keymap @@ -188,7 +192,7 @@ (define apply-keymap (kmscon-update-keymap (default-keyboard-model) layout variant options)))) -(define* (compute-keymap-step context) +(define (compute-keymap-step context dry-run?) "Return a gexp that runs the keymap-page of INSTALLER and install the selected keymap." #~(lambda (current-installer) @@ -200,15 +204,16 @@ (define* (compute-keymap-step context) "/share/X11/xkb/rules/base.xml"))) (lambda (models layouts) ((installer-keymap-page current-installer) - layouts '#$context))))) + layouts '#$context #$dry-run?))))) (and result (#$apply-keymap result)) result))) -(define (installer-steps) +(define* (installer-steps #:key dry-run?) (let ((locale-step (compute-locale-step #:locales-name "locales" #:iso639-languages-name "iso639-languages" - #:iso3166-territories-name "iso3166-territories")) + #:iso3166-territories-name "iso3166-territories" + #:dry-run? dry-run?)) (timezone-data #~(string-append #$tzdata "/share/zoneinfo/zone.tab"))) #~(lambda (current-installer) @@ -216,7 +221,7 @@ (define (installer-steps) (lambda () ((installer-parameters-page current-installer) (lambda _ - (#$(compute-keymap-step 'param) + (#$(compute-keymap-step 'param dry-run?) current-installer))))) (list ;; Ask the user to choose a locale among those supported by @@ -262,8 +267,10 @@ (define (installer-steps) (id 'keymap) (description (G_ "Keyboard mapping selection")) (compute (lambda _ - (#$(compute-keymap-step 'default) - current-installer))) + (if #$dry-run? + '("en" "US" #f) + (#$(compute-keymap-step 'default dry-run?) + current-installer)))) (configuration-formatter keyboard-layout->configuration)) ;; Ask the user to input a hostname for the system. @@ -280,14 +287,18 @@ (define (installer-steps) (id 'network) (description (G_ "Network selection")) (compute (lambda _ - ((installer-network-page current-installer))))) + (if #$dry-run? + '() + ((installer-network-page current-installer)))))) ;; Ask whether to enable substitute server discovery. (installer-step (id 'substitutes) (description (G_ "Substitute server discovery")) (compute (lambda _ - ((installer-substitutes-page current-installer))))) + (if #$dry-run? + '() + ((installer-substitutes-page current-installer)))))) ;; Prompt for users (name, group and home directory). (installer-step @@ -313,7 +324,9 @@ (define (installer-steps) (id 'partition) (description (G_ "Partitioning")) (compute (lambda _ - ((installer-partitioning-page current-installer)))) + (if #$dry-run? + '() + ((installer-partitioning-page current-installer))))) (configuration-formatter user-partitions->configuration)) (installer-step @@ -322,7 +335,7 @@ (define (installer-steps) (compute (lambda (result prev-steps) ((installer-final-page current-installer) - result prev-steps)))))))) + result prev-steps #$dry-run?)))))))) (define (provenance-sexp) "Return an sexp representing the currently-used channels, for logging @@ -343,7 +356,7 @@ (define (provenance-sexp) `(channel ,(channel-name channel) ,url ,(channel-commit channel)))) channels)))) -(define (installer-program) +(define* (installer-program #:key dry-run?) "Return a file-like object that runs the given INSTALLER." (define init-gettext ;; Initialize gettext support, so that installer messages can be @@ -377,7 +390,7 @@ (define set-installer-path (lambda () (set-path-environment-variable "PATH" '("bin" "sbin") inputs))))) - (define steps (installer-steps)) + (define steps (installer-steps #:dry-run? dry-run?)) (define modules (scheme-modules* (string-append (current-source-directory) "/..") @@ -425,9 +438,10 @@ (define installer-builder ;; Enable core dump generation. (setrlimit 'core #f #f) - (call-with-output-file "/proc/sys/kernel/core_pattern" - (lambda (port) - (format port %core-dump))) + (unless #$dry-run? + (call-with-output-file "/proc/sys/kernel/core_pattern" + (lambda (port) + (format port %core-dump)))) ;; Initialize gettext support so that installers can use ;; (guix i18n) module. @@ -466,24 +480,29 @@ (define steps (#$steps current-installer)) (lambda () (parameterize ((%run-command-in-installer - (installer-run-command current-installer))) + (if #$dry-run? + dry-run-command + (installer-run-command current-installer)))) (catch #t (lambda () (define results (run-installer-steps #:rewind-strategy 'menu #:menu-proc (installer-menu-page current-installer) - #:steps steps)) - - (match (result-step results 'final) - ('success - ;; We did it! Let's reboot! - (sync) - (stop-service 'root)) - (_ - ;; The installation failed, exit so that it is - ;; restarted by login. - #f))) + #:steps steps + #:dry-run? #$dry-run?)) + + (let ((result (result-step results 'final))) + (unless #$dry-run? + (match (result-step results 'final) + ('success + ;; We did it! Let's reboot! + (sync) + (stop-service 'root)) + (_ + ;; The installation failed, exit so that it is + ;; restarted by login. + #f))))) (const #f) (lambda (key . args) (installer-log-line "crashing due to uncaught exception: ~s ~s" diff --git a/gnu/installer/newt.scm b/gnu/installer/newt.scm index 6d8ea35fff..d53bc058b3 100644 --- a/gnu/installer/newt.scm +++ b/gnu/installer/newt.scm @@ -158,17 +158,19 @@ (define stop-sig (status:stop-sig result)) (term-signal term-sig) (stop-signal stop-sig))))))))))) -(define (final-page result prev-steps) - (run-final-page result prev-steps)) +(define (final-page result prev-steps dry-run?) + (run-final-page result prev-steps dry-run?)) (define* (locale-page #:key supported-locales iso639-languages - iso3166-territories) + iso3166-territories + dry-run?) (run-locale-page #:supported-locales supported-locales #:iso639-languages iso639-languages - #:iso3166-territories iso3166-territories)) + #:iso3166-territories iso3166-territories + #:dry-run? dry-run?)) (define (timezone-page zonetab) (run-timezone-page zonetab)) @@ -179,8 +181,8 @@ (define* (welcome-page logo #:key pci-database) (define (menu-page steps) (run-menu-page steps)) -(define* (keymap-page layouts context) - (run-keymap-page layouts #:context context)) +(define (keymap-page layouts context dry-run?) + (run-keymap-page layouts #:context context #:dry-run? dry-run?)) (define (network-page) (run-network-page)) diff --git a/gnu/installer/newt/final.scm b/gnu/installer/newt/final.scm index 9f950a0551..c4e53f6d79 100644 --- a/gnu/installer/newt/final.scm +++ b/gnu/installer/newt/final.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018, 2020 Mathieu Othacehe ;;; Copyright © 2019, 2020 Ludovic Courtès +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -106,7 +107,7 @@ (define* (run-install-shell locale (newt-resume) install-ok?)) -(define (run-final-page result prev-steps) +(define (run-final-page-install result prev-steps) (define (wait-for-clients) (unless (null? (current-clients)) (installer-log-line "waiting with clients before starting final step") @@ -133,3 +134,20 @@ (define (wait-for-clients) (if install-ok? (run-install-success-page) (run-install-failed-page)))) + +(define (dry-run-final-page result prev-steps) + (installer-log-line "proceeding with final step -- dry-run") + (let* ((configuration (format-configuration prev-steps result)) + (user-partitions (result-step result 'partition)) + (locale (result-step result 'locale)) + (users (result-step result 'user)) + (file (configuration->file configuration)) + (install-ok? (run-config-display-page #:locale locale))) + (if install-ok? + (run-install-success-page) + (run-install-failed-page)))) + +(define (run-final-page result prev-steps dry-run?) + (if dry-run? + (dry-run-final-page result prev-steps) + (run-final-page-install result prev-steps))) diff --git a/gnu/installer/newt/keymap.scm b/gnu/installer/newt/keymap.scm index 109ec55e0a..57f6d6530c 100644 --- a/gnu/installer/newt/keymap.scm +++ b/gnu/installer/newt/keymap.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2018, 2020 Mathieu Othacehe ;;; Copyright © 2019 Ludovic Courtès ;;; Copyright © 2020 Florian Pelz +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -153,7 +154,7 @@ (define (toggleable-latin-layout layout variant) "grp:alt_shift_toggle")) (list layout variant #f))) -(define* (run-keymap-page layouts #:key (context #f)) +(define* (run-keymap-page layouts #:key context dry-run?) "Run a page asking the user to select a keyboard layout and variant. LAYOUTS is a list of supported X11-KEYMAP-LAYOUT. For non-Latin keyboard layouts, a second layout and toggle options will be added automatically. Return a list @@ -201,7 +202,7 @@ (define (format-result layout variant) "xkeyboard-config"))))) (toggleable-latin-layout layout variant))) - (let* ((result (run-installer-steps #:steps keymap-steps)) + (let* ((result (run-installer-steps #:steps keymap-steps #:dry-run? dry-run?)) (layout (result-step result 'layout)) (variant (result-step result 'variant))) (and layout diff --git a/gnu/installer/newt/locale.scm b/gnu/installer/newt/locale.scm index a226b39ba6..0be9db449e 100644 --- a/gnu/installer/newt/locale.scm +++ b/gnu/installer/newt/locale.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018 Mathieu Othacehe ;;; Copyright © 2019 Ludovic Courtès +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -92,7 +93,8 @@ (define (run-modifier-page modifiers modifier->text) (define* (run-locale-page #:key supported-locales iso639-languages - iso3166-territories) + iso3166-territories + dry-run?) "Run a page asking the user to select a locale language and possibly territory, codeset and modifier. Use SUPPORTED-LOCALES as the list of glibc available locales. ISO639-LANGUAGES is an association list associating a @@ -212,4 +214,4 @@ (define locale-steps ;; step, turn the result into a glibc locale string and return it. (result->locale-string supported-locales - (run-installer-steps #:steps locale-steps))) + (run-installer-steps #:steps locale-steps #:dry-run? dry-run?))) diff --git a/gnu/installer/newt/partition.scm b/gnu/installer/newt/partition.scm index 37656696c1..48dd306080 100644 --- a/gnu/installer/newt/partition.scm +++ b/gnu/installer/newt/partition.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2018, 2019, 2022 Mathieu Othacehe ;;; Copyright © 2019, 2020 Ludovic Courtès ;;; Copyright © 2020 Tobias Geerinckx-Rice +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; diff --git a/gnu/installer/parted.scm b/gnu/installer/parted.scm index e59df3d8e6..b36b238d8b 100644 --- a/gnu/installer/parted.scm +++ b/gnu/installer/parted.scm @@ -1461,19 +1461,22 @@ (define (root-user-partition? partition) (define (bootloader-configuration user-partitions) "Return the bootloader configuration field for USER-PARTITIONS." - (let* ((root-partition (find root-user-partition? - user-partitions)) - (root-partition-disk (user-partition-disk-file-name root-partition))) - `((bootloader-configuration - ,@(if (efi-installation?) - `((bootloader grub-efi-bootloader) - (targets (list ,(default-esp-mount-point)))) - `((bootloader grub-bootloader) - (targets (list ,root-partition-disk)))) - - ;; XXX: Assume we defined the 'keyboard-layout' field of - ;; right above. - (keyboard-layout keyboard-layout))))) + (let ((root-partition (find root-user-partition? user-partitions))) + (match user-partitions + (() '()) + (_ + (let ((root-partition-disk (user-partition-disk-file-name + root-partition))) + `((bootloader-configuration + ,@(if (efi-installation?) + `((bootloader grub-efi-bootloader) + (targets (list ,(default-esp-mount-point)))) + `((bootloader grub-bootloader) + (targets (list ,root-partition-disk)))) + + ;; XXX: Assume we defined the 'keyboard-layout' field of + ;; right above. + (keyboard-layout keyboard-layout)))))))) (define (user-partition-missing-modules user-partitions) "Return the list of kernel modules missing from the default set of kernel diff --git a/gnu/installer/steps.scm b/gnu/installer/steps.scm index 0c505e40e4..de0a852f02 100644 --- a/gnu/installer/steps.scm +++ b/gnu/installer/steps.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018, 2019 Mathieu Othacehe ;;; Copyright © 2020-2022 Ludovic Courtès +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -84,7 +85,8 @@ (define-record-type* (define* (run-installer-steps #:key steps (rewind-strategy 'previous) - (menu-proc (const #f))) + (menu-proc (const #f)) + dry-run?) "Run the COMPUTE procedure of all records in STEPS sequentially, inside a the 'installer-step prompt. When aborted to with a parameter of 'abort, fallback to a previous install-step, accordingly to the @@ -191,10 +193,14 @@ (define* (run result #:key todo-steps done-steps) ;; prematurely. (sigaction SIGPIPE SIG_IGN) - (with-server-socket - (run '() - #:todo-steps steps - #:done-steps '()))) + (if dry-run? + (run '() + #:todo-steps steps + #:done-steps '()) + (with-server-socket + (run '() + #:todo-steps steps + #:done-steps '())))) (define (find-step-by-id steps id) "Find and return the step in STEPS whose id is equal to ID." diff --git a/gnu/installer/utils.scm b/gnu/installer/utils.scm index 170f036537..a8eb6cee83 100644 --- a/gnu/installer/utils.scm +++ b/gnu/installer/utils.scm @@ -49,6 +49,7 @@ (define-module (gnu installer utils) run-external-command-with-handler run-external-command-with-handler/tty run-external-command-with-line-hooks + dry-run-command run-command %run-command-in-installer @@ -222,6 +223,9 @@ (define succeeded? (pause) succeeded?) +(define (dry-run-command . args) + (format #t "dry-run-command: skipping: ~a\n" args)) + (define %run-command-in-installer (make-parameter (lambda (. args) -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 25 05:41:31 2024 Received: (at 73927) by debbugs.gnu.org; 25 Oct 2024 09:41:31 +0000 Received: from localhost ([127.0.0.1]:37345 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4Gp1-00024G-9c for submit@debbugs.gnu.org; Fri, 25 Oct 2024 05:41:31 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36462) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4Got-000229-Ig for 73927@debbugs.gnu.org; Fri, 25 Oct 2024 05:41:23 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t4GoI-0003pT-FO; Fri, 25 Oct 2024 05:40:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=Ppe8hOhH87LBYDPktBYAQOvm/YbN/xHgkOUNWh7OPSQ=; b=IUmZ6KNGyXk8VAnbLy5U NCNjYf33GxK4XHCmko/fsvFWzsKZ0y9V4tH8tA3SKl6EoGlmK9zJJxeQCGIVwFh0nUDtWKqHkNWgR Yv170rK1eaTaJjAdR+SJZO05jQDoG+SptYWpuQSQ9BTkRKS8YefuNSqeWqviPKQpnQmSHXYZCx2vP r/I3OBgbwwbwWsqgI979Xd8ZjZuK14Nmt4uzByvSgW0XMYaxVuP0sGxpk5HUJZiAqrXbPlk5VVDM3 5Zsz+iocLnSBwokrGYiqdx1SS/xTaGkTE9LuXDKYtMlQ4f4WWeHjjBHTkAGqYrdO4y1/bidJhlkBv lZR9ic0ETtqqew==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH v3 16/17] installer: Add static-networking template. Date: Fri, 25 Oct 2024 11:40:08 +0200 Message-ID: <20241025094011.8540-17-janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241025094011.8540-1-janneke@gnu.org> References: <20241025094011.8540-1-janneke@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/installer/services.scm (%system-services): Add static-networking-service-type. Change-Id: Iec6336f8d1f49e8b801e978d5c9eeb4f83a6e748 --- gnu/installer/services.scm | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/gnu/installer/services.scm b/gnu/installer/services.scm index d5a382606c..8b117d9a20 100644 --- a/gnu/installer/services.scm +++ b/gnu/installer/services.scm @@ -149,6 +149,28 @@ (define (%system-services) (name (G_ "DHCP client (dynamic IP address assignment)")) (type 'network-management) (snippet '((service dhcp-client-service-type)))) + (system-service + (name (G_ "Static networking service.")) + (type 'network-management) + (snippet `((service + static-networking-service-type + (list %loopback-static-networking + (static-networking + (addresses + (list + (network-address + (device "eth0") + ,(comment (G_ ";; Fill-in your IP.\n")) + (value "192.168.178.10/24")))) + (routes + (list (network-route + (destination "default") + ,(comment (G_ ";; Fill-in your gateway IP.\n")) + (gateway "192.168.178.1")))) + (requirement '()) + (provision '(networking)) + ,(comment (G_ ";; Fill-in your nameservers.\n")) + (name-servers '("192.168.178.1")))))))) ;; Dealing with documents. (system-service -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 25 05:41:33 2024 Received: (at 73927) by debbugs.gnu.org; 25 Oct 2024 09:41:33 +0000 Received: from localhost ([127.0.0.1]:37347 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4Gp1-00024N-Kn for submit@debbugs.gnu.org; Fri, 25 Oct 2024 05:41:33 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36460) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4Gos-00021v-Mo for 73927@debbugs.gnu.org; Fri, 25 Oct 2024 05:41:24 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t4GoH-0003pF-Ir; Fri, 25 Oct 2024 05:40:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=cik9CVsmJjap8bcjgn2MN6DAnz+/uPOiygiSifC6fas=; b=W2FNpen9ECSuj+fuLzjQ wEg+WABG3g5Mei2UvN2pxT5pWzFNTsaHvBdl38QMgbpZTI4Y0OGKOZE7ogx5Y8QwBnfcMfbgBnabM pn5pNHOlj1O/RKrtAHnYTI+Ylfpsp/E++ZrCX/BdlIWdPhjFiY0RGF0FRw8Kpq4JGdHBRhtB6knKU qno9gqQVpKGD++wEiVFsk8LK4feBss1Umn6LxBn4aJ9eoDUyuNOKDyyJ3ZPj0PoBIh0BbFfAh1W29 vi7r/xEt2gWH8gsYMwY8HbtoMPQxQ5IeEyIewhW6iHIyWJxJ/mGsGsrVGnD8lSw1drxR08PqymtTK wIDdP2e6+h9AEg==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH v3 15/17] installer: Add "Kernel" page to select the Hurd. Date: Fri, 25 Oct 2024 11:40:07 +0200 Message-ID: <20241025094011.8540-16-janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241025094011.8540-1-janneke@gnu.org> References: <20241025094011.8540-1-janneke@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) This adds a "Kernel" page to the installer with the option to (cross-) install the Hurd, if applicable (only available on x86 machines for now). * gnu/installer/newt.scm (kernel-page): New procedure. (newt-installer)[kernel-page]: New field. * gnu/installer/kernel.scm, gnu/installer/newt/kernel.scm: New files. * gnu/local.mk (INSTALLER_MODULES): Add them. * gnu/installer.scm (installer-steps): Use them to select kernel if applicable. * gnu/installer/newt/partition.scm (run-fs-type-page): Add ext2 for the hurd. (run-partitioning-page-partition): Remove `entire-encrypted' option when installing the Hurd. * gnu/installer/services.scm (system-services->configuration): Cater for the Hurd with %base-services/hurd, and with %base-packages/hurd that must always be set. (%system-services): Change to procedure. When installing the the Hurd, do not recommend `ntp-service-type' and USE `openssh-sans-x' package for `openssh-service-type'. (system-service-none): New variable. * gnu/installer/newt/services.scm (run-network-management-page): Include it when installing the Hurd. (run-desktop-environments-cbt-page): When installing the Hurd, recommend to not select any desktop enviroment. Update users. * gnu/installer/parted.scm (efi-installation?): Return #f when installing for the Hurd. (create-ext2-file-system): New procedure. (user-fs-type-name, user-fs-type->mount-type, partition-filesystem-user-type, format-user-partitions): Support `ext2'. ( partition->user-partition): Use `ext2' when installing the Hurd. (auto-partition!): Likewise. No swap partition when installing the Hurd. * gnu/installer/final.scm (install-system): Cater for cross installation of the Hurd. (bootloader-configuration): Use `grub-minimal-bootloader' when installing the Hurd. (user-partition-missing-modules): Cater for empty user-partitions. (initrd-configuration, user-partitions->configuration): Cater for the Hurd. * gnu/installer/steps.scm (format-configuration, configuration->file): Cater for the Hurd. * gnu/system/hurd.scm (%desktop-services/hurd): New variable. * gnu/installer/tests.scm (choose-kernel): New procedure. * gnu/tests/install.scm (gui-test-program): Use it. Change-Id: Ifafb27b8a2f933944c77223a27ec151757237e36 --- gnu/installer.scm | 14 +++++++ gnu/installer/final.scm | 10 ++++- gnu/installer/kernel.scm | 41 ++++++++++++++++++++ gnu/installer/newt.scm | 5 +++ gnu/installer/newt/kernel.scm | 45 ++++++++++++++++++++++ gnu/installer/newt/partition.scm | 9 ++++- gnu/installer/newt/services.scm | 31 +++++++++------ gnu/installer/parted.scm | 65 +++++++++++++++++++++++--------- gnu/installer/record.scm | 3 ++ gnu/installer/services.scm | 46 +++++++++++++++++----- gnu/installer/steps.scm | 14 ++++--- gnu/installer/tests.scm | 11 ++++++ gnu/local.mk | 2 + gnu/system/hurd.scm | 3 ++ gnu/tests/install.scm | 6 ++- 15 files changed, 256 insertions(+), 49 deletions(-) create mode 100644 gnu/installer/kernel.scm create mode 100644 gnu/installer/newt/kernel.scm diff --git a/gnu/installer.scm b/gnu/installer.scm index 39a83c4455..31c0ff7ff4 100644 --- a/gnu/installer.scm +++ b/gnu/installer.scm @@ -308,6 +308,18 @@ (define* (installer-steps #:key dry-run?) ((installer-user-page current-installer)))) (configuration-formatter users->configuration)) + ;; Ask the user to select the kernel for the system, + ;; for x86 systems only. + (installer-step + (id 'kernel) + (description (G_ "Kernel")) + (compute (lambda _ + (if (target-x86?) + ((installer-kernel-page current-installer)) + '()))) + (configuration-formatter (lambda (result) + (kernel->configuration result #$dry-run?)))) + ;; Ask the user to choose one or many desktop environment(s). (installer-step (id 'services) @@ -419,6 +431,7 @@ (define installer-builder (gnu installer dump) (gnu installer final) (gnu installer hostname) + (gnu installer kernel) (gnu installer locale) (gnu installer parted) (gnu installer services) @@ -431,6 +444,7 @@ (define installer-builder (gnu services herd) (guix i18n) (guix build utils) + (guix utils) ((system repl debug) #:select (terminal-width)) (ice-9 match) diff --git a/gnu/installer/final.scm b/gnu/installer/final.scm index 069426a3b8..5fcf223315 100644 --- a/gnu/installer/final.scm +++ b/gnu/installer/final.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018, 2020 Mathieu Othacehe ;;; Copyright © 2019, 2020, 2022 Ludovic Courtès +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -25,6 +26,7 @@ (define-module (gnu installer final) #:use-module (gnu services herd) #:use-module (guix build syscalls) #:use-module (guix build utils) + #:use-module (guix utils) #:use-module (gnu build accounts) #:use-module (gnu build install) #:use-module (gnu build linux-container) @@ -164,8 +166,12 @@ (define (assert-exit x) "/tmp/installer-system-init-options" read)) (const '()))) - (install-command (append (list "guix" "system" "init" - "--fallback") + (install-command (append `( "guix" "system" "init" + "--fallback" + ,@(if (target-hurd?) + '("--target=i586-pc-gnu" + "--skip-checks") + '())) options (list (%installer-configuration-file) (%installer-target-dir)))) diff --git a/gnu/installer/kernel.scm b/gnu/installer/kernel.scm new file mode 100644 index 0000000000..c82b06fb83 --- /dev/null +++ b/gnu/installer/kernel.scm @@ -0,0 +1,41 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2024 Janneke Nieuwenhuizen +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu installer kernel) + #:use-module (gnu system hurd) + #:use-module (guix read-print) + #:export (kernel->configuration)) + +(define-syntax-rule (G_ str) + ;; In this file, translatable strings are annotated with 'G_' so xgettext + ;; catches them, but translation happens later on at run time. + str) + +(define (kernel->configuration kernel dry-run?) + (if (equal? kernel "Hurd") + `((kernel %hurd-default-operating-system-kernel) + ,(comment (G_ ";; \"noide\" disables the gnumach IDE driver, enabling rumpdisk.\n")) + (kernel-arguments '("noide")) + (firmware '()) + (hurd hurd) + (locale-libcs (list glibc/hurd)) + (name-service-switch #f) + (essential-services (hurd-default-essential-services this-operating-system)) + (privileged-programs '()) + (setuid-programs %setuid-programs/hurd)) + '())) diff --git a/gnu/installer/newt.scm b/gnu/installer/newt.scm index d53bc058b3..1fe710340f 100644 --- a/gnu/installer/newt.scm +++ b/gnu/installer/newt.scm @@ -25,6 +25,7 @@ (define-module (gnu installer newt) #:use-module (gnu installer newt final) #:use-module (gnu installer newt parameters) #:use-module (gnu installer newt hostname) + #:use-module (gnu installer newt kernel) #:use-module (gnu installer newt keymap) #:use-module (gnu installer newt locale) #:use-module (gnu installer newt menu) @@ -193,6 +194,9 @@ (define (substitutes-page) (define (hostname-page) (run-hostname-page)) +(define (kernel-page) + (run-kernel-page)) + (define (user-page) (run-user-page)) @@ -216,6 +220,7 @@ (define newt-installer (exit-error exit-error) (final-page final-page) (keymap-page keymap-page) + (kernel-page kernel-page) (locale-page locale-page) (menu-page menu-page) (network-page network-page) diff --git a/gnu/installer/newt/kernel.scm b/gnu/installer/newt/kernel.scm new file mode 100644 index 0000000000..3117247312 --- /dev/null +++ b/gnu/installer/newt/kernel.scm @@ -0,0 +1,45 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2024 Janneke Nieuwenhuizen +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu installer newt kernel) + #:use-module (gnu installer newt page) + #:use-module (guix i18n) + #:use-module (guix utils) + #:export (run-kernel-page)) + +(define (run-kernel-page) + (let* ((kernels `(,@(if (target-x86?) '("Hurd") '()) + "Linux Libre")) + (result + (run-listbox-selection-page + #:title (G_ "Kernel") + #:info-text + (G_ "Please select a kernel. When in doubt, choose \"Linux Libre\". +The Hurd is offered as a technology preview and development aid; many packages \ +are not yet available in Guix, such as a desktop environment or even a windowing \ +system (X, Wayland).") + #:listbox-items kernels + #:listbox-item->text identity + #:listbox-default-item "Linux Libre" + #:button-text (G_ "Back") + #:button-callback-procedure + (lambda _ + (abort-to-prompt 'installer-step 'abort))))) + (when (equal? result "Hurd") + (%current-target-system "i586-pc-gnu")) + result)) diff --git a/gnu/installer/newt/partition.scm b/gnu/installer/newt/partition.scm index 48dd306080..b88393405b 100644 --- a/gnu/installer/newt/partition.scm +++ b/gnu/installer/newt/partition.scm @@ -26,6 +26,7 @@ (define-module (gnu installer newt partition) #:use-module (gnu installer newt page) #:use-module (gnu installer newt utils) #:use-module (guix i18n) + #:use-module (guix utils) #:use-module (ice-9 format) #:use-module (ice-9 match) #:use-module (srfi srfi-1) @@ -147,6 +148,8 @@ (define (run-fs-type-page) #:title (G_ "File-system type") #:listbox-items '(btrfs ext4 jfs xfs swap + ;; This is for the Hurd + ext2 ;; These lack basic Unix features. Their only use ;; on GNU is for interoperation, e.g., with UEFI. fat32 fat16 ntfs) @@ -767,7 +770,11 @@ (define (run-partitioning-page) (define (run-page devices) (let* ((items `((entire . ,(G_ "Guided - using the entire disk")) - (entire-encrypted . ,(G_ "Guided - using the entire disk with encryption")) + ,@(if (target-hurd?) + '() + `((entire-encrypted + . + ,(G_ "Guided - using the entire disk with encryption")))) (manual . ,(G_ "Manual")))) (result (run-listbox-selection-page #:info-text (G_ "Please select a partitioning method.") diff --git a/gnu/installer/newt/services.scm b/gnu/installer/newt/services.scm index d1035b6524..848683e8c7 100644 --- a/gnu/installer/newt/services.scm +++ b/gnu/installer/newt/services.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018 Mathieu Othacehe ;;; Copyright © 2019, 2020 Ludovic Courtès -;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen +;;; Copyright © 2020, 2024 Janneke Nieuwenhuizen ;;; Copyright © 2021 Tobias Geerinckx-Rice ;;; Copyright © 2021 Leo Famulari ;;; @@ -26,6 +26,7 @@ (define-module (gnu installer newt services) #:use-module (gnu installer newt page) #:use-module (gnu installer newt utils) #:use-module (guix i18n) + #:use-module (guix utils) #:use-module (srfi srfi-34) #:use-module (srfi srfi-35) #:export (run-services-page)) @@ -33,11 +34,13 @@ (define-module (gnu installer newt services) (define (run-desktop-environments-cbt-page) "Run a page allowing the user to choose between various desktop environments." - (let ((items (filter desktop-system-service? %system-services))) + (let ((items (filter desktop-system-service? (%system-services)))) (run-checkbox-tree-page - #:info-text (G_ "Please select the desktop environment(s) you wish to \ + #:info-text (if (target-hurd?) + (G_ "Currently, none of these is available for the Hurd.") + (G_ "Please select the desktop environment(s) you wish to \ install. If you select multiple desktop environments here, you will be able \ -to choose from them later when you log in.") +to choose from them later when you log in.")) #:title (G_ "Desktop environment") #:items items #:selection (map system-service-recommended? items) @@ -51,7 +54,7 @@ (define (run-networking-cbt-page) "Run a page allowing the user to select networking services." (let ((items (filter (lambda (service) (eq? 'networking (system-service-type service))) - %system-services))) + (%system-services)))) (run-checkbox-tree-page #:info-text (G_ "You can now select networking services to run on your \ system.") @@ -69,7 +72,7 @@ (define (run-printing-services-cbt-page) (let ((items (filter (lambda (service) (eq? 'document (system-service-type service))) - %system-services))) + (%system-services)))) (run-checkbox-tree-page #:info-text (G_ "You can now select the CUPS printing service to run on your \ system.") @@ -88,7 +91,7 @@ (define (run-console-services-cbt-page) (let ((items (filter (lambda (service) (eq? 'administration (system-service-type service))) - %system-services))) + (%system-services)))) (run-checkbox-tree-page #:title (G_ "Console services") #:info-text (G_ "Select miscellaneous services to run on your \ @@ -103,7 +106,11 @@ (define (run-console-services-cbt-page) (define (run-network-management-page) "Run a page to select among several network management methods." - (let ((title (G_ "Network management"))) + (let ((title (G_ "Network management")) + (items (filter (lambda (service) + (eq? 'network-management + (system-service-type service))) + (%system-services)))) (run-listbox-selection-page #:title title #:info-text (G_ "Choose the method to manage network connections. @@ -112,10 +119,10 @@ (define (run-network-management-page) client may be enough for a server.") #:info-textbox-width 70 #:listbox-height 7 - #:listbox-items (filter (lambda (service) - (eq? 'network-management - (system-service-type service))) - %system-services) + #:listbox-items `(,@items + ,@(if (target-hurd?) + (list system-service-none) + '())) #:listbox-item->text (compose G_ system-service-name) #:sort-listbox-items? #f #:button-text (G_ "Exit") diff --git a/gnu/installer/parted.scm b/gnu/installer/parted.scm index b36b238d8b..dfdd4ed60f 100644 --- a/gnu/installer/parted.scm +++ b/gnu/installer/parted.scm @@ -152,7 +152,7 @@ (define-record-type* (crypt-password user-partition-crypt-password ; (default #f)) (fs-type user-partition-fs-type - (default 'ext4)) + (default (if (target-hurd?) 'ext2 'ext4))) (bootable? user-partition-bootable? (default #f)) (esp? user-partition-esp? @@ -223,11 +223,13 @@ (define default-esp-mount-point (define (efi-installation?) "Return #t if an EFI installation should be performed, #f otherwise." - (file-exists? "/sys/firmware/efi")) + (and (file-exists? "/sys/firmware/efi") + (not (target-hurd?)))) (define (user-fs-type-name fs-type) "Return the name of FS-TYPE as specified by libparted." (case fs-type + ((ext2) "ext2") ((ext4) "ext4") ((btrfs) "btrfs") ((fat16) "fat16") @@ -240,6 +242,7 @@ (define (user-fs-type-name fs-type) (define (user-fs-type->mount-type fs-type) "Return the mount type of FS-TYPE." (case fs-type + ((ext2) "ext2") ((ext4) "ext4") ((btrfs) "btrfs") ((fat16) "vfat") @@ -255,6 +258,7 @@ (define (partition-filesystem-user-type partition) (and fs-type (let ((name (filesystem-type-name fs-type))) (cond + ((string=? name "ext2") 'ext2) ((string=? name "ext4") 'ext4) ((string=? name "btrfs") 'btrfs) ((string=? name "fat16") 'fat16) @@ -296,7 +300,7 @@ (define (partition->user-partition partition) (file-name (partition-get-path partition)) (disk-file-name (device-path device)) (fs-type (or (partition-filesystem-user-type partition) - 'ext4)) + (if (target-hurd?) 'ext2 'ext4))) (mount-point (and (esp-partition? partition) (default-esp-mount-point))) (bootable? (boot-partition? partition)) @@ -1053,7 +1057,7 @@ (define* (auto-partition! disk (size new-esp-size) (mount-point (default-esp-mount-point)))) (user-partition - (fs-type 'ext4) + (fs-type (if (target-hurd?) 'ext2 'ext4)) (bootable? #t) (bios-grub? #t) (size bios-grub-size)))) @@ -1065,13 +1069,13 @@ (define* (auto-partition! disk `(,@(if start-partition `(,start-partition) '()) - ,@(if encrypted? + ,@(if (or encrypted? (target-hurd?)) '() `(,(user-partition (fs-type 'swap) (size swap-size)))) ,(user-partition - (fs-type 'ext4) + (fs-type (if (target-hurd?) 'ext2 'ext4)) (bootable? has-extended?) (crypt-label (and encrypted? "cryptroot")) (size "100%") @@ -1083,7 +1087,7 @@ (define* (auto-partition! disk `(,start-partition) '()) ,(user-partition - (fs-type 'ext4) + (fs-type (if (target-hurd?) 'ext2 'ext4)) (bootable? has-extended?) (crypt-label (and encrypted? "cryptroot")) (size "33%") @@ -1105,7 +1109,7 @@ (define* (auto-partition! disk (type (if has-extended? 'logical 'normal)) - (fs-type 'ext4) + (fs-type (if (target-hurd?) 'ext2 'ext4)) (crypt-label (and encrypted? "crypthome")) (size "100%") (mount-point "/home"))))))) @@ -1186,6 +1190,15 @@ (define (create-btrfs-file-system partition) "Create a btrfs file-system for PARTITION file-name." ((%run-command-in-installer) "mkfs.btrfs" "-f" partition)) +(define (create-ext2-file-system partition) + "Create an ext2 file-system for PARTITION file-name, when TARGET-HURD?, +for the Hurd." + (apply (%run-command-in-installer) + `("mkfs.ext2" ,@(if (target-hurd?) + '("-o" "hurd") + '()) + "-F" ,partition))) + (define (create-ext4-file-system partition) "Create an ext4 file-system for PARTITION file-name." ;; Enable the 'large_dir' feature so users can have a store of several TiBs. @@ -1291,6 +1304,10 @@ (define (format-user-partitions user-partitions) (and need-formatting? (not (eq? type 'extended)) (create-btrfs-file-system file-name))) + ((ext2) + (and need-formatting? + (not (eq? type 'extended)) + (create-ext2-file-system file-name))) ((ext4) (and need-formatting? (not (eq? type 'extended)) @@ -1463,7 +1480,11 @@ (define (bootloader-configuration user-partitions) "Return the bootloader configuration field for USER-PARTITIONS." (let ((root-partition (find root-user-partition? user-partitions))) (match user-partitions - (() '()) + (() (if (target-hurd?) + '(bootloader-configuration + (bootloader grub-minimal-bootloader) + (targets "/dev/sdaX")) + '())) (_ (let ((root-partition-disk (user-partition-disk-file-name root-partition))) @@ -1471,7 +1492,9 @@ (define (bootloader-configuration user-partitions) ,@(if (efi-installation?) `((bootloader grub-efi-bootloader) (targets (list ,(default-esp-mount-point)))) - `((bootloader grub-bootloader) + `((bootloader ,(if (target-hurd?) + 'grub-minimal-bootloader + 'grub-bootloader)) (targets (list ,root-partition-disk)))) ;; XXX: Assume we defined the 'keyboard-layout' field of @@ -1491,22 +1514,28 @@ (define (user-partition-missing-modules user-partitions) (const '()))) (delete-duplicates (map user-partition-file-name - (cons root devices))))))) + (filter identity + (cons root devices)))))))) (define (initrd-configuration user-partitions) "Return an 'initrd-modules' field with everything needed for USER-PARTITIONS, or return nothing." - (match (user-partition-missing-modules user-partitions) - (() - '()) - ((modules ...) - `((initrd-modules (append ',modules - %base-initrd-modules)))))) + (if (target-hurd?) + '((initrd #f) + (initrd-modules '())) + (match (user-partition-missing-modules user-partitions) + (() + '()) + ((modules ...) + `((initrd-modules (append ',modules + %base-initrd-modules))))))) (define (user-partitions->configuration user-partitions) "Return the configuration field for USER-PARTITIONS." (let* ((swap-user-partitions (find-swap-user-partitions user-partitions)) - (swap-devices (map user-partition-file-name swap-user-partitions)) + (swap-devices (if (target-hurd?) + '() + (map user-partition-file-name swap-user-partitions))) (encrypted-partitions (filter user-partition-crypt-label user-partitions))) `((bootloader ,@(bootloader-configuration user-partitions)) diff --git a/gnu/installer/record.scm b/gnu/installer/record.scm index 334af44a0c..22adad279c 100644 --- a/gnu/installer/record.scm +++ b/gnu/installer/record.scm @@ -30,6 +30,7 @@ (define-module (gnu installer record) installer-exit installer-exit-error installer-final-page + installer-kernel-page installer-keymap-page installer-locale-page installer-menu-page @@ -69,6 +70,8 @@ (define-record-type* (exit-error installer-exit-error) ;; procedure void -> void (final-page installer-final-page) + ;; procedure void -> void + (kernel-page installer-kernel-page) ;; procedure (layouts context) -> (list layout variant options) (keymap-page installer-keymap-page) ;; procedure: (#:key supported-locales iso639-languages iso3166-territories) diff --git a/gnu/installer/services.scm b/gnu/installer/services.scm index 1cb9dc579c..d5a382606c 100644 --- a/gnu/installer/services.scm +++ b/gnu/installer/services.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018 Mathieu Othacehe ;;; Copyright © 2019, 2022 Ludovic Courtès -;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen +;;; Copyright © 2020, 2024 Janneke Nieuwenhuizen ;;; Copyright © 2021 Tobias Geerinckx-Rice ;;; Copyright © 2021 Leo Famulari ;;; Copyright © 2023 Denys Nykula @@ -24,6 +24,7 @@ (define-module (gnu installer services) #:use-module (guix records) #:use-module (guix read-print) + #:use-module (guix utils) #:use-module (ice-9 match) #:use-module (srfi srfi-1) #:export (system-service? @@ -34,6 +35,7 @@ (define-module (gnu installer services) system-service-packages desktop-system-service? + system-service-none %system-services system-services->configuration)) @@ -55,7 +57,13 @@ (define-record-type* (packages system-service-packages ;list of sexps (default '()))) -(define %system-services +(define system-service-none + (system-service + (name (G_ "None")) + (type 'network-management) + (snippet '()))) + +(define (%system-services) (let-syntax ((desktop-environment (syntax-rules () ((_ fields ...) (system-service @@ -105,7 +113,11 @@ (define %system-services (G_ "\ ;; To configure OpenSSH, pass an 'openssh-configuration' ;; record as a second argument to 'service' below.\n")) - (service openssh-service-type)))) + ,(if (target-hurd?) + '(service openssh-service-type + (openssh-configuration + (openssh openssh-sans-x))) + '(service openssh-service-type))))) (system-service (name (G_ "Tor anonymous network router")) (type 'networking) @@ -115,7 +127,7 @@ (define %system-services (system-service (name (G_ "Network time service (NTP), to set the clock automatically")) (type 'administration) - (recommended? #t) + (recommended? (not (target-hurd?))) (snippet '((service ntp-service-type)))) (system-service (name (G_ "GPM mouse daemon, to use the mouse on the console")) @@ -154,8 +166,12 @@ (define (system-services->configuration services) (packages (append-map system-service-packages services)) (desktop? (find desktop-system-service? services)) (base (if desktop? - '%desktop-services - '%base-services)) + (if (target-hurd?) + '%desktop-services/hurd + '%desktop-services) + (if (target-hurd?) + '%base-services/hurd + '%base-services))) (native-console-font (match (getenv "LANGUAGE") ((or "be" "bg" "el" "eo" "kk" "ky" "mk" "mn" "ru" "sr" "tg" "uk") @@ -181,18 +197,28 @@ (define (system-services->configuration services) (if (null? snippets) `(,@(if (null? packages) - '() + (if (target-hurd?) + `(,@package-heading + (packages %base-packages/hurd)) + '()) `(,@package-heading (packages (append (list ,@packages) - %base-packages)))) + ,(if (target-hurd?) + '%base-packages/hurd + '%base-packages))))) ,@service-heading (services ,services)) `(,@(if (null? packages) - '() + (if (target-hurd?) + `(,@package-heading + (packages %base-packages/hurd)) + '()) `(,@package-heading (packages (append (list ,@packages) - %base-packages)))) + ,(if (target-hurd?) + '%base-packages/hurd + '%base-packages))))) ,@service-heading (services (append (list ,@snippets diff --git a/gnu/installer/steps.scm b/gnu/installer/steps.scm index de0a852f02..34dd14c9d5 100644 --- a/gnu/installer/steps.scm +++ b/gnu/installer/steps.scm @@ -23,6 +23,7 @@ (define-module (gnu installer steps) #:use-module (guix build utils) #:use-module (guix i18n) #:use-module (guix read-print) + #:use-module (guix utils) #:use-module (gnu installer utils) #:use-module (ice-9 match) #:use-module (srfi srfi-1) @@ -240,17 +241,20 @@ (define (format-configuration steps results) ,(comment (G_ "\ ;; Indicate which modules to import to access the variables ;; used in this configuration.\n")) - (use-modules (gnu)) + ,@(if (target-hurd?) + '((use-modules (gnu) (gnu system hurd)) + (use-package-modules hurd ssh)) + '((use-modules (gnu)))) (use-service-modules cups desktop networking ssh xorg)))) `(,@modules ,(vertical-space 1) (operating-system ,@configuration)))) (define* (configuration->file configuration - #:key (filename (%installer-configuration-file))) - "Write the given CONFIGURATION to FILENAME." - (mkdir-p (dirname filename)) - (call-with-output-file filename + #:key (file-name (%installer-configuration-file))) + "Write the given CONFIGURATION to FILE-NAME." + (mkdir-p (dirname file-name)) + (call-with-output-file file-name (lambda (port) ;; TRANSLATORS: This is a comment within a Scheme file. Each line must ;; start with ";; " (two semicolons and a space). Please keep line diff --git a/gnu/installer/tests.scm b/gnu/installer/tests.scm index 8785cd9a9f..a9a5d5d988 100644 --- a/gnu/installer/tests.scm +++ b/gnu/installer/tests.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2020 Ludovic Courtès ;;; Copyright © 2020 Mathieu Othacehe +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -35,6 +36,7 @@ (define-module (gnu installer tests) choose-locale+keyboard enter-host-name+passwords + choose-kernel choose-services choose-partitioning start-installation @@ -211,6 +213,15 @@ (define* (enter-host-name+passwords port (password ,password))) names passwords)))))) +(define* (choose-kernel port #:key (kernel "Linux Libre")) + "Converse over PORT with the guided installer to choose the specified +KERNEL." + (converse port + ((list-selection (title "Kernel") + (multiple-choices? #f) + (items _)) + kernel))) + (define* (choose-services port #:key (choose-desktop-environment? (const #f)) diff --git a/gnu/local.mk b/gnu/local.mk index 0a1357f114..d0c9ca595e 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -862,6 +862,7 @@ INSTALLER_MODULES = \ %D%/installer/final.scm \ %D%/installer/hardware.scm \ %D%/installer/hostname.scm \ + %D%/installer/kernel.scm \ %D%/installer/keymap.scm \ %D%/installer/locale.scm \ %D%/installer/newt.scm \ @@ -880,6 +881,7 @@ INSTALLER_MODULES = \ %D%/installer/newt/final.scm \ %D%/installer/newt/parameters.scm \ %D%/installer/newt/hostname.scm \ + %D%/installer/newt/kernel.scm \ %D%/installer/newt/keymap.scm \ %D%/installer/newt/locale.scm \ %D%/installer/newt/menu.scm \ diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm index 283bae6f10..9a351529e8 100644 --- a/gnu/system/hurd.scm +++ b/gnu/system/hurd.scm @@ -48,6 +48,7 @@ (define-module (gnu system hurd) #:export (%base-packages/hurd %base-services/hurd %base-services+qemu-networking/hurd + %desktop-services/hurd %hurd-default-operating-system %hurd-default-operating-system-kernel %setuid-programs/hurd)) @@ -107,6 +108,8 @@ (define %base-services+qemu-networking/hurd %qemu-static-networking)) %base-services/hurd)) +(define %desktop-services/hurd %base-services/hurd) + (define %setuid-programs/hurd ;; Default set of setuid-root programs. (map file-like->setuid-program diff --git a/gnu/tests/install.scm b/gnu/tests/install.scm index 36dbd9111f..c8dccd38b0 100644 --- a/gnu/tests/install.scm +++ b/gnu/tests/install.scm @@ -3,7 +3,7 @@ ;;; Copyright © 2017, 2019, 2021 Tobias Geerinckx-Rice ;;; Copyright © 2020 Mathieu Othacehe ;;; Copyright © 2020 Danny Milosavljevic -;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen +;;; Copyright © 2020, 2024 Janneke Nieuwenhuizen ;;; Copyright © 2020, 2021, 2022 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. @@ -1869,6 +1869,10 @@ (define-syntax-rule (marionette-eval* exp marionette) #$marionette) (screenshot "installer-services.ppm") + (when #$(target-x86?) + (marionette-eval* '(choose-kernel installer-socket) #$marionette) + (screenshot "installer-kernel.ppm")) + (marionette-eval* '(choose-services installer-socket #:choose-desktop-environment? (const #$desktop?) -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 25 05:41:34 2024 Received: (at 73927) by debbugs.gnu.org; 25 Oct 2024 09:41:34 +0000 Received: from localhost ([127.0.0.1]:37349 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4Gp3-00024X-DO for submit@debbugs.gnu.org; Fri, 25 Oct 2024 05:41:33 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36476) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4Gou-00022N-Je for 73927@debbugs.gnu.org; Fri, 25 Oct 2024 05:41:25 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t4GoJ-0003pg-Gi; Fri, 25 Oct 2024 05:40:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=+STQwkKh3SyvccoJDqQkts7U4WNa17HyCQ6CzqURmME=; b=OQehZTuTw7uxEuBS48+D nwHksk2R5cQodiWMNecm4VmGEXSe6c4wyv+roLPO0MN563lXS2gDCHWjC/26eQlOn50oqiXBIjbrp GTxZw2HbEhp3N/PTg5QJugtQBt92u4xAlvKYSavd5qcwoNqlRNWvSWF1QzstcPrf8rQxgcHW5o2Oh TrdO7CL8mJiVA7xfF9DeXWozHXqFB71YadS+EDFLLJb7lo/VA4PChPHj7GgKnw51wv/bN09lY+JIN ILc4fiQdBQgSZQyVRzQuoDx1ij1SGPdWu4rNxeUOZoI1NaBLJqjijJ2IEVm18o6hbGe2qC8xtgIAl 5UAbD6gHRC2ymA==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH v3 17/17] installer: Support dry-run from Guile via store. Date: Fri, 25 Oct 2024 11:40:09 +0200 Message-ID: <20241025094011.8540-18-janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241025094011.8540-1-janneke@gnu.org> References: <20241025094011.8540-1-janneke@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) This supports running the installer quasi-directly from Guile by only building a Guile installer-script in the store. Do something like: ./pre-inst-env guile -c '((@ (gnu installer) run-installer) #:dry-run? #t)' or and BE VERY CAREFUL WHEN NOT USING #:DRY-RUN #T! sudo -E ./pre-inst-env guile -c '((@ (gnu installer) run-installer))' for this to work, you also need connman. * gnu/installer.scm (installer-script, run-installer): New procedures. Change-Id: I8cc1746845ec99f738e35fa91bb2342a674cfa88 --- gnu/installer.scm | 84 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 82 insertions(+), 2 deletions(-) diff --git a/gnu/installer.scm b/gnu/installer.scm index 31c0ff7ff4..981687990a 100644 --- a/gnu/installer.scm +++ b/gnu/installer.scm @@ -21,10 +21,14 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu installer) + #:use-module (guix build utils) + #:use-module (guix derivations) #:use-module (guix discovery) - #:use-module (guix packages) #:use-module (guix gexp) #:use-module (guix modules) + #:use-module (guix monads) + #:use-module (guix packages) + #:use-module (guix store) #:use-module (guix utils) #:use-module (guix ui) #:use-module ((guix self) #:select (make-config.scm)) @@ -56,7 +60,9 @@ (define-module (gnu installer) #:use-module (ice-9 match) #:use-module (srfi srfi-1) #:use-module (web uri) - #:export (installer-program)) + #:export (installer-program + installer-steps + run-installer)) (define module-to-import? ;; Return true for modules that should be imported. For (gnu system …) and @@ -562,3 +568,77 @@ (define action (execl #$(program-file "installer-real" installer-builder #:guile guile-3.0-latest) "installer-real")))) + +(define* (installer-script #:key dry-run? + (steps (installer-steps #:dry-run? dry-run?))) + (program-file + "installer-script" + #~(begin + (use-modules (gnu installer) + (gnu installer record) + (gnu installer keymap) + (gnu installer steps) + (gnu installer dump) + (gnu installer final) + (gnu installer hostname) + (gnu installer kernel) + (gnu installer locale) + (gnu installer parted) + (gnu installer services) + (gnu installer timezone) + (gnu installer user) + (gnu installer utils) + (gnu installer newt) + ((gnu installer newt keymap) + #:select (keyboard-layout->configuration)) + (gnu services herd) + (guix i18n) + (guix build utils) + (guix utils) + ((system repl debug) + #:select (terminal-width)) + (ice-9 match) + (ice-9 textual-ports)) + (terminal-width 200) + (let* ((current-installer newt-installer) + (steps (#$steps current-installer))) + (catch #t + (lambda _ + ((installer-init current-installer)) + (parameterize ((%run-command-in-installer + (if #$dry-run? + dry-run-command + (installer-run-command current-installer))) + (%installer-configuration-file + (if #$dry-run? + "config.scm" + (%installer-configuration-file)))) + (let ((results (run-installer-steps + #:rewind-strategy 'menu + #:menu-proc + (installer-menu-page current-installer) + #:steps steps + #:dry-run? #$dry-run?))) + (result-step results 'final)))) + (const #f) + (lambda (key . args) + (sleep 10) + ((installer-exit current-installer)) + (display-backtrace (make-stack #t) (current-error-port)) + (apply throw key args))))))) + +(define* (run-installer #:key dry-run?) + "To run the installer from Guile without building it: + ./pre-inst-env guile -c '((@ (gnu installer) run-installer) #:dry-run? #t)' +when using #:dry-run? #t, no root access is required and the LOCALE, KEYMAP, +and PARTITION pages are skipped." + (let* ((script (installer-script #:dry-run? dry-run?)) + (store (open-connection)) + (drv (run-with-store store + (lower-object script))) + (program (match (derivation->output-paths drv) + ((("out" . program)) program))) + (outputs (build-derivations store (list drv)))) + (close-connection store) + (format #t "running installer: ~a\n" program) + (invoke "./pre-inst-env" "guile" program))) -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 30 10:33:21 2024 Received: (at 73927) by debbugs.gnu.org; 30 Oct 2024 14:33:22 +0000 Received: from localhost ([127.0.0.1]:35289 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69lB-0003u9-4w for submit@debbugs.gnu.org; Wed, 30 Oct 2024 10:33:21 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36096) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69l7-0003ta-60 for 73927@debbugs.gnu.org; Wed, 30 Oct 2024 10:33:19 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t69iv-0003KB-25; Wed, 30 Oct 2024 10:31:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=GlDcaK5NARVQunEm9gkVgVIBJqWokyWWMunlQ9jKm9I=; b=IHy9jPyyfi5Xas +TG7pXaVfMFXT9k7YHaOrMCeJH9mgQqjsXAohfVeADHYmsWH1NE2PyC5LN7WSdppbM0et5RZ95Zww SE0GeFtQ/P2T7b4PNIpx0NInu+9jk/PkNDWQaWbflyTLU1dNnh9LmO65UbAoyeiTNPHYfPEE7LCig xmY4Z9TzuEsMjMFoVAUEyOdckUJAl//9dDBWDAPhdD6wJz+NEUxdX4Rh2ic+rbS4sNd0JUEWHXDi+ 5UFMYNEeds+8aEZMoK7AXRjLJ1yxithizXUibIw9IRhFj25XEkeuyaTyZxSv/gJD8fJytWMzchsf9 9glVAlRzLnMJOhklNdXA==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH v4 00/18] Installer support for (cross) installing the Hurd. Date: Wed, 30 Oct 2024 15:30:29 +0100 Message-ID: X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Debbugs-Cc: Josselin Poiret , Ludovic Courtès , Mathieu Othacehe Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 Cc: Janneke Nieuwenhuizen X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) From: "Janneke Nieuwenhuizen" New in this series: * reconfigure: Use native bootloader package for running the installer, * default to "msdos" partion table, * do not suggest/create boot partition, * remove "--skip-checks" from guix system init call, * default to part:1:device:wd0 instead of failing when no permission to read /dev (resurrecting tests/guix-system.sh), which lead to the first fresh install that actually boots without any extra tinkering on my x60 using this --8<---------------cut here---------------start------------->8--- ./pre-inst-env guix system image -t iso9660 --system=i686-linux gnu/system/install.scm --8<---------------cut here---------------end--------------->8--- installer. I've updated the hurd-team branch. Greetings, Janneke Janneke Nieuwenhuizen (18): gnu: guile-fibers: Fix cross-build for the Hurd. reconfigure: Use native bootloader package for running the installer. guix system: When installing the Hurd, create essential devices. bootloader: grub: Remove hardcoded partition number for the Hurd. system: hurd: Remove qemu networking from %base-services/hurd. system: hurd: Add swap-services to hurd-default-essential-services. gnu: hurd: Support second boot. hurd-boot: Support second boot. maint: Add installer dependencies to the manifest. installer: Remove unused (newt) imports. installer: Align comments. installer: Use "partitioning-page" consistently. installer: Fix file-name typos. installer: Use `%' for parameter %run-command-in-installer. installer: Add dry-run? installer: Add "Kernel" page to select the Hurd. installer: Add static-networking template. installer: Support dry-run from Guile via store. gnu/bootloader/grub.scm | 19 ++- gnu/build/file-systems.scm | 58 +++++++ gnu/build/hurd-boot.scm | 21 ++- gnu/installer.scm | 207 ++++++++++++++++++------ gnu/installer/final.scm | 9 +- gnu/installer/kernel.scm | 41 +++++ gnu/installer/newt.scm | 24 ++- gnu/installer/newt/ethernet.scm | 1 - gnu/installer/newt/final.scm | 20 ++- gnu/installer/newt/kernel.scm | 45 ++++++ gnu/installer/newt/keymap.scm | 6 +- gnu/installer/newt/locale.scm | 7 +- gnu/installer/newt/page.scm | 7 +- gnu/installer/newt/parameters.scm | 1 - gnu/installer/newt/partition.scm | 11 +- gnu/installer/newt/services.scm | 32 ++-- gnu/installer/parted.scm | 141 ++++++++++------ gnu/installer/record.scm | 8 +- gnu/installer/services.scm | 68 ++++++-- gnu/installer/steps.scm | 30 ++-- gnu/installer/tests.scm | 11 ++ gnu/installer/utils.scm | 17 +- gnu/local.mk | 3 + gnu/packages/guile-xyz.scm | 11 +- gnu/packages/hurd.scm | 6 +- gnu/packages/patches/hurd-startup.patch | 82 ++++++++++ gnu/services/base.scm | 20 ++- gnu/services/virtualization.scm | 4 +- gnu/system.scm | 13 +- gnu/system/examples/bare-hurd.tmpl | 10 +- gnu/system/hurd.scm | 26 +-- gnu/system/images/hurd.scm | 2 +- gnu/tests/install.scm | 6 +- guix/scripts/system.scm | 6 +- guix/scripts/system/reconfigure.scm | 3 +- manifest.scm | 7 +- 36 files changed, 775 insertions(+), 208 deletions(-) create mode 100644 gnu/installer/kernel.scm create mode 100644 gnu/installer/newt/kernel.scm create mode 100644 gnu/packages/patches/hurd-startup.patch base-commit: d6f775c30c6f47e174f6110d1089edc6315600e4 -- Janneke Nieuwenhuizen | GNU LilyPond https://LilyPond.org Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 30 10:33:25 2024 Received: (at 73927) by debbugs.gnu.org; 30 Oct 2024 14:33:25 +0000 Received: from localhost ([127.0.0.1]:35295 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69lB-0003uB-Pp for submit@debbugs.gnu.org; Wed, 30 Oct 2024 10:33:25 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36108) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69l7-0003tb-5x for 73927@debbugs.gnu.org; Wed, 30 Oct 2024 10:33:19 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t69iw-0003KJ-OW; Wed, 30 Oct 2024 10:31:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=q6txwJN9CfhV3EkWBRA1XzncYRUDlSbnzIZ2HGYsg08=; b=aaVdvn94dl9NNshGOscx yRapAq+RMxzkucjBcICJftz7b9/MiZc/41/kw2FxSf7iPx5Dd4MrlRgEHMMIf2S2dxJ/huUWSsCgj 6ilYPOS75R/z6yOgs3nGT8ASMLQv4Dr/9W+VdFwobZIThLLPMOFGdeFJilC2w8uShqVul9xbCWBsz TcOvz/dkIxRu0uisochLe/TxLCpLYpppJG8mDQ5TpImaNheniR0DGpsFQpRvKZadzweKsnDQuCjCC PTxuaJgljoSDoKPhKveZ8c5+KQt4lcohu27zWxDRkJUxg4CktPD0Tao1HC8Xyqrb+MKpptMuJX4Td fiTb+ZkYmwnyTg==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH v4 01/18] gnu: guile-fibers: Fix cross-build for the Hurd. Date: Wed, 30 Oct 2024 15:30:30 +0100 Message-ID: <839cf9a07b8a3b4b085058cc669040e4dbc6b42f.1730296564.git.janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/guile-xyz.scm (guile-fibers): When cross-building for the Hurd, add "fix-env" phase. Change-Id: Iebe12941bbfb2f5a6208f9364115e95f10e82ed6 --- gnu/packages/guile-xyz.scm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm index 5f34ea98a6..06d3b59dc3 100644 --- a/gnu/packages/guile-xyz.scm +++ b/gnu/packages/guile-xyz.scm @@ -9,7 +9,7 @@ ;;; Copyright © 2016, 2017, 2021 Alex Kost ;;; Copyright © 2016, 2017 Adonay "adfeno" Felipe Nogueira ;;; Copyright © 2016, 2021 Amirouche -;;; Copyright © 2016, 2019, 2021, 2023 Janneke Nieuwenhuizen +;;; Copyright © 2016, 2019, 2021, 2023, 2024 Janneke Nieuwenhuizen ;;; Copyright © 2017 Andy Wingo ;;; Copyright © 2017 David Thompson ;;; Copyright © 2017, 2018, 2019, 2020 Mathieu Othacehe @@ -875,7 +875,14 @@ (define-public guile-fibers (substitute* "tests/basic.scm" ((".*spawn-fiber-chain 5000000.*") "")) (substitute* "tests/channels.scm" - ((".*assert-run-fibers-terminates .*pingpong.*") ""))))))))) + ((".*assert-run-fibers-terminates .*pingpong.*") ""))))) + #$@(if (and (target-hurd?) (%current-target-system)) + #~((add-before 'build 'fixup-env + (lambda _ + (substitute* "env" + ((".*override.*" all) + (string-append "true #" all)))))) + '()))))) (native-inputs (list texinfo pkg-config autoconf-2.71 automake libtool guile-3.0 ;for 'guild compile -- Janneke Nieuwenhuizen | GNU LilyPond https://LilyPond.org Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 30 10:33:26 2024 Received: (at 73927) by debbugs.gnu.org; 30 Oct 2024 14:33:26 +0000 Received: from localhost ([127.0.0.1]:35301 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69lF-0003uj-AK for submit@debbugs.gnu.org; Wed, 30 Oct 2024 10:33:25 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36110) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69l9-0003tj-7K for 73927@debbugs.gnu.org; Wed, 30 Oct 2024 10:33:19 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t69iy-0003KW-3e; Wed, 30 Oct 2024 10:31:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=I+C+6Dj1zp6oNcFaSE4cVC+7aebqI8fUIIxrJPvfWdI=; b=jbBEWhwJ6OIcOzSrgwlI 5OstrLZQ6gDk8oHlRcKkZGvVZwMHH28p3ZY2qaeOc7O73ngdYvPyXQhrWdhhgefTj1NnxjLEY2Oeo uFdRE+T27+d5TUP8mpN9YtOOx1Hi2HN+srvngMc/o2mrouWZSNulVmXWSlm5VKKyAQn27HmID/Q/E ILSNR4CyKykEnMHMobv0Vi2MfpGs9fBMfnDJqto5hxXy0r4e7qFlay07J1qKjZrHluLyACVRYh0/d LZVqlg92n+IsC3e7GUfOf5BOqLpqk1dtOdZFDRYKIO0ZVCFEUFIXjcE3rxT/vyi1syZM76x9RSVzY LUqfvy9RI09NUg==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH v4 02/18] reconfigure: Use native bootloader package for running the installer. Date: Wed, 30 Oct 2024 15:30:31 +0100 Message-ID: <8772fc6a589621f7a343ac7432ebc705cd8dfac6.1730296564.git.janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Debbugs-Cc: Christopher Baines , Josselin Poiret , Ludovic Courtès , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) This fixes running grub-install when using guix system init --target. * guix/scripts/system/reconfigure.scm (install-bootloader): Use native package when invoking install-bootloader-program. Change-Id: I48d80a8dff866ada3625d827dd3036fb966eee9a --- guix/scripts/system/reconfigure.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/guix/scripts/system/reconfigure.scm b/guix/scripts/system/reconfigure.scm index 604ba08fee..ddb561d28c 100644 --- a/guix/scripts/system/reconfigure.scm +++ b/guix/scripts/system/reconfigure.scm @@ -7,6 +7,7 @@ ;;; Copyright © 2019 Christopher Baines ;;; Copyright © 2019 Jakob L. Kreuze ;;; Copyright © 2022 Arun Isaac +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -299,7 +300,7 @@ (define* (install-bootloader eval configuration bootcfg (eval #~(parameterize ((current-warning-port (%make-void-port "w"))) (primitive-load #$(install-bootloader-program installer disk-installer - package + #~#+package bootcfg bootcfg-file devices -- Janneke Nieuwenhuizen | GNU LilyPond https://LilyPond.org Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 30 10:33:36 2024 Received: (at 73927) by debbugs.gnu.org; 30 Oct 2024 14:33:36 +0000 Received: from localhost ([127.0.0.1]:35319 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69lO-0003vR-2T for submit@debbugs.gnu.org; Wed, 30 Oct 2024 10:33:35 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36116) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69lB-0003tl-9g for 73927@debbugs.gnu.org; Wed, 30 Oct 2024 10:33:22 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t69j0-0003Kp-Am; Wed, 30 Oct 2024 10:31:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=PCHfJ+x7JxS1mpKlA8fulki7WawwnG8104M1/8w/USo=; b=knfbd/v34ADpcQYrPT2M xQtLem9KnpsHr2mvN+eRG91PC+Bz4twVRb+bUb6wAhyjr+haNTjx+kWXT7yLMZM3gAQbEmFpcsdfk j1kggqAg7zy9n+L8BJTGfzmpzFwQ3aI2n9xerBUn3B5PJOfaK3P7L0U4W7CWAz1GM+yE0L6wJl6rl /OI4ShcOVcF2X+EA/T1wKUNzYDhu6IWXhC+HOG6anQMeOKd+aXl0X4n4fHoH4j7znYO1htDqsCevI 0Iu8aTbcm/9VUcqTdlEtfcVPjGnL3jMDFBIP/lkjZacjOVEO8m1CUI/7My5JLD+rVThMxTLpy1KlA X8GN2FCSTFBy/g==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH v4 04/18] bootloader: grub: Remove hardcoded partition number for the Hurd. Date: Wed, 30 Oct 2024 15:30:33 +0100 Message-ID: <3952b98b312119adb5456f255a3c6b0bf7294f95.1730296564.git.janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) This supports using another than the default DISK0 PART1 and using LABEL or UUID as root file-system specifier. It still defaults to DISK0 PART1 if the file-system cannot be found, i.e., lives only at the build side: A virtual machine/childhurd build. * gnu/build/file-systems.scm (%hurd-device-spec-regexp, %device-spec-regexp): New variables. (device-name->hurd-device-name, hurd-device-name->device-name, device-spec->device, device-spec->device-name): Use them in new procedures. * gnu/bootloader/grub.scm (make-grub-configuration): Use them to remove hardcoded partition number (root-index 1). Change-Id: I49fa93dacc09883dfb4d695402c5eac2e0e17286 --- gnu/bootloader/grub.scm | 19 +++++++++---- gnu/build/file-systems.scm | 58 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+), 6 deletions(-) diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index 2723eda5f4..ef516b1e13 100644 --- a/gnu/bootloader/grub.scm +++ b/gnu/bootloader/grub.scm @@ -3,7 +3,7 @@ ;;; Copyright © 2016 Chris Marusich ;;; Copyright © 2017 Leo Famulari ;;; Copyright © 2017, 2020 Mathieu Othacehe -;;; Copyright © 2019, 2020, 2023 Janneke Nieuwenhuizen +;;; Copyright © 2019, 2020, 2023, 2024 Janneke Nieuwenhuizen ;;; Copyright © 2019, 2020 Miguel Ángel Arruga Vivas ;;; Copyright © 2020 Maxim Cournoyer ;;; Copyright © 2020 Stefan @@ -34,6 +34,7 @@ (define-module (gnu bootloader grub) #:use-module (guix gexp) #:use-module (gnu artwork) #:use-module (gnu bootloader) + #:use-module (gnu build file-systems) #:use-module (gnu system uuid) #:use-module (gnu system file-systems) #:use-module (gnu system keyboard) @@ -45,6 +46,7 @@ (define-module (gnu bootloader grub) #:use-module (ice-9 regex) #:use-module (srfi srfi-1) #:use-module (srfi srfi-2) + #:use-module (srfi srfi-26) #:export (grub-theme grub-theme? grub-theme-image @@ -355,6 +357,11 @@ (define (grub-root-search device file) ((or #f (? string?)) #~(format #f "search --file --set ~a" #$file))))) +(define* (device->hurd-device-name device-spec #:key (disk "w")) + "Return DEVICE as a Hurd name spec: part:PART-NUMBER:device:DISKdDISK-INDEX." + (let ((device-name (canonicalize-device-spec device-spec))) + (device-name->hurd-device-name device-name #:disk disk))) + (define* (make-grub-configuration grub config entries #:key (locale #f) @@ -413,16 +420,16 @@ (define* (make-grub-configuration grub config entries ;; IDE driver ("hdX") and those understood by rumpdisk ("wdX" ;; in the "noide" case). (disk (if (member "noide" arguments) "w" "h")) - (modules (menu-entry-multiboot-modules entry)) - (root-index 1)) ; XXX EFI will need root-index 2 + (device-spec (and=> device file-system-device->string)) + (device-name (and=> device-spec device-spec->device-name)) + (modules (menu-entry-multiboot-modules entry))) #~(format port " menuentry ~s { - multiboot ~a root=part:~a:device:~ad0~a~a + multiboot ~a root=~a~a~a }~%" #$label #$kernel - #$root-index - #$disk + #$(device-name->hurd-device-name device-name #:disk disk) (string-join (list #$@arguments) " " 'prefix) (string-join (map string-join '#$modules) "\n module " 'prefix)))) diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm index 41e1c9e282..6fd9f95093 100644 --- a/gnu/build/file-systems.scm +++ b/gnu/build/file-systems.scm @@ -9,6 +9,7 @@ ;;; Copyright © 2022 Oleg Pykhalov ;;; Copyright © 2024 Nicolas Graves ;;; Copyright © 2024 Richard Sent +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -53,6 +54,11 @@ (define-module (gnu build file-systems) find-partition-by-luks-uuid canonicalize-device-spec + device-name->hurd-device-name + device-spec->device + device-spec->device-name + hurd-device-name->device-name + read-partition-label read-partition-uuid read-luks-partition-uuid @@ -1431,4 +1437,56 @@ (define* (mount-file-system fs #:key (root "/root") (or (file-system-mount-may-fail? fs) (apply throw args)))))) +(define %device-name-regexp "/dev/[hsvw]d([abcd])([0-9]*)") +(define %hurd-device-name-regexp "part:([0-9]*):device:[hw]d([0-9]*)") + +(define (device-spec->device-name device-spec) + "Return DEVICE-SPEC as a Linux /dev/XdYZ device name, also catering for uuid +or label." + (cond ((string-match %device-name-regexp device-spec) + device-spec) + ((string-match %hurd-device-name-regexp device-spec) + (hurd-device-name->device-name device-spec)) + ((string->uuid device-spec) + => + (lambda (uuid) (false-if-exception (find-partition-by-uuid uuid)))) + (else + (false-if-exception (find-partition-by-label device-spec))))) + +(define* (device-name->hurd-device-name device-name #:key (disk "w")) + "Return DEVICE-NAME as a Hurd device name: + part:PART-NUMBER:device:DISKdDISK-INDEX +Default to part:1:device:DISKd0 if partition cannot be found." + (let* ((m (and=> device-name (cute string-match %device-name-regexp <>))) + (disk-char (and m (and=> (match:substring m 1) + (compose car string->list)))) + (disk-index (or (and disk-char + (- (char->integer disk-char) (char->integer #\a))) + 0)) + (partition-number (or (and m (and=> (match:substring m 2) + string->number)) + 1))) + (format #f "part:~a:device:~ad~a" partition-number disk disk-index))) + +(define* (hurd-device-name->device-name device-name #:key (disk "s")) + (let* ((m (and=> device-name (cute string-match %hurd-device-name-regexp <>))) + (disk-index-string (and=> m (cute match:substring <> 2))) + (disk-index (or (and=> disk-index-string string->number) + 0)) + (disk-index-char (integer->char (+ disk-index (char->integer #\a)))) + (partition-string (and=> m (cute match:substring <> 1))) + (partition-number (or (and=> partition-string string->number) + 1))) + (format #f "/dev/~ad~a~a" disk disk-index-char partition-number))) + +(define (device-spec->device device-spec) + "Return DEVICE-SPEC as UUID, FILE-SYSTEM-LABEL, or DEVICE-SPEC." + (cond ((and=> (string->uuid device-spec) + find-partition-by-uuid) + (string->uuid device-spec)) + ((find-partition-by-label device-spec) + (file-system-label device-spec)) + (else + device-spec))) + ;;; file-systems.scm ends here -- Janneke Nieuwenhuizen | GNU LilyPond https://LilyPond.org Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 30 10:33:36 2024 Received: (at 73927) by debbugs.gnu.org; 30 Oct 2024 14:33:36 +0000 Received: from localhost ([127.0.0.1]:35321 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69lP-0003ve-Uo for submit@debbugs.gnu.org; Wed, 30 Oct 2024 10:33:36 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36128) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69lB-0003tm-9h for 73927@debbugs.gnu.org; Wed, 30 Oct 2024 10:33:22 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t69iz-0003Kh-Cn; Wed, 30 Oct 2024 10:31:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=0ODjLb2KfeycSHUPsx7Dr3080lMtxc6nfVL+zj5fd2E=; b=YxU+tRC8u/wfMpXt869+ QzP14lN5LLtUJFi/DaFko7cSIJVV/eSI5rsQV6uKxt378AH4TX7RWrgCjekH/09O1QBQCasC872FP SkdHbDJbriOANAle8tmFXk05L1KETL4dzGXoICUlZ04iMbQhrgmSGRUYESftkNsEZMdHeO8UB9n9a kg132l1dx3YHRugUzmtqBhDHM199PvH6enAxs8w58bACHUzPsxMmz0f15univF2DG1M4as1HjpbYc PHy3Y7av97v4u406ey8nc8ZYyNlowCCH5wnVH10jNNwk0nWfgxRXTnr94ivMmWbNeWq/Wi9bezV3q r4uarQNeNZkOtw==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH v4 03/18] guix system: When installing the Hurd, create essential devices. Date: Wed, 30 Oct 2024 15:30:32 +0100 Message-ID: <33174bdd45dd10b2aab98cd02d2f462ac91fc1e6.1730296564.git.janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Debbugs-Cc: Christopher Baines , Josselin Poiret , Ludovic Courtès , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * guix/scripts/system.scm (install): When installing the Hurd, invoke `make-hurd-device-nodes'. Change-Id: If84d5fe0b5bf4a93452f0b5241650f325d583543 --- guix/scripts/system.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 99c58f3812..7989b183ad 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -5,7 +5,7 @@ ;;; Copyright © 2017, 2019 Mathieu Othacehe ;;; Copyright © 2018 Ricardo Wurmus ;;; Copyright © 2019 Christopher Baines -;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen +;;; Copyright © 2020, 2024 Janneke Nieuwenhuizen ;;; Copyright © 2020 Julien Lepiller ;;; Copyright © 2020 Efraim Flashner ;;; Copyright © 2021 Brice Waegeneire @@ -63,6 +63,7 @@ (define-module (guix scripts system) #:autoload (guix progress) (progress-reporter/bar call-with-progress-reporter) #:use-module ((guix docker) #:select (%docker-image-max-layers)) + #:use-module (gnu build hurd-boot) #:use-module (gnu build image) #:use-module (gnu build install) #:autoload (gnu build file-systems) @@ -243,6 +244,9 @@ (define* (install os-drv target (delete-file-recursively state))) (chmod target #o755) + ;; For the Hurd to boot, it needs some essential device nodes. + (when (target-hurd?) + (make-hurd-device-nodes target)) (let ((os-dir (derivation->output-path os-drv)) (format (lift format %store-monad)) (populate (lift2 populate-root-file-system %store-monad))) -- Janneke Nieuwenhuizen | GNU LilyPond https://LilyPond.org Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 30 10:33:37 2024 Received: (at 73927) by debbugs.gnu.org; 30 Oct 2024 14:33:37 +0000 Received: from localhost ([127.0.0.1]:35323 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69lQ-0003vm-M6 for submit@debbugs.gnu.org; Wed, 30 Oct 2024 10:33:37 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36130) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69lD-0003tq-Ad for 73927@debbugs.gnu.org; Wed, 30 Oct 2024 10:33:24 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t69j1-0003Ky-Pu; Wed, 30 Oct 2024 10:31:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=kjowKCgQPWLCZataSj1MSToSn5qEFtW1ah5tT8UzbYI=; b=aiRbj12mcBMK1NgijyCF 7MpkYHanH6TwLZDoQZd+0YbY5EzgbR6B7jFt9X5N6KvTSY0lArgyaS72OEx2+k8LZEOVHAUs+GoBZ SUHsRJKwfZtmRjPYeUa48dt1hP4Za2cH7isZ6IUKZ68KkT9Q49DAYH2KMNy8//Fqu8ZkP2zlJgd3V N5tiB9vKvc9gtTy+YTFt9rvH/+LJjMN+e74EAa7K5BLZscqMz214D9IS7U2A2RRx1QIocQxqSMA3/ VwviUonQIaBcKeiH/CJV7uc6r9RuDINVlhSW1Q1ThgTpnSfcme77jurVpeNXN8rLgyzikDrELxgCZ BopMxe6iB2mZ1Q==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH v4 05/18] system: hurd: Remove qemu networking from %base-services/hurd. Date: Wed, 30 Oct 2024 15:30:34 +0100 Message-ID: <31563aff635d848ced223882a61e0b691f667730.1730296564.git.janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) This allows us to use %base-services/hurd for services in a Hurd config for a real machine without removing static-networking. * gnu/system/hurd.scm (%base-services/hurd): Factor networking out to... (%base-services+qemu-networking/hurd): ..this new variable. * gnu/system/examples/bare-hurd.tmpl (%hurd-os): Use it. * gnu/services/virtualization.scm (%hurd-vm-operating-system): Use it. * gnu/system/images/hurd.scm (hurd-barebones-os): Use it. Add comment about QEMU and networking for a real machine. Change-Id: I777a63410383b9bf8b5740e4513dbc1e9fb0fd41 --- gnu/services/virtualization.scm | 4 ++-- gnu/system/examples/bare-hurd.tmpl | 10 ++++++++-- gnu/system/hurd.scm | 23 ++++++++++++++--------- gnu/system/images/hurd.scm | 2 +- 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/gnu/services/virtualization.scm b/gnu/services/virtualization.scm index d87e494348..d33dfa6ca7 100644 --- a/gnu/services/virtualization.scm +++ b/gnu/services/virtualization.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017 Ryan Moe ;;; Copyright © 2018, 2020-2024 Ludovic Courtès -;;; Copyright © 2020, 2021, 2023 Janneke Nieuwenhuizen +;;; Copyright © 2020, 2021, 2023, 2024 Janneke Nieuwenhuizen ;;; Copyright © 2021 Timotej Lazar ;;; Copyright © 2022 Oleg Pykhalov ;;; Copyright © 2022 Leo Nikkilä @@ -1643,7 +1643,7 @@ (define %hurd-vm-operating-system ;; /etc/guix/acl file in the childhurd. Thus, clear ;; 'authorize-key?' so that it's not overridden at activation ;; time. - (modify-services %base-services/hurd + (modify-services %base-services+qemu-networking/hurd (guix-service-type config => (guix-configuration (inherit config) diff --git a/gnu/system/examples/bare-hurd.tmpl b/gnu/system/examples/bare-hurd.tmpl index 463c7ee798..68c6d3c166 100644 --- a/gnu/system/examples/bare-hurd.tmpl +++ b/gnu/system/examples/bare-hurd.tmpl @@ -1,7 +1,7 @@ ;; -*-scheme-*- ;; This is an operating system configuration template -;; for a "bare bones" setup, with no X11 display server. +;; for a "bare bones" QEMU setup, with no X11 display server. ;; To build a disk image for a virtual machine, do ;; @@ -54,6 +54,12 @@ (permit-root-login #t) (allow-empty-passwords? #t) (password-authentication? #t))) - %base-services/hurd)))) + ;; For installing on a real (non-QEMU) machine, use: + ;; (static-networking-service-type + ;; (list %loopback-static-networking + ;; (static-networking + ;; ...))) + ;; %base-services/hurd + %base-services+qemu-networking/hurd)))) %hurd-os diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm index 6d6a20cf57..283bae6f10 100644 --- a/gnu/system/hurd.scm +++ b/gnu/system/hurd.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2020-2024 Ludovic Courtès -;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen +;;; Copyright © 2020, 2023, 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -47,6 +47,7 @@ (define-module (gnu system hurd) #:use-module (gnu system vm) #:export (%base-packages/hurd %base-services/hurd + %base-services+qemu-networking/hurd %hurd-default-operating-system %hurd-default-operating-system-kernel %setuid-programs/hurd)) @@ -79,14 +80,6 @@ (define %base-packages/hurd (define %base-services/hurd (append (list (service hurd-console-service-type (hurd-console-configuration (hurd hurd))) - (service static-networking-service-type - (list %loopback-static-networking - - ;; QEMU user-mode networking. To get "eth0", you need - ;; QEMU to emulate a device for which Mach has an - ;; in-kernel driver, for instance with: - ;; --device rtl8139,netdev=net0 --netdev user,id=net0 - %qemu-static-networking)) (service guix-service-type (guix-configuration (extra-options '("--disable-chroot" @@ -102,6 +95,18 @@ (define %base-services/hurd (tty (string-append "tty" (number->string n)))))) (iota 6 1)))) +(define %base-services+qemu-networking/hurd + (cons + (service static-networking-service-type + (list %loopback-static-networking + + ;; QEMU user-mode networking. To get "eth0", you need + ;; QEMU to emulate a device for which Mach has an + ;; in-kernel driver, for instance with: + ;; --device rtl8139,netdev=net0 --netdev user,id=net0 + %qemu-static-networking)) + %base-services/hurd)) + (define %setuid-programs/hurd ;; Default set of setuid-root programs. (map file-like->setuid-program diff --git a/gnu/system/images/hurd.scm b/gnu/system/images/hurd.scm index 9b618f7dc6..01c422a54f 100644 --- a/gnu/system/images/hurd.scm +++ b/gnu/system/images/hurd.scm @@ -60,7 +60,7 @@ (define hurd-barebones-os (permit-root-login #t) (allow-empty-passwords? #t) (password-authentication? #t))) - %base-services/hurd)))) + %base-services+qemu-networking/hurd)))) (define hurd-initialize-root-partition #~(lambda* (#:rest args) -- Janneke Nieuwenhuizen | GNU LilyPond https://LilyPond.org Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 30 10:33:37 2024 Received: (at 73927) by debbugs.gnu.org; 30 Oct 2024 14:33:38 +0000 Received: from localhost ([127.0.0.1]:35325 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69lR-0003vt-AT for submit@debbugs.gnu.org; Wed, 30 Oct 2024 10:33:37 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48372) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69lF-0003u7-C9 for 73927@debbugs.gnu.org; Wed, 30 Oct 2024 10:33:26 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t69j2-0003L6-V0; Wed, 30 Oct 2024 10:31:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=eI15wjPgNJLWfcc2Y9D7xtqi1gvQFO5BP+sIZmkXN8M=; b=Ogg5kAsIgk3bwFYYwQi0 Yh6UwuOztGP8KQ604PMl6NaiCLeCnoPmFxeSczmBOTDLLTyI3x+0/kmmftuMnVQ4kuTyQ8DblDmZT c7uzPgcUR96cSw394iVEjFAVHLh+EJqmYcHJYxTbZTICjXyfzw0GOnOUvEcdtW0L0jZIbeUUbLQiY 8/6GEsXgLXh1WcELQzssqp65GUDhpeMOHauugyEjKKD2l+5Hms6TeqmPUw1ZfLudwKFb7qDeH27/3 uS4KPbqIbCS8NliXcrTcSzcamLPEaFXlvgpEY3wpuE1SZL5c6VuItXsov9Fi/lzLBPEjrR3Sq3CXg 6VwSszYVT+TwVw==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH v4 06/18] system: hurd: Add swap-services to hurd-default-essential-services. Date: Wed, 30 Oct 2024 15:30:35 +0100 Message-ID: <5c52891a8384febf4152e0e12ae66a32c807739e.1730296564.git.janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/services/base.scm (swap-service-type): Do not include 'udev' requirement for the Hurd. Use system* with "swapon", "swapoff" for the Hurd. * gnu/system.scm (hurd-default-essential-services): Add swap-services. * gnu/services/base.scm (swap-service-type): Change-Id: I1d4d445c614921752dc84aa0dd6ff42cdbf62aa8 --- gnu/services/base.scm | 20 +++++++++++++------- gnu/system.scm | 13 +++++++------ 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/gnu/services/base.scm b/gnu/services/base.scm index d0a57a8807..6201dea4b8 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -44,6 +44,7 @@ (define-module (gnu services base) #:autoload (guix diagnostics) (warning formatted-message &fix-hint) #:autoload (guix i18n) (G_) #:use-module (guix combinators) + #:use-module (guix utils) #:use-module (gnu services) #:use-module (gnu services admin) #:use-module (gnu services shepherd) @@ -2647,7 +2648,7 @@ (define swap-service-type (with-imported-modules (source-module-closure '((gnu build file-systems))) (shepherd-service (provision (list (swap->shepherd-service-name swap))) - (requirement `(udev ,@requirements)) + (requirement `(,@(if (target-hurd?) '() '(udev)) ,@requirements)) (documentation "Enable the given swap space.") (modules `((gnu build file-systems) ,@%default-modules)) @@ -2655,16 +2656,21 @@ (define swap-service-type (let ((device #$device-lookup)) (and device (begin - (restart-on-EINTR (swapon device - #$(if (swap-space? swap) - (swap-space->flags-bit-mask - swap) - 0))) + #$(if (target-hurd?) + #~(system* "swapon" device) + #~(restart-on-EINTR + (swapon device + #$(if (swap-space? swap) + (swap-space->flags-bit-mask + swap) + 0)))) #t))))) (stop #~(lambda _ (let ((device #$device-lookup)) (when device - (restart-on-EINTR (swapoff device))) + #$(if (target-hurd?) + #~(system* "swapoff" device) + #~(restart-on-EINTR (swapoff device)))) #f))) (respawn? #f)))) (description "Turn on the virtual memory swap area."))) diff --git a/gnu/system.scm b/gnu/system.scm index c19730b331..533a4154d6 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -845,11 +845,11 @@ (define (hurd-default-essential-services os) (let ((host-name (operating-system-host-name os)) (hosts-file (%operating-system-hosts-file os)) (entries (operating-system-directory-base-entries os))) - (list (service system-service-type entries) - %boot-service - %hurd-startup-service - %activation-service - (service shepherd-root-service-type) + (cons* (service system-service-type entries) + %boot-service + %hurd-startup-service + %activation-service + (service shepherd-root-service-type) (service user-processes-service-type) ;; Make sure that privileged-programs activation script @@ -873,7 +873,8 @@ (define (hurd-default-essential-services os) (list `("hosts" ,hosts-file))) (service hosts-service-type (local-host-entries host-name))) - (service profile-service-type (operating-system-packages os))))) + (service profile-service-type (operating-system-packages os)) + (swap-services os)))) (define* (operating-system-services os) "Return all the services of OS, including \"essential\" services." -- Janneke Nieuwenhuizen | GNU LilyPond https://LilyPond.org Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 30 10:33:51 2024 Received: (at 73927) by debbugs.gnu.org; 30 Oct 2024 14:33:51 +0000 Received: from localhost ([127.0.0.1]:35328 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69lb-0003wC-Vu for submit@debbugs.gnu.org; Wed, 30 Oct 2024 10:33:51 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48402) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69lH-0003uK-E2 for 73927@debbugs.gnu.org; Wed, 30 Oct 2024 10:33:28 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t69j6-0003La-24; Wed, 30 Oct 2024 10:31:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=iaWfx4jNOFpVzCd71bf93ta8DO59udVxL6qBakwsMDE=; b=lGXcgK1br0ACdjparLZl MV11RAiPQWo2VhtlCartwhELxfeAy50FQv7sYZz5+lx7d9fZZFPvAq2tk9zaCca4CJ1u16+UsHTS0 unnCwp0MSruKG0rb00XwuWZxOKfft4vhxhPOSHppscqNjhvHue/n4hhVWKLtNn6LV5XOES1GKVccs ixrLbClMc0dwIK93vOXd/a/ZUMvgjRt1ZwvRkDVUoNTfEaNmaa8hoxEIuj6R9Ws7wvp8vTcmouA6N QGqcUJJMyq6Ob9cDWIwpGD/VimJFGCqpdm1xcgtk0b5lOLJYmxSZ4oHYCalUbBNoL9kcD76K0GQra cmsU1KUFWOjTiA==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH v4 08/18] hurd-boot: Support second boot. Date: Wed, 30 Oct 2024 15:30:37 +0100 Message-ID: X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/build/hurd-boot.scm (boot-hurd-system): Check for stale shepherd socket and remove it. Be chattier about /hurd symlink replacement. Change-Id: I5e528c131ebeadb7ebc9727336a0f9301af3e68e --- gnu/build/hurd-boot.scm | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/gnu/build/hurd-boot.scm b/gnu/build/hurd-boot.scm index daf4fb41ab..23ace25d4f 100644 --- a/gnu/build/hurd-boot.scm +++ b/gnu/build/hurd-boot.scm @@ -322,18 +322,29 @@ (define* (boot-hurd-system #:key (on-error 'debug)) (let* ((args (command-line)) (system (find-long-option "gnu.system" args)) - (to-load (find-long-option "gnu.load" args))) + (to-load (find-long-option "gnu.load" args)) + (profile (string-append system "/profile")) + (bin (string-append profile "/bin")) + (sbin (string-append profile "/bin"))) - (false-if-exception (delete-file "/hurd")) - (let ((hurd/hurd (readlink* (string-append system "/profile/hurd")))) - (symlink hurd/hurd "/hurd")) + (setenv "PATH" (string-append bin ":" sbin)) + + (when (file-exists? "/var/run/shepherd/socket") + (format #t "Removing stale shepherd socket...\n") + (delete-file "/var/run/shepherd/socket")) (unless (file-exists? "/servers/startup") (format #t "Creating essential device nodes...\n") (make-hurd-device-nodes)) + (let ((profile/hurd (readlink* (string-append profile "/hurd")))) + (when (file-exists? "/hurd") + (format #t "Removing stale /hurd link\n") + (delete-file "/hurd")) + (format #t "Linking /hurd from ~a...\n" profile/hurd) + (symlink profile/hurd "/hurd")) + (format #t "Setting-up essential translators...\n") - (setenv "PATH" (string-append system "/profile/bin")) (set-hurd-device-translators) (format #t "Starting pager...\n") -- Janneke Nieuwenhuizen | GNU LilyPond https://LilyPond.org Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 30 10:33:52 2024 Received: (at 73927) by debbugs.gnu.org; 30 Oct 2024 14:33:52 +0000 Received: from localhost ([127.0.0.1]:35330 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69lf-0003wG-HO for submit@debbugs.gnu.org; Wed, 30 Oct 2024 10:33:52 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48404) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69lH-0003uL-E3 for 73927@debbugs.gnu.org; Wed, 30 Oct 2024 10:33:28 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t69j5-0003LP-48; Wed, 30 Oct 2024 10:31:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=skddpd7CrqziZHRHibNOoVO8k85rWwhGOskhqDeKxjo=; b=Xzdd/vOevZ9Yulens3Aa IIWZE8UzkO+HfHK+7x0/EuXuO0Y/AHsKnupS01g7I6ZsvYvsWF/l7ar8aNsaejHGLd9882FptZbLy tLSrdL6JOroUrYNiG/M9mJeILeZrS/XekaYTcxmhFWD97UroqXL7mgmFmSA9RJTh23OG7DM1ShEEc 1pPOa3XOjS3VNd0ZrDj38j6WP//MeKxWMf1mfHrot5B+E5RiXOIt+zapfy7/1XAxj+oY+yQ6E+fPg fnsW9szLfuoR5ifFaQUyplbxXMBzECXnzQhZABDPU/uNns0QP6Kr40tfnzsHTJNTOEDMNojUMwpyc cV57ZvAj6kPWqA==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH v4 07/18] gnu: hurd: Support second boot. Date: Wed, 30 Oct 2024 15:30:36 +0100 Message-ID: <02512a12da4e00eb89b5e919c3fa6665608d941c.1730296564.git.janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) This avoids hanging upon second boot and ensures a declarative /hurd and /dev. * gnu/packages/patches/hurd-startup.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/hurd.scm (hurd): Use it. [arguments]: In stage create-runsystem remove /dev/urandom. Change-Id: Ifcca5562c297204735c35132820a32ca0f273677 --- gnu/local.mk | 1 + gnu/packages/hurd.scm | 6 +- gnu/packages/patches/hurd-startup.patch | 82 +++++++++++++++++++++++++ 3 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/hurd-startup.patch diff --git a/gnu/local.mk b/gnu/local.mk index 1040b3927b..872e55eb41 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1542,6 +1542,7 @@ dist_patch_DATA = \ %D%/packages/patches/hubbub-sort-entities.patch \ %D%/packages/patches/hueplusplus-mbedtls.patch \ %D%/packages/patches/hurd-rumpdisk-no-hd.patch \ + %D%/packages/patches/hurd-startup.patch \ %D%/packages/patches/hwloc-1-test-btrfs.patch \ %D%/packages/patches/i7z-gcc-10.patch \ %D%/packages/patches/icecat-makeicecat.patch \ diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm index e6ea920714..9c1681f236 100644 --- a/gnu/packages/hurd.scm +++ b/gnu/packages/hurd.scm @@ -317,7 +317,8 @@ (define-public hurd (name "hurd") (source (origin (inherit (package-source hurd-headers)) - (patches (search-patches "hurd-rumpdisk-no-hd.patch")))) + (patches (search-patches "hurd-rumpdisk-no-hd.patch" + "hurd-startup.patch")))) (version (package-version hurd-headers)) (arguments `(#:tests? #f ;no "check" target @@ -388,6 +389,9 @@ (define-public hurd # Note: this /hurd/ gets substituted settrans --create /servers/socket/1 /hurd/pflocal +# Upon second boot, (file-exists? /dev/null) in hurd-boot-system hangs unless: +rm -f /dev/urandom + # parse multiboot arguments for i in \"$@\"; do case $i in diff --git a/gnu/packages/patches/hurd-startup.patch b/gnu/packages/patches/hurd-startup.patch new file mode 100644 index 0000000000..0b0dcc9537 --- /dev/null +++ b/gnu/packages/patches/hurd-startup.patch @@ -0,0 +1,82 @@ +This avoids hanging upon second boot and ensures a declarative /dev. + +Upstream status: Not presented upstream. + +From a15d281ea012ee360c45376e964d35f6292ac549 Mon Sep 17 00:00:00 2001 +From: Janneke Nieuwenhuizen +Date: Sat, 27 May 2023 17:28:22 +0200 +Subject: [PATCH] startup: Remove /hurd, /dev, create /servers. + +This avoids hanging upon second boot and ensures a declarative /hurd +and /dev. + +* startup/startup.c (rm_r, create_servers): New functions. +(main): Use them to remove /dev and create /servers. Remove /hurd +symlink. +--- + startup/startup.c | 42 ++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 42 insertions(+) + +diff --git a/startup/startup.c b/startup/startup.c +index feb7d265..5f380194 100644 +--- a/startup/startup.c ++++ b/startup/startup.c +@@ -732,6 +732,42 @@ parse_opt (int key, char *arg, struct argp_state *state) + return 0; + } + ++#include ++static int ++rm_r (char const *file_name) ++{ ++ int callback (char const *file_name, struct stat64 const *stat_buffer, ++ int type_flag, struct FTW *ftw_buffer) ++ { ++ fprintf (stderr, "startup: removing: %s\n", file_name); ++ return remove (file_name); ++ } ++ ++ return nftw64 (file_name, callback, 0, FTW_DEPTH | FTW_MOUNT | FTW_PHYS); ++} ++ ++void ++create_servers (void) ++{ ++ char const *servers[] = { ++ "/servers/startup", ++ "/servers/exec", ++ "/servers/proc", ++ "/servers/password", ++ "/servers/default-pager", ++ "/servers/crash-dump-core", ++ "/servers/kill", ++ "/servers/suspend", ++ 0, ++ }; ++ mkdir ("/servers", 0755); ++ for (char const **p = servers; *p; p++) ++ open (*p, O_WRONLY | O_APPEND | O_CREAT, 0444); ++ mkdir ("/servers/socket", 0755); ++ mkdir ("/servers/bus", 0755); ++ mkdir ("/servers/bus/pci", 0755); ++} ++ + int + main (int argc, char **argv, char **envp) + { +@@ -741,6 +777,12 @@ main (int argc, char **argv, char **envp) + mach_port_t consdev; + struct argp argp = { options, parse_opt, 0, doc }; + ++ /* GNU Guix creates fresh ones in boot-hurd-system. */ ++ unlink ("/hurd"); ++ rm_r ("/dev"); ++ mkdir ("/dev", 0755); ++ create_servers (); ++ + /* Parse the arguments. We don't want the vector reordered, we + should pass on to our child the exact arguments we got and just + ignore any arguments that aren't flags for us. ARGP_NO_ERRS +-- +2.40.1 + -- Janneke Nieuwenhuizen | GNU LilyPond https://LilyPond.org Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 30 10:33:52 2024 Received: (at 73927) by debbugs.gnu.org; 30 Oct 2024 14:33:52 +0000 Received: from localhost ([127.0.0.1]:35334 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69lg-0003wO-82 for submit@debbugs.gnu.org; Wed, 30 Oct 2024 10:33:52 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48388) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69lH-0003uJ-E1 for 73927@debbugs.gnu.org; Wed, 30 Oct 2024 10:33:28 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t69j7-0003Lp-0o; Wed, 30 Oct 2024 10:31:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=HfncODcPJjd5vdNEUI1uhrSy+SoVbwwPoVqAtSExszQ=; b=qt2hR6jVQ/2UJV42mtD2 DrSN2S6X2tvEjU86QWXS4Dv+RvPoLJR+J4jl/tK5mbCi2dHee8hJg/kfOM8k0Mmyh8J4+i3Jo4TIN HHM9Un93iKlAuaNywmr4XHTMGXH0eACKLZgDzV2vS129RCFgare9V1TtZvJIsNhqT5hnvcJm656h+ 5+EhfUb62ieo4NRW3wuNBJ5NfMjGIJEIxpNxWZzOPdzak0v7S9MtGdP15Ayv6d1MjFkSdnP7Fk5FL Q1hk8FQY/i+zp9jt4yl2m2uwz3qDLHO2+T3JmVdAbZwBVAgxGgtuOrJB2TQuH0KkDMdOX4vpu+Tb0 E+7xV5RAb27GIw==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH v4 09/18] maint: Add installer dependencies to the manifest. Date: Wed, 30 Oct 2024 15:30:38 +0100 Message-ID: <3946ea2ac963b11cd069550cdf35f5d007430733.1730296564.git.janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * manifest.scm: Add guile-newt, guile-parted, guile-webutils. Change-Id: Idcf46320d29c15f36da05f66e81b7779e37c1bf6 --- manifest.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/manifest.scm b/manifest.scm index 27e1d62566..ccd6268461 100644 --- a/manifest.scm +++ b/manifest.scm @@ -51,4 +51,9 @@ "mumi" "nss-certs" "openssl" ;required if using 'smtpEncryption = tls' - "patman")))) + "patman")) + ;; For installer + (specifications->manifest + (list "guile-newt" + "guile-parted" + "guile-webutils")))) -- Janneke Nieuwenhuizen | GNU LilyPond https://LilyPond.org Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 30 10:33:53 2024 Received: (at 73927) by debbugs.gnu.org; 30 Oct 2024 14:33:53 +0000 Received: from localhost ([127.0.0.1]:35336 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69lg-0003wW-Mt for submit@debbugs.gnu.org; Wed, 30 Oct 2024 10:33:53 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48418) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69lJ-0003ud-F4 for 73927@debbugs.gnu.org; Wed, 30 Oct 2024 10:33:29 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t69j8-0003M6-G7; Wed, 30 Oct 2024 10:31:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=7wi8f4MDk4H2d6C8IkKdRaClTNgcz6kEBqE5qbspWG4=; b=HR3hn1acWPOFpLWkY82X r+9GgX7IovFtovYWNBLLCIwtQK4ukepjDPAQrWkD0lUTWXO/dQK7zgWD3/QWmguZU9fSyPezbS4Hk C0yXljSjTqYWtbnoZGe0+2omA4u73umKRdbbWKyeRRlfQqK05AkLsMr34WVx68fwVVovKxZ7aPPqR u0s28MNYvGCj6jynm9wLFlNexpRsV9MV58xQj6ha+3ZZG0Xv93DKo2yTqs5QeC56+7xPE+WPS+CfH SfoJhHf+oN1jv9OYpTrhsqyaRseThAR1GXDAX/OiPmu1G4m0uTh419oMlqTSfhH+H7KAZt5Ihn5bE qmhuKqAcXTJNsA==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH v4 10/18] installer: Remove unused (newt) imports. Date: Wed, 30 Oct 2024 15:30:39 +0100 Message-ID: X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Debbugs-Cc: Josselin Poiret , Ludovic Courtès , Mathieu Othacehe Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/installer/newt/ethernet.scm, gnu/installer/newt/keymap.scm, gnu/installer/newt/locale.scm, gnu/installer/newt/parameters.scm, gnu/installer/newt/services.scm: Remove (newt). Change-Id: Ia6624aaf73491024da54b8ffee7358941b187fdf --- gnu/installer/newt/ethernet.scm | 1 - gnu/installer/newt/keymap.scm | 1 - gnu/installer/newt/locale.scm | 1 - gnu/installer/newt/parameters.scm | 1 - gnu/installer/newt/services.scm | 1 - 5 files changed, 5 deletions(-) diff --git a/gnu/installer/newt/ethernet.scm b/gnu/installer/newt/ethernet.scm index d75a640519..53e440fd60 100644 --- a/gnu/installer/newt/ethernet.scm +++ b/gnu/installer/newt/ethernet.scm @@ -27,7 +27,6 @@ (define-module (gnu installer newt ethernet) #:use-module (ice-9 match) #:use-module (srfi srfi-34) #:use-module (srfi srfi-35) - #:use-module (newt) #:export (run-ethernet-page)) (define (ethernet-services) diff --git a/gnu/installer/newt/keymap.scm b/gnu/installer/newt/keymap.scm index c5d4be6792..109ec55e0a 100644 --- a/gnu/installer/newt/keymap.scm +++ b/gnu/installer/newt/keymap.scm @@ -24,7 +24,6 @@ (define-module (gnu installer newt keymap) #:use-module (gnu installer newt page) #:use-module (guix i18n) #:use-module (guix records) - #:use-module (newt) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:use-module (srfi srfi-34) diff --git a/gnu/installer/newt/locale.scm b/gnu/installer/newt/locale.scm index 01171e253f..a226b39ba6 100644 --- a/gnu/installer/newt/locale.scm +++ b/gnu/installer/newt/locale.scm @@ -22,7 +22,6 @@ (define-module (gnu installer newt locale) #:use-module (gnu installer steps) #:use-module (gnu installer newt page) #:use-module (guix i18n) - #:use-module (newt) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:use-module (srfi srfi-34) diff --git a/gnu/installer/newt/parameters.scm b/gnu/installer/newt/parameters.scm index 8fb1aa3abb..7c61266e4d 100644 --- a/gnu/installer/newt/parameters.scm +++ b/gnu/installer/newt/parameters.scm @@ -23,7 +23,6 @@ (define-module (gnu installer newt parameters) #:use-module (guix build syscalls) #:use-module (guix i18n) #:use-module (ice-9 match) - #:use-module (newt) #:export (run-parameters-page)) (define (run-proxy-page) diff --git a/gnu/installer/newt/services.scm b/gnu/installer/newt/services.scm index b22024602c..d1035b6524 100644 --- a/gnu/installer/newt/services.scm +++ b/gnu/installer/newt/services.scm @@ -28,7 +28,6 @@ (define-module (gnu installer newt services) #:use-module (guix i18n) #:use-module (srfi srfi-34) #:use-module (srfi srfi-35) - #:use-module (newt) #:export (run-services-page)) (define (run-desktop-environments-cbt-page) -- Janneke Nieuwenhuizen | GNU LilyPond https://LilyPond.org Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 30 10:33:54 2024 Received: (at 73927) by debbugs.gnu.org; 30 Oct 2024 14:33:54 +0000 Received: from localhost ([127.0.0.1]:35338 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69lh-0003wj-Id for submit@debbugs.gnu.org; Wed, 30 Oct 2024 10:33:53 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48434) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69lL-0003uw-Gs for 73927@debbugs.gnu.org; Wed, 30 Oct 2024 10:33:31 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t69jA-0003MI-Ld; Wed, 30 Oct 2024 10:31:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=OhSmP+u8Nn62ocwaFv31DZePHEvszKBDnm02zazmNQ8=; b=R3ZqiMhf2p6ZJepcEk8a cVtmMIfRaeEe8OZztxM94g2U51Hy20Rcy/jWRWlzVwmE4cNnVrCdBWwvoxBo7oqBWeioTS5C9bAAN Y2EYutgg/zIrJjnaRXRnGPpOxNFPqhk2TQ+Hea/9yogqVGVN23KKEkwodVVl2aGa6itkvxBGZXO07 Ow5D7uH+nqn2gsfQaIghsyzQ52aD6Q4yQ76MaIiKaz6AcfGW2C04K1q0OxT6sQo0ZLHqqQJ1u6P0O j8DE/inv4ME3mLQMpdtz0oMOaS9mrKE+D2t1o5bzDRvlTKeIoIuIS35q753f2fwtiphI9qZhgWPWi ckm4QM3w7XLv/Q==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH v4 11/18] installer: Align comments. Date: Wed, 30 Oct 2024 15:30:40 +0100 Message-ID: <0af3871effd00e696c238f1c91dfb26852a43850.1730296564.git.janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Debbugs-Cc: Josselin Poiret , Ludovic Courtès , Mathieu Othacehe Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/installer.scm (installer-program): Align comments. Change-Id: I50c173c46ea9bfdb3da0562146bc969d46f0edd9 --- gnu/installer.scm | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/gnu/installer.scm b/gnu/installer.scm index 5cd99e4013..3dfcb7581a 100644 --- a/gnu/installer.scm +++ b/gnu/installer.scm @@ -355,22 +355,22 @@ (define (installer-program) (define set-installer-path ;; Add the specified binary to PATH for later use by the installer. #~(let* ((inputs - '#$(list bash ;start subshells - connman ;call connmanctl + '#$(list bash ;start subshells + connman ;call connmanctl cryptsetup - dosfstools ;mkfs.fat - e2fsprogs ;mkfs.ext4 - lvm2-static ;dmsetup + dosfstools ;mkfs.fat + e2fsprogs ;mkfs.ext4 + lvm2-static ;dmsetup btrfs-progs - jfsutils ;jfs_mkfs - ntfs-3g ;mkfs.ntfs - xfsprogs ;mkfs.xfs - kbd ;chvt - util-linux ;mkwap + jfsutils ;jfs_mkfs + ntfs-3g ;mkfs.ntfs + xfsprogs ;mkfs.xfs + kbd ;chvt + util-linux ;mkwap nano shadow - tar ;dump - gzip ;dump + tar ;dump + gzip ;dump coreutils))) (with-output-to-port (%make-void-port "w") (lambda () -- Janneke Nieuwenhuizen | GNU LilyPond https://LilyPond.org Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 30 10:33:54 2024 Received: (at 73927) by debbugs.gnu.org; 30 Oct 2024 14:33:55 +0000 Received: from localhost ([127.0.0.1]:35340 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69li-0003wq-1X for submit@debbugs.gnu.org; Wed, 30 Oct 2024 10:33:54 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48438) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69lN-0003v8-Ij for 73927@debbugs.gnu.org; Wed, 30 Oct 2024 10:33:34 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t69jC-0003MQ-KM; Wed, 30 Oct 2024 10:31:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=6sNXNkmEFVwly2aaiNLBlrW0rSO2oPi1w7+RXs/UNs4=; b=D4CWz5udgYXR9Kxq8BbF q9n9MSowZlELo7SENCUDIIIth4KhPk9Cgtuoz6yKunWbf0L6i1jGfGFxuUrVn22mH58LiO5yQl3tE YABhxlQWCc7Wbp7aEC2QD2hPXjnHaPcMAFjakR81B7Qj275ySH+Vyu7mnxM2iof0goPmuSKJgmCXW igw44TozjQSnQwITltrmUnkZQFONj1tlj/4uX52Ux/fAR9mBWJWphIJVqw78chpqLk3419XtgtrjE RCoF0uwWhtdaI0B/xCETonDFYcIApuBYAFmtQto285XnpMAVAN7hc8cTr+YNal8q431tpwhsdFtSr HNCmbFOnv1UVRg==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH v4 13/18] installer: Fix file-name typos. Date: Wed, 30 Oct 2024 15:30:42 +0100 Message-ID: <1cdb030e76a58fee4a141f298aa51554f30ca3cb.1730296564.git.janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Debbugs-Cc: Josselin Poiret , Ludovic Courtès , Mathieu Othacehe Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/installer/newt/page.scm (run-dump-page): Typo file-name. * gnu/installer/utils.scm (open-new-log-port): Likewise. Change-Id: I837991a0ee5054b3afa8328205e23ac6f9fbae8d --- gnu/installer/newt/page.scm | 7 ++++--- gnu/installer/utils.scm | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/gnu/installer/newt/page.scm b/gnu/installer/newt/page.scm index e1623a51fd..64a2916826 100644 --- a/gnu/installer/newt/page.scm +++ b/gnu/installer/newt/page.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2018 Mathieu Othacehe ;;; Copyright © 2019, 2020, 2022 Ludovic Courtès ;;; Copyright © 2019 Tobias Geerinckx-Rice +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -950,10 +951,10 @@ (define* (run-dump-page base-dir file-choices) ('exit-component (let ((result (map (match-lambda - ((edit checkbox filename) + ((edit checkbox file-name) (if (components=? edit argument) - (abort-to-prompt prompt-tag filename) - (cons filename (eq? #\x + (abort-to-prompt prompt-tag file-name) + (cons file-name (eq? #\x (checkbox-value checkbox)))))) components))) (destroy-form-and-pop form) diff --git a/gnu/installer/utils.scm b/gnu/installer/utils.scm index 6838410166..c722e9af8f 100644 --- a/gnu/installer/utils.scm +++ b/gnu/installer/utils.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018, 2020 Mathieu Othacehe ;;; Copyright © 2019, 2020, 2022 Ludovic Courtès +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -283,11 +284,11 @@ (define-syntax syslog (define (open-new-log-port) (define now (localtime (time-second (current-time)))) - (define filename + (define file-name (format #f "/tmp/installer.~a.log" (strftime "%F.%T" now))) - (open filename (logior O_RDWR - O_CREAT))) + (open file-name (logior O_RDWR + O_CREAT))) (define installer-log-port (let ((port #f)) -- Janneke Nieuwenhuizen | GNU LilyPond https://LilyPond.org Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 30 10:33:55 2024 Received: (at 73927) by debbugs.gnu.org; 30 Oct 2024 14:33:56 +0000 Received: from localhost ([127.0.0.1]:35344 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69li-0003wx-Qz for submit@debbugs.gnu.org; Wed, 30 Oct 2024 10:33:55 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48436) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69lN-0003v9-Ie for 73927@debbugs.gnu.org; Wed, 30 Oct 2024 10:33:35 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t69jB-0003MP-Jo; Wed, 30 Oct 2024 10:31:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=eiCxsj0AaULcOIP4BeP7L25BgeYDXk8o756P+cDSI44=; b=MJbTQ95VENqmadfdtW6M j6CnAQkIzxbdf4OPc80B/IPZcUL6SWIf8qlj8qPQXh3bc2RXAqFEeaFCJCbm44qKj5s++VGPDlRHI GNnHyDeQSmjKUT4s7FO+9HsxIT2Wekui2loYeKG6rEC8SWWMyojNMj5BN7DVoc9OnqXmTPGsOjreV 1+DLxtE26C0EY7OM++xaYR0zKkvj2X/1atbTgw4T9YxE+0hnfamsj89nc/rSMvlmMY+flxP6GDXBZ sAjpdUNvoLY/C6yTNv3K25F1ZK7aLMnJFNVJIRKRQS49bsqF+QtPL6wp3f9w7m1tw2VPuqv/S/E8L sYKVFDwXpihLHA==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH v4 12/18] installer: Use "partitioning-page" consistently. Date: Wed, 30 Oct 2024 15:30:41 +0100 Message-ID: <82b738b3f2e63aa7a312c03a249530f765132eef.1730296564.git.janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Debbugs-Cc: Josselin Poiret , Ludovic Courtès , Mathieu Othacehe Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Having `partition-page' function call `RUN-partititionING-page' where all other proxy functions call `RUN-' hurts my brain while refactoring. * gnu/installer/record.scm ()[partition-page]: Rename to... [partitioning-page]: ...this. * gnu/installer/newt.scm (partitioning-page, newt-installer): Update accordingly. * gnu/installer.scm (installer-steps): Update accordingly. Change-Id: I6b2f3459a3d0a7a89260224b7d8438676e3411ba --- gnu/installer.scm | 3 ++- gnu/installer/newt.scm | 5 +++-- gnu/installer/record.scm | 5 +++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/gnu/installer.scm b/gnu/installer.scm index 3dfcb7581a..3a05843cab 100644 --- a/gnu/installer.scm +++ b/gnu/installer.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2019, 2020, 2022 Ludovic Courtès ;;; Copyright © 2019, 2020 Tobias Geerinckx-Rice ;;; Copyright © 2020 Florian Pelz +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -312,7 +313,7 @@ (define (installer-steps) (id 'partition) (description (G_ "Partitioning")) (compute (lambda _ - ((installer-partition-page current-installer)))) + ((installer-partitioning-page current-installer)))) (configuration-formatter user-partitions->configuration)) (installer-step diff --git a/gnu/installer/newt.scm b/gnu/installer/newt.scm index e1c4453168..6d8ea35fff 100644 --- a/gnu/installer/newt.scm +++ b/gnu/installer/newt.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018, 2020 Mathieu Othacehe +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -193,7 +194,7 @@ (define (hostname-page) (define (user-page) (run-user-page)) -(define (partition-page) +(define (partitioning-page) (run-partitioning-page)) (define (services-page) @@ -220,7 +221,7 @@ (define newt-installer (timezone-page timezone-page) (hostname-page hostname-page) (user-page user-page) - (partition-page partition-page) + (partitioning-page partitioning-page) (services-page services-page) (welcome-page welcome-page) (parameters-menu parameters-menu) diff --git a/gnu/installer/record.scm b/gnu/installer/record.scm index 5e0264682f..334af44a0c 100644 --- a/gnu/installer/record.scm +++ b/gnu/installer/record.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018, 2020 Mathieu Othacehe ;;; Copyright © 2020 Florian Pelz +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -37,7 +38,7 @@ (define-module (gnu installer record) installer-timezone-page installer-hostname-page installer-user-page - installer-partition-page + installer-partitioning-page installer-services-page installer-welcome-page installer-parameters-menu @@ -86,7 +87,7 @@ (define-record-type* ;; procedure void -> void (user-page installer-user-page) ;; procedure void -> void - (partition-page installer-partition-page) + (partitioning-page installer-partitioning-page) ;; procedure void -> void (services-page installer-services-page) ;; procedure (logo #:pci-database) -> void -- Janneke Nieuwenhuizen | GNU LilyPond https://LilyPond.org Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 30 10:34:14 2024 Received: (at 73927) by debbugs.gnu.org; 30 Oct 2024 14:34:14 +0000 Received: from localhost ([127.0.0.1]:35380 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69m1-0003zj-Rv for submit@debbugs.gnu.org; Wed, 30 Oct 2024 10:34:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47394) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69lg-0003wA-0L for 73927@debbugs.gnu.org; Wed, 30 Oct 2024 10:33:53 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t69jV-0003Np-67; Wed, 30 Oct 2024 10:31:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=66z09eNp2NsUEqlFl/pShqGkUl5/a7OKnCtzAjDTokw=; b=IPgacWtSAcZg2D5JO7I1 diVaEzeQuRrjOo8b+C3gMBjCzcxi8d5Kbqzuhn46jMnjE/ZRmrs/YSKMPGCyfGwZe2FXevJmYnFVo S+5eWaeVHsCtxgQfcfy5ShgkL5H4XU31kulHvsgpL4OHMY+YonGvmckos3aepwstuZKMngErJPBpJ nEqpKVH5iewcqAKDviwaqHqPATVb6NkT6PesbV021/QKhFLeqoMFEVIFzIKfdtYY8/SnnRFs9fFqt qyi5PFDpNoLzeexhoPWS02oLfP0JJl3BJMNq3WzzajWBP//xiyXynfdcIFGb4gwk9mnl7Fo7rJckr CoUo3Tq4vDWxPQ==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH v4 14/18] installer: Use `%' for parameter %run-command-in-installer. Date: Wed, 30 Oct 2024 15:30:43 +0100 Message-ID: <5ffe4e5ea10ac9920ea17673275f178c4a060442.1730296564.git.janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Debbugs-Cc: Josselin Poiret , Ludovic Courtès , Mathieu Othacehe Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/installer/utils.scm (run-command-in-installer): Rename to... (%run-command-in-installer): ...this. * gnu/installer.scm (installer-program): Update accordingly. * gnu/installer/parted.scm (remove-logical-devices, create-btrfs-file-system, create-ext4-file-system, create-fat16-file-system, create-fat32-file-system, create-jfs-file-system, create-ntfs-file-system, create-xfs-file-system, create-swap-partition, luks-format-and-open, luks-ensure-open, luks-close): Update accordingly. Change-Id: I96ebc59ebc85fd8ebccb0cc57130b4e7532d287f --- gnu/installer.scm | 2 +- gnu/installer/parted.scm | 27 ++++++++++++++------------- gnu/installer/utils.scm | 6 +++--- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/gnu/installer.scm b/gnu/installer.scm index 3a05843cab..21809e4259 100644 --- a/gnu/installer.scm +++ b/gnu/installer.scm @@ -465,7 +465,7 @@ (define (installer-program) (installer-init current-installer) (lambda () (parameterize - ((run-command-in-installer + ((%run-command-in-installer (installer-run-command current-installer))) (catch #t (lambda () diff --git a/gnu/installer/parted.scm b/gnu/installer/parted.scm index dbdec1bba8..e59df3d8e6 100644 --- a/gnu/installer/parted.scm +++ b/gnu/installer/parted.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2019-2020, 2022, 2024 Ludovic Courtès ;;; Copyright © 2020 Tobias Geerinckx-Rice ;;; Copyright © 2022 Josselin Poiret +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -363,7 +364,7 @@ (define* (force-device-sync device) (define (remove-logical-devices) "Remove all active logical devices." - ((run-command-in-installer) "dmsetup" "remove_all")) + ((%run-command-in-installer) "dmsetup" "remove_all")) (define (installer-root-partition-path) "Return the root partition path, or #f if it could not be detected." @@ -1183,7 +1184,7 @@ (define (set-user-partitions-file-name user-partitions) (define (create-btrfs-file-system partition) "Create a btrfs file-system for PARTITION file-name." - ((run-command-in-installer) "mkfs.btrfs" "-f" partition)) + ((%run-command-in-installer) "mkfs.btrfs" "-f" partition)) (define (create-ext4-file-system partition) "Create an ext4 file-system for PARTITION file-name." @@ -1192,32 +1193,32 @@ (define (create-ext4-file-system partition) ;; up and adding new files would fail with ENOSPC despite there being plenty ;; of free space and inodes: ;; . - ((run-command-in-installer) "mkfs.ext4" "-F" partition + ((%run-command-in-installer) "mkfs.ext4" "-F" partition "-O" "large_dir")) (define (create-fat16-file-system partition) "Create a fat16 file-system for PARTITION file-name." - ((run-command-in-installer) "mkfs.fat" "-F16" partition)) + ((%run-command-in-installer) "mkfs.fat" "-F16" partition)) (define (create-fat32-file-system partition) "Create a fat32 file-system for PARTITION file-name." - ((run-command-in-installer) "mkfs.fat" "-F32" partition)) + ((%run-command-in-installer) "mkfs.fat" "-F32" partition)) (define (create-jfs-file-system partition) "Create a JFS file-system for PARTITION file-name." - ((run-command-in-installer) "jfs_mkfs" "-f" partition)) + ((%run-command-in-installer) "jfs_mkfs" "-f" partition)) (define (create-ntfs-file-system partition) "Create a JFS file-system for PARTITION file-name." - ((run-command-in-installer) "mkfs.ntfs" "-F" "-f" partition)) + ((%run-command-in-installer) "mkfs.ntfs" "-F" "-f" partition)) (define (create-xfs-file-system partition) "Create an XFS file-system for PARTITION file-name." - ((run-command-in-installer) "mkfs.xfs" "-f" partition)) + ((%run-command-in-installer) "mkfs.xfs" "-f" partition)) (define (create-swap-partition partition) "Set up swap area on PARTITION file-name." - ((run-command-in-installer) "mkswap" "-f" partition)) + ((%run-command-in-installer) "mkswap" "-f" partition)) (define (call-with-luks-key-file password proc) "Write PASSWORD in a temporary file and pass it to PROC as argument." @@ -1246,9 +1247,9 @@ (define (luks-format-and-open user-partition) (lambda (key-file) (installer-log-line "formatting and opening LUKS entry ~s at ~s" label file-name) - ((run-command-in-installer) "cryptsetup" "-q" "luksFormat" + ((%run-command-in-installer) "cryptsetup" "-q" "luksFormat" file-name key-file) - ((run-command-in-installer) "cryptsetup" "open" "--type" "luks" + ((%run-command-in-installer) "cryptsetup" "open" "--type" "luks" "--key-file" key-file file-name label))))) (define (luks-ensure-open user-partition) @@ -1262,14 +1263,14 @@ (define (luks-ensure-open user-partition) (lambda (key-file) (installer-log-line "opening LUKS entry ~s at ~s" label file-name) - ((run-command-in-installer) "cryptsetup" "open" "--type" "luks" + ((%run-command-in-installer) "cryptsetup" "open" "--type" "luks" "--key-file" key-file file-name label)))))) (define (luks-close user-partition) "Close the encrypted partition pointed by USER-PARTITION." (let ((label (user-partition-crypt-label user-partition))) (installer-log-line "closing LUKS entry ~s" label) - ((run-command-in-installer) "cryptsetup" "close" label))) + ((%run-command-in-installer) "cryptsetup" "close" label))) (define (format-user-partitions user-partitions) "Format the records in USER-PARTITIONS list with diff --git a/gnu/installer/utils.scm b/gnu/installer/utils.scm index c722e9af8f..170f036537 100644 --- a/gnu/installer/utils.scm +++ b/gnu/installer/utils.scm @@ -50,7 +50,7 @@ (define-module (gnu installer utils) run-external-command-with-handler/tty run-external-command-with-line-hooks run-command - run-command-in-installer + %run-command-in-installer syslog-port %syslog-line-hook @@ -222,13 +222,13 @@ (define* (run-command command #:key (tty? #f)) (pause) succeeded?) -(define run-command-in-installer +(define %run-command-in-installer (make-parameter (lambda (. args) (raise (condition (&serious) - (&message (message "run-command-in-installer not set"))))))) + (&message (message "%run-command-in-installer not set"))))))) ;;; -- Janneke Nieuwenhuizen | GNU LilyPond https://LilyPond.org Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 30 10:34:15 2024 Received: (at 73927) by debbugs.gnu.org; 30 Oct 2024 14:34:15 +0000 Received: from localhost ([127.0.0.1]:35382 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69m2-0003zm-JU for submit@debbugs.gnu.org; Wed, 30 Oct 2024 10:34:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47410) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69li-0003wD-1S for 73927@debbugs.gnu.org; Wed, 30 Oct 2024 10:33:55 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t69jX-0003O4-7e; Wed, 30 Oct 2024 10:31:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=hH3yNAhUyHMSo8d06nb5LU0qNi+QM2cJadabsvH0PmU=; b=PEXSlk3BPgywLCEw2hk/ rNNekVWjjYH0GwhADc8W3iN2q1NuCV+AP1Bi1EurxpWu7S9MmbAwlxfcQcoFX3ZxKvO/9020HYdyE unwTUndIIBjDnp++pnANBDOY/r91Ukv1vspscNr8CKdA8S/pT1/CAFgcq7rjGt8F+cxM8TziFeOd3 YHyjkZgw1fuxlpRkHyYh46I1UrXP4UZ8SaMkfr4w4q0iDAGq7FxjtvDaGJmi253HnKhdioxO6hU5w AGSEq85iqiCdD9pRvWMfArzeGjJyVvEFI6aVx2kcm6CHCVBR2TYtE/WaHn6ICQdyzRz+gG+5QxUam ZIrG2LmCVtSO0g==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH v4 15/18] installer: Add dry-run? Date: Wed, 30 Oct 2024 15:30:44 +0100 Message-ID: <8f8ac43e07951ab068ed7ad52baf8424090cf8fa.1730296564.git.janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Debbugs-Cc: Josselin Poiret , Ludovic Courtès , Mathieu Othacehe Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) This allows running the installer without root privileges. Do something like ./pre-inst-env guix repl ,use (guix) ,use (gnu installer) (installer-program #:dry-run? #t) ,build $1 => "/gnu/store/...-installer-program" and run /gnu/store/...-installer-program * gnu/installer/newt.scm (locale-page): Add #:dry-run? parameter. (keymap-page): Likewise. * gnu/installer/newt/keymap.scm (run-keymap-page): Likewise. * gnu/installer/steps.scm (run-installer-steps): Likewise. Use it to skip writing to socket. * gnu/installer/newt/final.scm (run-final-page): Rename to... (run-final-page-install): ...this. (dry-run-final-page, run-final-page): New procedures. * gnu/installer/parted.scm (bootloader-configuration): Cater for empty user partitions. * gnu/installer/utils.scm (dry-run-command): New procedure. * gnu/installer.scm (compute-locale-step): Add #:dry-run? parameter. Use it to avoid actually applying locale. (compute-keymap-step): Add dry-run? parameter. Pass it to keymap-page. (installer-program): Add #:dry-run? parameter. If #:true avoid writing to /proc, use dry-run-command, skip sync and reboot, and pass dry-run? to... (installer-steps): ...here. Add #:dry-run? parameter. Use it to disable skip network, substitutes, partitioning pages, and pass it to... compute-locale-step, compute-keymap-step, and final-page. Change-Id: I0ff4c3b0a0c69539af617c27ba37654beed44619 --- gnu/installer.scm | 81 ++++++++++++++++++++------------ gnu/installer/newt.scm | 14 +++--- gnu/installer/newt/final.scm | 20 +++++++- gnu/installer/newt/keymap.scm | 5 +- gnu/installer/newt/locale.scm | 6 ++- gnu/installer/newt/partition.scm | 1 + gnu/installer/parted.scm | 29 +++++++----- gnu/installer/steps.scm | 16 +++++-- gnu/installer/utils.scm | 4 ++ 9 files changed, 116 insertions(+), 60 deletions(-) diff --git a/gnu/installer.scm b/gnu/installer.scm index 21809e4259..39a83c4455 100644 --- a/gnu/installer.scm +++ b/gnu/installer.scm @@ -134,7 +134,8 @@ (define apply-locale (define* (compute-locale-step #:key locales-name iso639-languages-name - iso3166-territories-name) + iso3166-territories-name + dry-run?) "Return a gexp that run the locale-page of INSTALLER, and install the selected locale. The list of locales, languages and territories passed to locale-page are computed in derivations named respectively LOCALES-NAME, @@ -177,8 +178,11 @@ (define* (compute-locale-step #:key ((installer-locale-page current-installer) #:supported-locales #$locales-loader #:iso639-languages #$iso639-loader - #:iso3166-territories #$iso3166-loader))) - (#$apply-locale result) + #:iso3166-territories #$iso3166-loader + #:dry-run? #$dry-run?))) + (if #$dry-run? + '() + (#$apply-locale result)) result)))) (define apply-keymap @@ -188,7 +192,7 @@ (define apply-keymap (kmscon-update-keymap (default-keyboard-model) layout variant options)))) -(define* (compute-keymap-step context) +(define (compute-keymap-step context dry-run?) "Return a gexp that runs the keymap-page of INSTALLER and install the selected keymap." #~(lambda (current-installer) @@ -200,15 +204,16 @@ (define* (compute-keymap-step context) "/share/X11/xkb/rules/base.xml"))) (lambda (models layouts) ((installer-keymap-page current-installer) - layouts '#$context))))) + layouts '#$context #$dry-run?))))) (and result (#$apply-keymap result)) result))) -(define (installer-steps) +(define* (installer-steps #:key dry-run?) (let ((locale-step (compute-locale-step #:locales-name "locales" #:iso639-languages-name "iso639-languages" - #:iso3166-territories-name "iso3166-territories")) + #:iso3166-territories-name "iso3166-territories" + #:dry-run? dry-run?)) (timezone-data #~(string-append #$tzdata "/share/zoneinfo/zone.tab"))) #~(lambda (current-installer) @@ -216,7 +221,7 @@ (define (installer-steps) (lambda () ((installer-parameters-page current-installer) (lambda _ - (#$(compute-keymap-step 'param) + (#$(compute-keymap-step 'param dry-run?) current-installer))))) (list ;; Ask the user to choose a locale among those supported by @@ -262,8 +267,10 @@ (define (installer-steps) (id 'keymap) (description (G_ "Keyboard mapping selection")) (compute (lambda _ - (#$(compute-keymap-step 'default) - current-installer))) + (if #$dry-run? + '("en" "US" #f) + (#$(compute-keymap-step 'default dry-run?) + current-installer)))) (configuration-formatter keyboard-layout->configuration)) ;; Ask the user to input a hostname for the system. @@ -280,14 +287,18 @@ (define (installer-steps) (id 'network) (description (G_ "Network selection")) (compute (lambda _ - ((installer-network-page current-installer))))) + (if #$dry-run? + '() + ((installer-network-page current-installer)))))) ;; Ask whether to enable substitute server discovery. (installer-step (id 'substitutes) (description (G_ "Substitute server discovery")) (compute (lambda _ - ((installer-substitutes-page current-installer))))) + (if #$dry-run? + '() + ((installer-substitutes-page current-installer)))))) ;; Prompt for users (name, group and home directory). (installer-step @@ -313,7 +324,9 @@ (define (installer-steps) (id 'partition) (description (G_ "Partitioning")) (compute (lambda _ - ((installer-partitioning-page current-installer)))) + (if #$dry-run? + '() + ((installer-partitioning-page current-installer))))) (configuration-formatter user-partitions->configuration)) (installer-step @@ -322,7 +335,7 @@ (define (installer-steps) (compute (lambda (result prev-steps) ((installer-final-page current-installer) - result prev-steps)))))))) + result prev-steps #$dry-run?)))))))) (define (provenance-sexp) "Return an sexp representing the currently-used channels, for logging @@ -343,7 +356,7 @@ (define (provenance-sexp) `(channel ,(channel-name channel) ,url ,(channel-commit channel)))) channels)))) -(define (installer-program) +(define* (installer-program #:key dry-run?) "Return a file-like object that runs the given INSTALLER." (define init-gettext ;; Initialize gettext support, so that installer messages can be @@ -377,7 +390,7 @@ (define (installer-program) (lambda () (set-path-environment-variable "PATH" '("bin" "sbin") inputs))))) - (define steps (installer-steps)) + (define steps (installer-steps #:dry-run? dry-run?)) (define modules (scheme-modules* (string-append (current-source-directory) "/..") @@ -425,9 +438,10 @@ (define (installer-program) ;; Enable core dump generation. (setrlimit 'core #f #f) - (call-with-output-file "/proc/sys/kernel/core_pattern" - (lambda (port) - (format port %core-dump))) + (unless #$dry-run? + (call-with-output-file "/proc/sys/kernel/core_pattern" + (lambda (port) + (format port %core-dump)))) ;; Initialize gettext support so that installers can use ;; (guix i18n) module. @@ -466,24 +480,29 @@ (define (installer-program) (lambda () (parameterize ((%run-command-in-installer - (installer-run-command current-installer))) + (if #$dry-run? + dry-run-command + (installer-run-command current-installer)))) (catch #t (lambda () (define results (run-installer-steps #:rewind-strategy 'menu #:menu-proc (installer-menu-page current-installer) - #:steps steps)) - - (match (result-step results 'final) - ('success - ;; We did it! Let's reboot! - (sync) - (stop-service 'root)) - (_ - ;; The installation failed, exit so that it is - ;; restarted by login. - #f))) + #:steps steps + #:dry-run? #$dry-run?)) + + (let ((result (result-step results 'final))) + (unless #$dry-run? + (match (result-step results 'final) + ('success + ;; We did it! Let's reboot! + (sync) + (stop-service 'root)) + (_ + ;; The installation failed, exit so that it is + ;; restarted by login. + #f))))) (const #f) (lambda (key . args) (installer-log-line "crashing due to uncaught exception: ~s ~s" diff --git a/gnu/installer/newt.scm b/gnu/installer/newt.scm index 6d8ea35fff..d53bc058b3 100644 --- a/gnu/installer/newt.scm +++ b/gnu/installer/newt.scm @@ -158,17 +158,19 @@ (define (newt-run-command . args) (term-signal term-sig) (stop-signal stop-sig))))))))))) -(define (final-page result prev-steps) - (run-final-page result prev-steps)) +(define (final-page result prev-steps dry-run?) + (run-final-page result prev-steps dry-run?)) (define* (locale-page #:key supported-locales iso639-languages - iso3166-territories) + iso3166-territories + dry-run?) (run-locale-page #:supported-locales supported-locales #:iso639-languages iso639-languages - #:iso3166-territories iso3166-territories)) + #:iso3166-territories iso3166-territories + #:dry-run? dry-run?)) (define (timezone-page zonetab) (run-timezone-page zonetab)) @@ -179,8 +181,8 @@ (define* (welcome-page logo #:key pci-database) (define (menu-page steps) (run-menu-page steps)) -(define* (keymap-page layouts context) - (run-keymap-page layouts #:context context)) +(define (keymap-page layouts context dry-run?) + (run-keymap-page layouts #:context context #:dry-run? dry-run?)) (define (network-page) (run-network-page)) diff --git a/gnu/installer/newt/final.scm b/gnu/installer/newt/final.scm index 9f950a0551..c4e53f6d79 100644 --- a/gnu/installer/newt/final.scm +++ b/gnu/installer/newt/final.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018, 2020 Mathieu Othacehe ;;; Copyright © 2019, 2020 Ludovic Courtès +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -106,7 +107,7 @@ (define* (run-install-shell locale (newt-resume) install-ok?)) -(define (run-final-page result prev-steps) +(define (run-final-page-install result prev-steps) (define (wait-for-clients) (unless (null? (current-clients)) (installer-log-line "waiting with clients before starting final step") @@ -133,3 +134,20 @@ (define (run-final-page result prev-steps) (if install-ok? (run-install-success-page) (run-install-failed-page)))) + +(define (dry-run-final-page result prev-steps) + (installer-log-line "proceeding with final step -- dry-run") + (let* ((configuration (format-configuration prev-steps result)) + (user-partitions (result-step result 'partition)) + (locale (result-step result 'locale)) + (users (result-step result 'user)) + (file (configuration->file configuration)) + (install-ok? (run-config-display-page #:locale locale))) + (if install-ok? + (run-install-success-page) + (run-install-failed-page)))) + +(define (run-final-page result prev-steps dry-run?) + (if dry-run? + (dry-run-final-page result prev-steps) + (run-final-page-install result prev-steps))) diff --git a/gnu/installer/newt/keymap.scm b/gnu/installer/newt/keymap.scm index 109ec55e0a..57f6d6530c 100644 --- a/gnu/installer/newt/keymap.scm +++ b/gnu/installer/newt/keymap.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2018, 2020 Mathieu Othacehe ;;; Copyright © 2019 Ludovic Courtès ;;; Copyright © 2020 Florian Pelz +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -153,7 +154,7 @@ (define (toggleable-latin-layout layout variant) "grp:alt_shift_toggle")) (list layout variant #f))) -(define* (run-keymap-page layouts #:key (context #f)) +(define* (run-keymap-page layouts #:key context dry-run?) "Run a page asking the user to select a keyboard layout and variant. LAYOUTS is a list of supported X11-KEYMAP-LAYOUT. For non-Latin keyboard layouts, a second layout and toggle options will be added automatically. Return a list @@ -201,7 +202,7 @@ (define* (run-keymap-page layouts #:key (context #f)) "xkeyboard-config"))))) (toggleable-latin-layout layout variant))) - (let* ((result (run-installer-steps #:steps keymap-steps)) + (let* ((result (run-installer-steps #:steps keymap-steps #:dry-run? dry-run?)) (layout (result-step result 'layout)) (variant (result-step result 'variant))) (and layout diff --git a/gnu/installer/newt/locale.scm b/gnu/installer/newt/locale.scm index a226b39ba6..0be9db449e 100644 --- a/gnu/installer/newt/locale.scm +++ b/gnu/installer/newt/locale.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018 Mathieu Othacehe ;;; Copyright © 2019 Ludovic Courtès +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -92,7 +93,8 @@ (define (run-modifier-page modifiers modifier->text) (define* (run-locale-page #:key supported-locales iso639-languages - iso3166-territories) + iso3166-territories + dry-run?) "Run a page asking the user to select a locale language and possibly territory, codeset and modifier. Use SUPPORTED-LOCALES as the list of glibc available locales. ISO639-LANGUAGES is an association list associating a @@ -212,4 +214,4 @@ (define* (run-locale-page #:key ;; step, turn the result into a glibc locale string and return it. (result->locale-string supported-locales - (run-installer-steps #:steps locale-steps))) + (run-installer-steps #:steps locale-steps #:dry-run? dry-run?))) diff --git a/gnu/installer/newt/partition.scm b/gnu/installer/newt/partition.scm index 37656696c1..48dd306080 100644 --- a/gnu/installer/newt/partition.scm +++ b/gnu/installer/newt/partition.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2018, 2019, 2022 Mathieu Othacehe ;;; Copyright © 2019, 2020 Ludovic Courtès ;;; Copyright © 2020 Tobias Geerinckx-Rice +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; diff --git a/gnu/installer/parted.scm b/gnu/installer/parted.scm index e59df3d8e6..b36b238d8b 100644 --- a/gnu/installer/parted.scm +++ b/gnu/installer/parted.scm @@ -1461,19 +1461,22 @@ (define (root-user-partition? partition) (define (bootloader-configuration user-partitions) "Return the bootloader configuration field for USER-PARTITIONS." - (let* ((root-partition (find root-user-partition? - user-partitions)) - (root-partition-disk (user-partition-disk-file-name root-partition))) - `((bootloader-configuration - ,@(if (efi-installation?) - `((bootloader grub-efi-bootloader) - (targets (list ,(default-esp-mount-point)))) - `((bootloader grub-bootloader) - (targets (list ,root-partition-disk)))) - - ;; XXX: Assume we defined the 'keyboard-layout' field of - ;; right above. - (keyboard-layout keyboard-layout))))) + (let ((root-partition (find root-user-partition? user-partitions))) + (match user-partitions + (() '()) + (_ + (let ((root-partition-disk (user-partition-disk-file-name + root-partition))) + `((bootloader-configuration + ,@(if (efi-installation?) + `((bootloader grub-efi-bootloader) + (targets (list ,(default-esp-mount-point)))) + `((bootloader grub-bootloader) + (targets (list ,root-partition-disk)))) + + ;; XXX: Assume we defined the 'keyboard-layout' field of + ;; right above. + (keyboard-layout keyboard-layout)))))))) (define (user-partition-missing-modules user-partitions) "Return the list of kernel modules missing from the default set of kernel diff --git a/gnu/installer/steps.scm b/gnu/installer/steps.scm index 0c505e40e4..de0a852f02 100644 --- a/gnu/installer/steps.scm +++ b/gnu/installer/steps.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018, 2019 Mathieu Othacehe ;;; Copyright © 2020-2022 Ludovic Courtès +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -84,7 +85,8 @@ (define-record-type* (define* (run-installer-steps #:key steps (rewind-strategy 'previous) - (menu-proc (const #f))) + (menu-proc (const #f)) + dry-run?) "Run the COMPUTE procedure of all records in STEPS sequentially, inside a the 'installer-step prompt. When aborted to with a parameter of 'abort, fallback to a previous install-step, accordingly to the @@ -191,10 +193,14 @@ (define* (run-installer-steps #:key ;; prematurely. (sigaction SIGPIPE SIG_IGN) - (with-server-socket - (run '() - #:todo-steps steps - #:done-steps '()))) + (if dry-run? + (run '() + #:todo-steps steps + #:done-steps '()) + (with-server-socket + (run '() + #:todo-steps steps + #:done-steps '())))) (define (find-step-by-id steps id) "Find and return the step in STEPS whose id is equal to ID." diff --git a/gnu/installer/utils.scm b/gnu/installer/utils.scm index 170f036537..a8eb6cee83 100644 --- a/gnu/installer/utils.scm +++ b/gnu/installer/utils.scm @@ -49,6 +49,7 @@ (define-module (gnu installer utils) run-external-command-with-handler run-external-command-with-handler/tty run-external-command-with-line-hooks + dry-run-command run-command %run-command-in-installer @@ -222,6 +223,9 @@ (define* (run-command command #:key (tty? #f)) (pause) succeeded?) +(define (dry-run-command . args) + (format #t "dry-run-command: skipping: ~a\n" args)) + (define %run-command-in-installer (make-parameter (lambda (. args) -- Janneke Nieuwenhuizen | GNU LilyPond https://LilyPond.org Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 30 10:34:18 2024 Received: (at 73927) by debbugs.gnu.org; 30 Oct 2024 14:34:18 +0000 Received: from localhost ([127.0.0.1]:35384 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69m4-0003zy-8O for submit@debbugs.gnu.org; Wed, 30 Oct 2024 10:34:18 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39254) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69lk-0003wE-30 for 73927@debbugs.gnu.org; Wed, 30 Oct 2024 10:33:58 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t69jZ-0003OR-3h; Wed, 30 Oct 2024 10:31:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=gbOVyxRoqU2XvJu0I62g1k/8XfHucUSERm+k9iTJ0NY=; b=EpHRQFKz9rhhuWt17wlI m3nuVrnUPGYRadoQMFYvS0938mMfNm1+sy2qOl9zUM8ADpTev8ipCxqiUBbd73RUE0dYlHCPzIRh/ qKxm4IHiaMCdbbfqiN1dk7Cnb1L79RubPIvbVklFG3Up9/aZ7V37ni0Uf8/O113497GdAlBxNtbLr 9VL2top24BGLrSHshAHgftpvIWCV/DSyDyYI5PtK1WJGSCmetIC7OiZ443JNdZloAC6I6UnSVAEqO 76nZWGaS7cDG2Mrmg5xMYAAkXMgOLSgZcJZdf+L+Pi4rAJe6VL4H+Ul+SDB0I5ef6xk3t/rZAWWNT oAHeFKORbDJ0LQ==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH v4 16/18] installer: Add "Kernel" page to select the Hurd. Date: Wed, 30 Oct 2024 15:30:45 +0100 Message-ID: X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Debbugs-Cc: Josselin Poiret , Ludovic Courtès , Mathieu Othacehe Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) This adds a "Kernel" page to the installer with the option to (cross-) install the Hurd, if applicable (only available on x86 machines for now). * gnu/installer/newt.scm (kernel-page): New procedure. (newt-installer)[kernel-page]: New field. * gnu/installer/kernel.scm, gnu/installer/newt/kernel.scm: New files. * gnu/local.mk (INSTALLER_MODULES): Add them. * gnu/installer.scm (installer-steps): Use them to select kernel if applicable. * gnu/installer/newt/partition.scm (run-label-page): Default to "msdos" when instaling the Hurd. (run-fs-type-page): Add ext2 for the hurd. (run-partitioning-page-partition): Remove `entire-encrypted' option when installing the Hurd. * gnu/installer/services.scm (system-services->configuration): Cater for the Hurd with %base-services/hurd, and with %base-packages/hurd that must always be set. (%system-services): Change to procedure. When installing the the Hurd, do not recommend `ntp-service-type' and USE `openssh-sans-x' package for `openssh-service-type'. (system-service-none): New variable. * gnu/installer/newt/services.scm (run-network-management-page): Include it when installing the Hurd. (run-desktop-environments-cbt-page): When installing the Hurd, recommend to not select any desktop enviroment. Update users. * gnu/installer/parted.scm (efi-installation?): Return #f when installing for the Hurd. (create-ext2-file-system): New procedure. (user-fs-type-name, user-fs-type->mount-type, partition-filesystem-user-type, format-user-partitions): Support `ext2'. ( partition->user-partition): Use `ext2' when installing the Hurd. (auto-partition!): Likewise. No swap partition when installing the Hurd. * gnu/installer/final.scm (install-system): Cater for cross installation of the Hurd. (bootloader-configuration): Use `grub-minimal-bootloader' when installing the Hurd. (user-partition-missing-modules): Cater for empty user-partitions. (initrd-configuration, user-partitions->configuration): Cater for the Hurd. * gnu/installer/steps.scm (format-configuration, configuration->file): Cater for the Hurd. * gnu/system/hurd.scm (%desktop-services/hurd): New variable. * gnu/installer/tests.scm (choose-kernel): New procedure. * gnu/tests/install.scm (gui-test-program): Use it. Change-Id: Ifafb27b8a2f933944c77223a27ec151757237e36 --- gnu/installer.scm | 14 +++++ gnu/installer/final.scm | 9 +++- gnu/installer/kernel.scm | 41 +++++++++++++++ gnu/installer/newt.scm | 5 ++ gnu/installer/newt/kernel.scm | 45 ++++++++++++++++ gnu/installer/newt/partition.scm | 10 +++- gnu/installer/newt/services.scm | 31 ++++++----- gnu/installer/parted.scm | 89 +++++++++++++++++++++----------- gnu/installer/record.scm | 3 ++ gnu/installer/services.scm | 46 +++++++++++++---- gnu/installer/steps.scm | 14 +++-- gnu/installer/tests.scm | 11 ++++ gnu/local.mk | 2 + gnu/system/hurd.scm | 3 ++ gnu/tests/install.scm | 6 ++- 15 files changed, 269 insertions(+), 60 deletions(-) create mode 100644 gnu/installer/kernel.scm create mode 100644 gnu/installer/newt/kernel.scm diff --git a/gnu/installer.scm b/gnu/installer.scm index 39a83c4455..31c0ff7ff4 100644 --- a/gnu/installer.scm +++ b/gnu/installer.scm @@ -308,6 +308,18 @@ (define* (installer-steps #:key dry-run?) ((installer-user-page current-installer)))) (configuration-formatter users->configuration)) + ;; Ask the user to select the kernel for the system, + ;; for x86 systems only. + (installer-step + (id 'kernel) + (description (G_ "Kernel")) + (compute (lambda _ + (if (target-x86?) + ((installer-kernel-page current-installer)) + '()))) + (configuration-formatter (lambda (result) + (kernel->configuration result #$dry-run?)))) + ;; Ask the user to choose one or many desktop environment(s). (installer-step (id 'services) @@ -419,6 +431,7 @@ (define* (installer-program #:key dry-run?) (gnu installer dump) (gnu installer final) (gnu installer hostname) + (gnu installer kernel) (gnu installer locale) (gnu installer parted) (gnu installer services) @@ -431,6 +444,7 @@ (define* (installer-program #:key dry-run?) (gnu services herd) (guix i18n) (guix build utils) + (guix utils) ((system repl debug) #:select (terminal-width)) (ice-9 match) diff --git a/gnu/installer/final.scm b/gnu/installer/final.scm index 069426a3b8..64c054cd86 100644 --- a/gnu/installer/final.scm +++ b/gnu/installer/final.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018, 2020 Mathieu Othacehe ;;; Copyright © 2019, 2020, 2022 Ludovic Courtès +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -25,6 +26,7 @@ (define-module (gnu installer final) #:use-module (gnu services herd) #:use-module (guix build syscalls) #:use-module (guix build utils) + #:use-module (guix utils) #:use-module (gnu build accounts) #:use-module (gnu build install) #:use-module (gnu build linux-container) @@ -164,8 +166,11 @@ (define* (install-system locale #:key (users '())) "/tmp/installer-system-init-options" read)) (const '()))) - (install-command (append (list "guix" "system" "init" - "--fallback") + (install-command (append `( "guix" "system" "init" + "--fallback" + ,@(if (target-hurd?) + '("--target=i586-pc-gnu") + '())) options (list (%installer-configuration-file) (%installer-target-dir)))) diff --git a/gnu/installer/kernel.scm b/gnu/installer/kernel.scm new file mode 100644 index 0000000000..c82b06fb83 --- /dev/null +++ b/gnu/installer/kernel.scm @@ -0,0 +1,41 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2024 Janneke Nieuwenhuizen +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu installer kernel) + #:use-module (gnu system hurd) + #:use-module (guix read-print) + #:export (kernel->configuration)) + +(define-syntax-rule (G_ str) + ;; In this file, translatable strings are annotated with 'G_' so xgettext + ;; catches them, but translation happens later on at run time. + str) + +(define (kernel->configuration kernel dry-run?) + (if (equal? kernel "Hurd") + `((kernel %hurd-default-operating-system-kernel) + ,(comment (G_ ";; \"noide\" disables the gnumach IDE driver, enabling rumpdisk.\n")) + (kernel-arguments '("noide")) + (firmware '()) + (hurd hurd) + (locale-libcs (list glibc/hurd)) + (name-service-switch #f) + (essential-services (hurd-default-essential-services this-operating-system)) + (privileged-programs '()) + (setuid-programs %setuid-programs/hurd)) + '())) diff --git a/gnu/installer/newt.scm b/gnu/installer/newt.scm index d53bc058b3..1fe710340f 100644 --- a/gnu/installer/newt.scm +++ b/gnu/installer/newt.scm @@ -25,6 +25,7 @@ (define-module (gnu installer newt) #:use-module (gnu installer newt final) #:use-module (gnu installer newt parameters) #:use-module (gnu installer newt hostname) + #:use-module (gnu installer newt kernel) #:use-module (gnu installer newt keymap) #:use-module (gnu installer newt locale) #:use-module (gnu installer newt menu) @@ -193,6 +194,9 @@ (define (substitutes-page) (define (hostname-page) (run-hostname-page)) +(define (kernel-page) + (run-kernel-page)) + (define (user-page) (run-user-page)) @@ -216,6 +220,7 @@ (define newt-installer (exit-error exit-error) (final-page final-page) (keymap-page keymap-page) + (kernel-page kernel-page) (locale-page locale-page) (menu-page menu-page) (network-page network-page) diff --git a/gnu/installer/newt/kernel.scm b/gnu/installer/newt/kernel.scm new file mode 100644 index 0000000000..3117247312 --- /dev/null +++ b/gnu/installer/newt/kernel.scm @@ -0,0 +1,45 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2024 Janneke Nieuwenhuizen +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu installer newt kernel) + #:use-module (gnu installer newt page) + #:use-module (guix i18n) + #:use-module (guix utils) + #:export (run-kernel-page)) + +(define (run-kernel-page) + (let* ((kernels `(,@(if (target-x86?) '("Hurd") '()) + "Linux Libre")) + (result + (run-listbox-selection-page + #:title (G_ "Kernel") + #:info-text + (G_ "Please select a kernel. When in doubt, choose \"Linux Libre\". +The Hurd is offered as a technology preview and development aid; many packages \ +are not yet available in Guix, such as a desktop environment or even a windowing \ +system (X, Wayland).") + #:listbox-items kernels + #:listbox-item->text identity + #:listbox-default-item "Linux Libre" + #:button-text (G_ "Back") + #:button-callback-procedure + (lambda _ + (abort-to-prompt 'installer-step 'abort))))) + (when (equal? result "Hurd") + (%current-target-system "i586-pc-gnu")) + result)) diff --git a/gnu/installer/newt/partition.scm b/gnu/installer/newt/partition.scm index 48dd306080..3a7e679577 100644 --- a/gnu/installer/newt/partition.scm +++ b/gnu/installer/newt/partition.scm @@ -26,6 +26,7 @@ (define-module (gnu installer newt partition) #:use-module (gnu installer newt page) #:use-module (gnu installer newt utils) #:use-module (guix i18n) + #:use-module (guix utils) #:use-module (ice-9 format) #:use-module (ice-9 match) #:use-module (srfi srfi-1) @@ -115,6 +116,7 @@ (define (run-label-page button-text button-callback) Be careful, all data on the disk will be lost.") #:title (G_ "Partition table") #:listbox-items '("msdos" "gpt") + #:listbox-default-item (if (target-hurd?) "msdos" "gpt") #:listbox-item->text identity #:listbox-callback-procedure (run-label-confirmation-page button-callback) @@ -147,6 +149,8 @@ (define (run-fs-type-page) #:title (G_ "File-system type") #:listbox-items '(btrfs ext4 jfs xfs swap + ;; This is for the Hurd + ext2 ;; These lack basic Unix features. Their only use ;; on GNU is for interoperation, e.g., with UEFI. fat32 fat16 ntfs) @@ -767,7 +771,11 @@ (define (run-partitioning-page) (define (run-page devices) (let* ((items `((entire . ,(G_ "Guided - using the entire disk")) - (entire-encrypted . ,(G_ "Guided - using the entire disk with encryption")) + ,@(if (target-hurd?) + '() + `((entire-encrypted + . + ,(G_ "Guided - using the entire disk with encryption")))) (manual . ,(G_ "Manual")))) (result (run-listbox-selection-page #:info-text (G_ "Please select a partitioning method.") diff --git a/gnu/installer/newt/services.scm b/gnu/installer/newt/services.scm index d1035b6524..848683e8c7 100644 --- a/gnu/installer/newt/services.scm +++ b/gnu/installer/newt/services.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018 Mathieu Othacehe ;;; Copyright © 2019, 2020 Ludovic Courtès -;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen +;;; Copyright © 2020, 2024 Janneke Nieuwenhuizen ;;; Copyright © 2021 Tobias Geerinckx-Rice ;;; Copyright © 2021 Leo Famulari ;;; @@ -26,6 +26,7 @@ (define-module (gnu installer newt services) #:use-module (gnu installer newt page) #:use-module (gnu installer newt utils) #:use-module (guix i18n) + #:use-module (guix utils) #:use-module (srfi srfi-34) #:use-module (srfi srfi-35) #:export (run-services-page)) @@ -33,11 +34,13 @@ (define-module (gnu installer newt services) (define (run-desktop-environments-cbt-page) "Run a page allowing the user to choose between various desktop environments." - (let ((items (filter desktop-system-service? %system-services))) + (let ((items (filter desktop-system-service? (%system-services)))) (run-checkbox-tree-page - #:info-text (G_ "Please select the desktop environment(s) you wish to \ + #:info-text (if (target-hurd?) + (G_ "Currently, none of these is available for the Hurd.") + (G_ "Please select the desktop environment(s) you wish to \ install. If you select multiple desktop environments here, you will be able \ -to choose from them later when you log in.") +to choose from them later when you log in.")) #:title (G_ "Desktop environment") #:items items #:selection (map system-service-recommended? items) @@ -51,7 +54,7 @@ (define (run-networking-cbt-page) "Run a page allowing the user to select networking services." (let ((items (filter (lambda (service) (eq? 'networking (system-service-type service))) - %system-services))) + (%system-services)))) (run-checkbox-tree-page #:info-text (G_ "You can now select networking services to run on your \ system.") @@ -69,7 +72,7 @@ (define (run-printing-services-cbt-page) (let ((items (filter (lambda (service) (eq? 'document (system-service-type service))) - %system-services))) + (%system-services)))) (run-checkbox-tree-page #:info-text (G_ "You can now select the CUPS printing service to run on your \ system.") @@ -88,7 +91,7 @@ (define (run-console-services-cbt-page) (let ((items (filter (lambda (service) (eq? 'administration (system-service-type service))) - %system-services))) + (%system-services)))) (run-checkbox-tree-page #:title (G_ "Console services") #:info-text (G_ "Select miscellaneous services to run on your \ @@ -103,7 +106,11 @@ (define (run-console-services-cbt-page) (define (run-network-management-page) "Run a page to select among several network management methods." - (let ((title (G_ "Network management"))) + (let ((title (G_ "Network management")) + (items (filter (lambda (service) + (eq? 'network-management + (system-service-type service))) + (%system-services)))) (run-listbox-selection-page #:title title #:info-text (G_ "Choose the method to manage network connections. @@ -112,10 +119,10 @@ (define (run-network-management-page) client may be enough for a server.") #:info-textbox-width 70 #:listbox-height 7 - #:listbox-items (filter (lambda (service) - (eq? 'network-management - (system-service-type service))) - %system-services) + #:listbox-items `(,@items + ,@(if (target-hurd?) + (list system-service-none) + '())) #:listbox-item->text (compose G_ system-service-name) #:sort-listbox-items? #f #:button-text (G_ "Exit") diff --git a/gnu/installer/parted.scm b/gnu/installer/parted.scm index b36b238d8b..ccddc64f11 100644 --- a/gnu/installer/parted.scm +++ b/gnu/installer/parted.scm @@ -152,7 +152,7 @@ (define-record-type* (crypt-password user-partition-crypt-password ; (default #f)) (fs-type user-partition-fs-type - (default 'ext4)) + (default (if (target-hurd?) 'ext2 'ext4))) (bootable? user-partition-bootable? (default #f)) (esp? user-partition-esp? @@ -223,11 +223,13 @@ (define default-esp-mount-point (define (efi-installation?) "Return #t if an EFI installation should be performed, #f otherwise." - (file-exists? "/sys/firmware/efi")) + (and (file-exists? "/sys/firmware/efi") + (not (target-hurd?)))) (define (user-fs-type-name fs-type) "Return the name of FS-TYPE as specified by libparted." (case fs-type + ((ext2) "ext2") ((ext4) "ext4") ((btrfs) "btrfs") ((fat16) "fat16") @@ -240,6 +242,7 @@ (define (user-fs-type-name fs-type) (define (user-fs-type->mount-type fs-type) "Return the mount type of FS-TYPE." (case fs-type + ((ext2) "ext2") ((ext4) "ext4") ((btrfs) "btrfs") ((fat16) "vfat") @@ -255,6 +258,7 @@ (define (partition-filesystem-user-type partition) (and fs-type (let ((name (filesystem-type-name fs-type))) (cond + ((string=? name "ext2") 'ext2) ((string=? name "ext4") 'ext4) ((string=? name "btrfs") 'btrfs) ((string=? name "fat16") 'fat16) @@ -296,7 +300,7 @@ (define (partition->user-partition partition) (file-name (partition-get-path partition)) (disk-file-name (device-path device)) (fs-type (or (partition-filesystem-user-type partition) - 'ext4)) + (if (target-hurd?) 'ext2 'ext4))) (mount-point (and (esp-partition? partition) (default-esp-mount-point))) (bootable? (boot-partition? partition)) @@ -1045,18 +1049,20 @@ (define* (auto-partition! disk non-boot-partitions) (let* ((start-partition - (if (efi-installation?) - (and (not esp-partition) - (user-partition - (fs-type 'fat32) - (esp? #t) - (size new-esp-size) - (mount-point (default-esp-mount-point)))) - (user-partition - (fs-type 'ext4) - (bootable? #t) - (bios-grub? #t) - (size bios-grub-size)))) + (cond ((target-hurd?) #f) + ((efi-installation?) + (and (not esp-partition) + (user-partition + (fs-type 'fat32) + (esp? #t) + (size new-esp-size) + (mount-point (default-esp-mount-point))))) + (else + (user-partition + (fs-type 'ext4) + (bootable? #t) + (bios-grub? #t) + (size bios-grub-size))))) (new-partitions (cond ((or (eq? scheme 'entire-root) @@ -1065,13 +1071,13 @@ (define* (auto-partition! disk `(,@(if start-partition `(,start-partition) '()) - ,@(if encrypted? + ,@(if (or encrypted? (target-hurd?)) '() `(,(user-partition (fs-type 'swap) (size swap-size)))) ,(user-partition - (fs-type 'ext4) + (fs-type (if (target-hurd?) 'ext2 'ext4)) (bootable? has-extended?) (crypt-label (and encrypted? "cryptroot")) (size "100%") @@ -1083,7 +1089,7 @@ (define* (auto-partition! disk `(,start-partition) '()) ,(user-partition - (fs-type 'ext4) + (fs-type (if (target-hurd?) 'ext2 'ext4)) (bootable? has-extended?) (crypt-label (and encrypted? "cryptroot")) (size "33%") @@ -1105,7 +1111,7 @@ (define* (auto-partition! disk (type (if has-extended? 'logical 'normal)) - (fs-type 'ext4) + (fs-type (if (target-hurd?) 'ext2 'ext4)) (crypt-label (and encrypted? "crypthome")) (size "100%") (mount-point "/home"))))))) @@ -1186,6 +1192,15 @@ (define (create-btrfs-file-system partition) "Create a btrfs file-system for PARTITION file-name." ((%run-command-in-installer) "mkfs.btrfs" "-f" partition)) +(define (create-ext2-file-system partition) + "Create an ext2 file-system for PARTITION file-name, when TARGET-HURD?, +for the Hurd." + (apply (%run-command-in-installer) + `("mkfs.ext2" ,@(if (target-hurd?) + '("-o" "hurd") + '()) + "-F" ,partition))) + (define (create-ext4-file-system partition) "Create an ext4 file-system for PARTITION file-name." ;; Enable the 'large_dir' feature so users can have a store of several TiBs. @@ -1291,6 +1306,10 @@ (define (format-user-partitions user-partitions) (and need-formatting? (not (eq? type 'extended)) (create-btrfs-file-system file-name))) + ((ext2) + (and need-formatting? + (not (eq? type 'extended)) + (create-ext2-file-system file-name))) ((ext4) (and need-formatting? (not (eq? type 'extended)) @@ -1463,7 +1482,11 @@ (define (bootloader-configuration user-partitions) "Return the bootloader configuration field for USER-PARTITIONS." (let ((root-partition (find root-user-partition? user-partitions))) (match user-partitions - (() '()) + (() (if (target-hurd?) + '(bootloader-configuration + (bootloader grub-minimal-bootloader) + (targets "/dev/sdaX")) + '())) (_ (let ((root-partition-disk (user-partition-disk-file-name root-partition))) @@ -1471,7 +1494,9 @@ (define (bootloader-configuration user-partitions) ,@(if (efi-installation?) `((bootloader grub-efi-bootloader) (targets (list ,(default-esp-mount-point)))) - `((bootloader grub-bootloader) + `((bootloader ,(if (target-hurd?) + 'grub-minimal-bootloader + 'grub-bootloader)) (targets (list ,root-partition-disk)))) ;; XXX: Assume we defined the 'keyboard-layout' field of @@ -1491,22 +1516,28 @@ (define (user-partition-missing-modules user-partitions) (const '()))) (delete-duplicates (map user-partition-file-name - (cons root devices))))))) + (filter identity + (cons root devices)))))))) (define (initrd-configuration user-partitions) "Return an 'initrd-modules' field with everything needed for USER-PARTITIONS, or return nothing." - (match (user-partition-missing-modules user-partitions) - (() - '()) - ((modules ...) - `((initrd-modules (append ',modules - %base-initrd-modules)))))) + (if (target-hurd?) + '((initrd #f) + (initrd-modules '())) + (match (user-partition-missing-modules user-partitions) + (() + '()) + ((modules ...) + `((initrd-modules (append ',modules + %base-initrd-modules))))))) (define (user-partitions->configuration user-partitions) "Return the configuration field for USER-PARTITIONS." (let* ((swap-user-partitions (find-swap-user-partitions user-partitions)) - (swap-devices (map user-partition-file-name swap-user-partitions)) + (swap-devices (if (target-hurd?) + '() + (map user-partition-file-name swap-user-partitions))) (encrypted-partitions (filter user-partition-crypt-label user-partitions))) `((bootloader ,@(bootloader-configuration user-partitions)) diff --git a/gnu/installer/record.scm b/gnu/installer/record.scm index 334af44a0c..22adad279c 100644 --- a/gnu/installer/record.scm +++ b/gnu/installer/record.scm @@ -30,6 +30,7 @@ (define-module (gnu installer record) installer-exit installer-exit-error installer-final-page + installer-kernel-page installer-keymap-page installer-locale-page installer-menu-page @@ -69,6 +70,8 @@ (define-record-type* (exit-error installer-exit-error) ;; procedure void -> void (final-page installer-final-page) + ;; procedure void -> void + (kernel-page installer-kernel-page) ;; procedure (layouts context) -> (list layout variant options) (keymap-page installer-keymap-page) ;; procedure: (#:key supported-locales iso639-languages iso3166-territories) diff --git a/gnu/installer/services.scm b/gnu/installer/services.scm index 1cb9dc579c..d5a382606c 100644 --- a/gnu/installer/services.scm +++ b/gnu/installer/services.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018 Mathieu Othacehe ;;; Copyright © 2019, 2022 Ludovic Courtès -;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen +;;; Copyright © 2020, 2024 Janneke Nieuwenhuizen ;;; Copyright © 2021 Tobias Geerinckx-Rice ;;; Copyright © 2021 Leo Famulari ;;; Copyright © 2023 Denys Nykula @@ -24,6 +24,7 @@ (define-module (gnu installer services) #:use-module (guix records) #:use-module (guix read-print) + #:use-module (guix utils) #:use-module (ice-9 match) #:use-module (srfi srfi-1) #:export (system-service? @@ -34,6 +35,7 @@ (define-module (gnu installer services) system-service-packages desktop-system-service? + system-service-none %system-services system-services->configuration)) @@ -55,7 +57,13 @@ (define-record-type* (packages system-service-packages ;list of sexps (default '()))) -(define %system-services +(define system-service-none + (system-service + (name (G_ "None")) + (type 'network-management) + (snippet '()))) + +(define (%system-services) (let-syntax ((desktop-environment (syntax-rules () ((_ fields ...) (system-service @@ -105,7 +113,11 @@ (define %system-services (G_ "\ ;; To configure OpenSSH, pass an 'openssh-configuration' ;; record as a second argument to 'service' below.\n")) - (service openssh-service-type)))) + ,(if (target-hurd?) + '(service openssh-service-type + (openssh-configuration + (openssh openssh-sans-x))) + '(service openssh-service-type))))) (system-service (name (G_ "Tor anonymous network router")) (type 'networking) @@ -115,7 +127,7 @@ (define %system-services (system-service (name (G_ "Network time service (NTP), to set the clock automatically")) (type 'administration) - (recommended? #t) + (recommended? (not (target-hurd?))) (snippet '((service ntp-service-type)))) (system-service (name (G_ "GPM mouse daemon, to use the mouse on the console")) @@ -154,8 +166,12 @@ (define (system-services->configuration services) (packages (append-map system-service-packages services)) (desktop? (find desktop-system-service? services)) (base (if desktop? - '%desktop-services - '%base-services)) + (if (target-hurd?) + '%desktop-services/hurd + '%desktop-services) + (if (target-hurd?) + '%base-services/hurd + '%base-services))) (native-console-font (match (getenv "LANGUAGE") ((or "be" "bg" "el" "eo" "kk" "ky" "mk" "mn" "ru" "sr" "tg" "uk") @@ -181,18 +197,28 @@ (define (system-services->configuration services) (if (null? snippets) `(,@(if (null? packages) - '() + (if (target-hurd?) + `(,@package-heading + (packages %base-packages/hurd)) + '()) `(,@package-heading (packages (append (list ,@packages) - %base-packages)))) + ,(if (target-hurd?) + '%base-packages/hurd + '%base-packages))))) ,@service-heading (services ,services)) `(,@(if (null? packages) - '() + (if (target-hurd?) + `(,@package-heading + (packages %base-packages/hurd)) + '()) `(,@package-heading (packages (append (list ,@packages) - %base-packages)))) + ,(if (target-hurd?) + '%base-packages/hurd + '%base-packages))))) ,@service-heading (services (append (list ,@snippets diff --git a/gnu/installer/steps.scm b/gnu/installer/steps.scm index de0a852f02..34dd14c9d5 100644 --- a/gnu/installer/steps.scm +++ b/gnu/installer/steps.scm @@ -23,6 +23,7 @@ (define-module (gnu installer steps) #:use-module (guix build utils) #:use-module (guix i18n) #:use-module (guix read-print) + #:use-module (guix utils) #:use-module (gnu installer utils) #:use-module (ice-9 match) #:use-module (srfi srfi-1) @@ -240,17 +241,20 @@ (define (format-configuration steps results) ,(comment (G_ "\ ;; Indicate which modules to import to access the variables ;; used in this configuration.\n")) - (use-modules (gnu)) + ,@(if (target-hurd?) + '((use-modules (gnu) (gnu system hurd)) + (use-package-modules hurd ssh)) + '((use-modules (gnu)))) (use-service-modules cups desktop networking ssh xorg)))) `(,@modules ,(vertical-space 1) (operating-system ,@configuration)))) (define* (configuration->file configuration - #:key (filename (%installer-configuration-file))) - "Write the given CONFIGURATION to FILENAME." - (mkdir-p (dirname filename)) - (call-with-output-file filename + #:key (file-name (%installer-configuration-file))) + "Write the given CONFIGURATION to FILE-NAME." + (mkdir-p (dirname file-name)) + (call-with-output-file file-name (lambda (port) ;; TRANSLATORS: This is a comment within a Scheme file. Each line must ;; start with ";; " (two semicolons and a space). Please keep line diff --git a/gnu/installer/tests.scm b/gnu/installer/tests.scm index 8785cd9a9f..a9a5d5d988 100644 --- a/gnu/installer/tests.scm +++ b/gnu/installer/tests.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2020 Ludovic Courtès ;;; Copyright © 2020 Mathieu Othacehe +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -35,6 +36,7 @@ (define-module (gnu installer tests) choose-locale+keyboard enter-host-name+passwords + choose-kernel choose-services choose-partitioning start-installation @@ -211,6 +213,15 @@ (define* (enter-host-name+passwords port (password ,password))) names passwords)))))) +(define* (choose-kernel port #:key (kernel "Linux Libre")) + "Converse over PORT with the guided installer to choose the specified +KERNEL." + (converse port + ((list-selection (title "Kernel") + (multiple-choices? #f) + (items _)) + kernel))) + (define* (choose-services port #:key (choose-desktop-environment? (const #f)) diff --git a/gnu/local.mk b/gnu/local.mk index 872e55eb41..e2392962b4 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -863,6 +863,7 @@ INSTALLER_MODULES = \ %D%/installer/final.scm \ %D%/installer/hardware.scm \ %D%/installer/hostname.scm \ + %D%/installer/kernel.scm \ %D%/installer/keymap.scm \ %D%/installer/locale.scm \ %D%/installer/newt.scm \ @@ -881,6 +882,7 @@ INSTALLER_MODULES = \ %D%/installer/newt/final.scm \ %D%/installer/newt/parameters.scm \ %D%/installer/newt/hostname.scm \ + %D%/installer/newt/kernel.scm \ %D%/installer/newt/keymap.scm \ %D%/installer/newt/locale.scm \ %D%/installer/newt/menu.scm \ diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm index 283bae6f10..9a351529e8 100644 --- a/gnu/system/hurd.scm +++ b/gnu/system/hurd.scm @@ -48,6 +48,7 @@ (define-module (gnu system hurd) #:export (%base-packages/hurd %base-services/hurd %base-services+qemu-networking/hurd + %desktop-services/hurd %hurd-default-operating-system %hurd-default-operating-system-kernel %setuid-programs/hurd)) @@ -107,6 +108,8 @@ (define %base-services+qemu-networking/hurd %qemu-static-networking)) %base-services/hurd)) +(define %desktop-services/hurd %base-services/hurd) + (define %setuid-programs/hurd ;; Default set of setuid-root programs. (map file-like->setuid-program diff --git a/gnu/tests/install.scm b/gnu/tests/install.scm index 36dbd9111f..c8dccd38b0 100644 --- a/gnu/tests/install.scm +++ b/gnu/tests/install.scm @@ -3,7 +3,7 @@ ;;; Copyright © 2017, 2019, 2021 Tobias Geerinckx-Rice ;;; Copyright © 2020 Mathieu Othacehe ;;; Copyright © 2020 Danny Milosavljevic -;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen +;;; Copyright © 2020, 2024 Janneke Nieuwenhuizen ;;; Copyright © 2020, 2021, 2022 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. @@ -1869,6 +1869,10 @@ (define* (gui-test-program marionette #$marionette) (screenshot "installer-services.ppm") + (when #$(target-x86?) + (marionette-eval* '(choose-kernel installer-socket) #$marionette) + (screenshot "installer-kernel.ppm")) + (marionette-eval* '(choose-services installer-socket #:choose-desktop-environment? (const #$desktop?) -- Janneke Nieuwenhuizen | GNU LilyPond https://LilyPond.org Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 30 10:34:18 2024 Received: (at 73927) by debbugs.gnu.org; 30 Oct 2024 14:34:18 +0000 Received: from localhost ([127.0.0.1]:35386 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69m6-000401-38 for submit@debbugs.gnu.org; Wed, 30 Oct 2024 10:34:18 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39268) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69lm-0003wc-4m for 73927@debbugs.gnu.org; Wed, 30 Oct 2024 10:33:58 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t69jb-0003Oi-42; Wed, 30 Oct 2024 10:31:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=u8iLXRhHTm7HmKJsJYUs8jZhSiK+cxiJnv3z/vi8xK0=; b=BBN4u58KjsA49r5O6thp AWUKLX3Yfyd55B2dkIeupvdrJn5Vz+y2ftqtK3Hpgq/BmiUFAMWsiQIfJpoMzVF/hl4RP8KbBeopj 7ZJRcE4V275SHsNdnqPHXeovYVWNnHKgdsk/IHTEpiCJR0fY83uOKzvmKCgrxHsMPnEEsE1U6Y4fJ nCk7+XjNFRT9vc8pTyHFQes75MSSKi+ZpFNRq1fbUPiBSXEHEAf7y6VGoQjLZvVf9eJb59jQW64YR tAzPybgKptybbPQnFlM551j4MK5sbpLiesbBvyLhNP7Q9VFDWKAeoWkGchKFj6+qQXCAvjvn88U3z 7dZUVtPH0YbmAw==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH v4 17/18] installer: Add static-networking template. Date: Wed, 30 Oct 2024 15:30:46 +0100 Message-ID: X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Debbugs-Cc: Josselin Poiret , Ludovic Courtès , Mathieu Othacehe Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/installer/services.scm (%system-services): Add static-networking-service-type. Change-Id: Iec6336f8d1f49e8b801e978d5c9eeb4f83a6e748 --- gnu/installer/services.scm | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/gnu/installer/services.scm b/gnu/installer/services.scm index d5a382606c..8b117d9a20 100644 --- a/gnu/installer/services.scm +++ b/gnu/installer/services.scm @@ -149,6 +149,28 @@ (define (%system-services) (name (G_ "DHCP client (dynamic IP address assignment)")) (type 'network-management) (snippet '((service dhcp-client-service-type)))) + (system-service + (name (G_ "Static networking service.")) + (type 'network-management) + (snippet `((service + static-networking-service-type + (list %loopback-static-networking + (static-networking + (addresses + (list + (network-address + (device "eth0") + ,(comment (G_ ";; Fill-in your IP.\n")) + (value "192.168.178.10/24")))) + (routes + (list (network-route + (destination "default") + ,(comment (G_ ";; Fill-in your gateway IP.\n")) + (gateway "192.168.178.1")))) + (requirement '()) + (provision '(networking)) + ,(comment (G_ ";; Fill-in your nameservers.\n")) + (name-servers '("192.168.178.1")))))))) ;; Dealing with documents. (system-service -- Janneke Nieuwenhuizen | GNU LilyPond https://LilyPond.org Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 30 10:34:19 2024 Received: (at 73927) by debbugs.gnu.org; 30 Oct 2024 14:34:19 +0000 Received: from localhost ([127.0.0.1]:35388 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69m6-000409-KH for submit@debbugs.gnu.org; Wed, 30 Oct 2024 10:34:19 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39278) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69lo-0003x3-6R for 73927@debbugs.gnu.org; Wed, 30 Oct 2024 10:34:00 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t69jc-0003P1-Ek; Wed, 30 Oct 2024 10:31:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=cRBY4LgF3AgTp2HN0SD4ISm+rNUXqPHZ8tC+HAS+IRU=; b=gEbItm3EbsB0NAmv45LE e11kBXaPePL0VFegEUMeRvhTjMhQW78woU+4WjenzqpXK9hkHehwV82G+18f+f8tDz2HiC6i1n0vY dNqtlX4Ya/JSrlqVcGVq5UBwd+qK3UKGjjJtdFmdMVHIhORypNPUVr/Xz6meA+I8owGULvYG7zKSy LCMCSG8REVsDgUhYhjHpqT9msAjS99Gd+0GRBaEMj7gYnhTVFOIvRlQToimIGj46smbKBuYLT2MxF /VddAc2gBZsmWVvhn9UH1Bn4XDXsROwg0KGHXn/ZfI2j0Fw5+OvpEN4R9iSvXd5G1Bm348pl8AL7K B+zePc2fmeJHWQ==; From: Janneke Nieuwenhuizen To: 73927@debbugs.gnu.org Subject: [PATCH v4 18/18] installer: Support dry-run from Guile via store. Date: Wed, 30 Oct 2024 15:30:47 +0100 Message-ID: <063f684df97b70d01e76591d4f214c1a9924b531.1730296564.git.janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Debbugs-Cc: Josselin Poiret , Ludovic Courtès , Mathieu Othacehe Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) This supports running the installer quasi-directly from Guile by only building a Guile installer-script in the store. Do something like: ./pre-inst-env guile -c '((@ (gnu installer) run-installer) #:dry-run? #t)' or and BE VERY CAREFUL WHEN NOT USING #:DRY-RUN #T! sudo -E ./pre-inst-env guile -c '((@ (gnu installer) run-installer))' for this to work, you also need connman. * gnu/installer.scm (installer-script, run-installer): New procedures. Change-Id: I8cc1746845ec99f738e35fa91bb2342a674cfa88 --- gnu/installer.scm | 85 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 83 insertions(+), 2 deletions(-) diff --git a/gnu/installer.scm b/gnu/installer.scm index 31c0ff7ff4..0a36f1f67b 100644 --- a/gnu/installer.scm +++ b/gnu/installer.scm @@ -21,10 +21,14 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu installer) + #:use-module (guix build utils) + #:use-module (guix derivations) #:use-module (guix discovery) - #:use-module (guix packages) #:use-module (guix gexp) #:use-module (guix modules) + #:use-module (guix monads) + #:use-module (guix packages) + #:use-module (guix store) #:use-module (guix utils) #:use-module (guix ui) #:use-module ((guix self) #:select (make-config.scm)) @@ -56,7 +60,9 @@ (define-module (gnu installer) #:use-module (ice-9 match) #:use-module (srfi srfi-1) #:use-module (web uri) - #:export (installer-program)) + #:export (installer-program + installer-steps + run-installer)) (define module-to-import? ;; Return true for modules that should be imported. For (gnu system …) and @@ -562,3 +568,78 @@ (define* (installer-program #:key dry-run?) (execl #$(program-file "installer-real" installer-builder #:guile guile-3.0-latest) "installer-real")))) + +(define* (installer-script #:key dry-run? + (steps (installer-steps #:dry-run? dry-run?))) + (program-file + "installer-script" + #~(begin + (use-modules (gnu installer) + (gnu installer record) + (gnu installer keymap) + (gnu installer steps) + (gnu installer dump) + (gnu installer final) + (gnu installer hostname) + (gnu installer kernel) + (gnu installer locale) + (gnu installer parted) + (gnu installer services) + (gnu installer timezone) + (gnu installer user) + (gnu installer utils) + (gnu installer newt) + ((gnu installer newt keymap) + #:select (keyboard-layout->configuration)) + (gnu services herd) + (guix i18n) + (guix build utils) + (guix utils) + ((system repl debug) + #:select (terminal-width)) + (ice-9 match) + (ice-9 textual-ports)) + (terminal-width 200) + (let* ((current-installer newt-installer) + (steps (#$steps current-installer))) + (catch #t + (lambda _ + ((installer-init current-installer)) + (parameterize ((%run-command-in-installer + (if #$dry-run? + dry-run-command + (installer-run-command current-installer))) + (%installer-configuration-file + (if #$dry-run? + "config.scm" + (%installer-configuration-file)))) + (let ((results (run-installer-steps + #:rewind-strategy 'menu + #:menu-proc + (installer-menu-page current-installer) + #:steps steps + #:dry-run? #$dry-run?))) + (result-step results 'final) + ((installer-exit current-installer))))) + (const #f) + (lambda (key . args) + (sleep 10) + ((installer-exit current-installer)) + (display-backtrace (make-stack #t) (current-error-port)) + (apply throw key args))))))) + +(define* (run-installer #:key dry-run?) + "To run the installer from Guile without building it: + ./pre-inst-env guile -c '((@ (gnu installer) run-installer) #:dry-run? #t)' +when using #:dry-run? #t, no root access is required and the LOCALE, KEYMAP, +and PARTITION pages are skipped." + (let* ((script (installer-script #:dry-run? dry-run?)) + (store (open-connection)) + (drv (run-with-store store + (lower-object script))) + (program (match (derivation->output-paths drv) + ((("out" . program)) program))) + (outputs (build-derivations store (list drv)))) + (close-connection store) + (format #t "running installer: ~a\n" program) + (invoke "./pre-inst-env" "guile" program))) -- Janneke Nieuwenhuizen | GNU LilyPond https://LilyPond.org Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 11 01:37:28 2024 Received: (at 73927-done) by debbugs.gnu.org; 11 Nov 2024 06:37:28 +0000 Received: from localhost ([127.0.0.1]:57864 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tAO3D-00077t-UE for submit@debbugs.gnu.org; Mon, 11 Nov 2024 01:37:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44742) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tAO3B-00077d-WE for 73927-done@debbugs.gnu.org; Mon, 11 Nov 2024 01:37:27 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tAO36-0000Bw-19; Mon, 11 Nov 2024 01:37:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=vzUwOwo01QD8+eQcoWcdUpdEGvj0vVugp3Bc9GRbIDk=; b=iO0sv0+oIfnkj+ObXAnP jKbwPy7+2DA2qms/Xw3m2uo2doujf2ySiyO3bRRrQ5TVcEGgm/KVjX3pD46+PSzlHZwzeiyln7jlJ t2TfUj2McBw6dj7QoVVs69Z6rG5aYon4Xawo+reENYyy0ewxCsms1w8Qt4RreQz6WZbEjLa4Yo1JY QaNE3CfHmUXt0uDrZfahTpb+THd3MmZO0zH+1DP8NyvVLAe05D/JXAzLzsggkhUlL0PzNwtCH41/F zXAzHclcwBAg/KJpEpclfz20j2QSMo4PRSJ5nS6hs5HU+afidgQ66Tb/DUimr952DxKVWcLCoAjg2 u0rnxbzJ7Q12Bw==; From: To: 73927-done@debbugs.gnu.org Subject: Re: [PATCH v4 00/18] Installer support for (cross) installing the Hurd. In-Reply-To: (Janneke Nieuwenhuizen's message of "Wed, 30 Oct 2024 15:30:29 +0100") Organization: AvatarAcademy.nl References: X-Url: http://AvatarAcademy.nl Date: Mon, 11 Nov 2024 07:37:03 +0100 Message-ID: <874j4exomo.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73927-done Cc: Josselin Poiret , Ludovic =?utf-8?Q?Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Mathieu Othacehe writes: Hello, > Janneke Nieuwenhuizen writes: >> From: "Janneke Nieuwenhuizen" >> >> New in this series: >> >> * reconfigure: Use native bootloader package for running the installer, >> * default to "msdos" partion table, >> * do not suggest/create boot partition, >> * remove "--skip-checks" from guix system init call, >> * default to part:1:device:wd0 instead of failing when no permission t= o read >> /dev (resurrecting tests/guix-system.sh), >> >> which lead to the first fresh install that actually boots without any ex= tra >> tinkering on my x60 using this >> >> ./pre-inst-env guix system image -t iso9660 --system=3Di686-linux gnu/sy= stem/install.scm >> >> installer. I've updated the hurd-team branch. > I remember resorting to a similar hack, back in 2018 when writing the > installer. Maybe we should go the extra mile and integrate that one to a > proper guix command, such as `guix system installer` that would call > `run-installer` with dry-run set to #t. WDYT? Yes, I still think this is a nice idea. Better to open a new bug for that when someone wants to write a patch? Pushed to master as 035e5f0c743d80be3d4029f9daba90cb8b657782. Thanks! Janneke --=20 Janneke Nieuwenhuizen | GNU LilyPond https://LilyPond.org Freelance IT https://www.JoyOfSource.com | Avatar=C2=AE https://AvatarAcade= my.com From unknown Sat Aug 16 00:09:41 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 09 Dec 2024 12:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator