From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id uPMxIh2aRGdPHAEAe85BDQ:P1 (envelope-from ) for ; Mon, 25 Nov 2024 15:39:09 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id uPMxIh2aRGdPHAEAe85BDQ (envelope-from ) for ; Mon, 25 Nov 2024 16:39:09 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=AZcWIQfL; dkim=fail ("body hash did not verify") header.d=gnu.org header.s=fencepost-gnu-org header.b=i4r3l98U; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1732549149; a=rsa-sha256; cv=none; b=REwajTZjNF5KpGTFnZhPMC1eKGA15MlHeA1XrujAbMzisytEtMjx63qGnNTF6SjiJ1pkb5 uU+080F4NnF+laPgp5mynub/+k2fgTSjIdmXQrUBqFlDdiS87c9IJt6rU75wvWeQ3L2/ox PB7+YUyqJz0kuZu40oRgW08iPrHjCwu6/98P/BvNYMm7VwThUpagvJYUOGtEqL1LctDGN2 E+bp9bXViuNrCqWi6q2CRbVtXGP1GuLcbFnrv0YxyB9xiTLFtIEtNF0wG1EJJ3BIFUfOtv ctaxQ3rjrj3Nve8KIAFhpId2rCvc3SU2s/XNoTmRSPBGZww8WhstQds3a8FH7A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=AZcWIQfL; dkim=fail ("body hash did not verify") header.d=gnu.org header.s=fencepost-gnu-org header.b=i4r3l98U; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1732549149; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:list-id:list-help:list-unsubscribe:list-subscribe: list-post:dkim-signature; bh=WDXKdvN1KharkKcM2SuozGw5ki/GWC9iFE4u6MxpP50=; b=RGXLEiHUfGwFT9k1qFw1wxKwsqQUby2UOLUz8u30PtIaSB+C7kEwBkeiR3GyJc8qpKekbc XuH1KS3PWDTy5OUqNmdDBxV3FCL95+e0EalLfdYFyQOysYytpLfu2ZdCaDX7rgECWiqG/5 Rp33mYzrnyhDRs/XNniDMSH8XZmou4awqc68Svj0AzW7iNU/ORaLiUykAFFzlaf9Gkckk5 c8F1JuRk4csw3HeOPnrzTa7AmHI/b0ZaHxKIMKVS2JX1CEpVihnQ7Oxey0uhrp2OmgclOM ve/P4bGwUmpVCLhrzbDetNRJtP0EKI/Gv6YgjaQupTCf5Ace3NSIYcPFW+Ejtw== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 17ACA8EC82 for ; Mon, 25 Nov 2024 16:39:09 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFbB2-0007s1-Bp; Mon, 25 Nov 2024 10:39:04 -0500 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 1tFbB1-0007rZ-2u for guix-patches@gnu.org; Mon, 25 Nov 2024 10:39:03 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tFbB0-00049F-JV for guix-patches@gnu.org; Mon, 25 Nov 2024 10:39:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=GhaLcmd3QMM+6dvhe1pR5+dKoggSM+wyS8/BPR4yN80=; b=AZcWIQfL5g39QWi9q68z9+Bw3J2P+KK5OkqSYP8dwxq8Ykd9RtQVGrZUXc9vUlIpMzHK0vh3bLPybxQaJki3xozDd+mxsLUYs8e3vavpwcDKs6BsDE4lpP3XVf6ES9mYTgE1K//KEtwihbOqlHMDBiNXBsmKZt27nxRQo9cxTGiiwH8nmFk19qvb1c576MT8hv+0oJM5gsPlZSC6vcbXBlQQzEE3bqPeLHfOldgXj6HuIy73Kh/ZWko0ONh/yiizReFgmIlTm1GCP1m5oHu/Mj+Tutp5mtOX5lHqSHxxjlHTJYqSh00X8H6g/Yayewg+04L98xI7REo6oGoAamwN4w==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tFbB0-0005qK-D3 for guix-patches@gnu.org; Mon, 25 Nov 2024 10:39:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74531] [PATCH] system: Add "installer" sub-command. Resent-From: Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 25 Nov 2024 15:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 74531 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74531@debbugs.gnu.org Cc: Josselin Poiret , Maxim Cournoyer , Simon Tournier , Mathieu Othacehe , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Tobias Geerinckx-Rice , Christopher Baines X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.173254912822433 (code B ref -1); Mon, 25 Nov 2024 15:39:02 +0000 Received: (at submit) by debbugs.gnu.org; 25 Nov 2024 15:38:48 +0000 Received: from localhost ([127.0.0.1]:40076 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFbAm-0005pk-4W for submit@debbugs.gnu.org; Mon, 25 Nov 2024 10:38:48 -0500 Received: from lists.gnu.org ([209.51.188.17]:51750) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFbAl-0005pc-3e for submit@debbugs.gnu.org; Mon, 25 Nov 2024 10:38:47 -0500 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 1tFbAi-0007q1-2t for guix-patches@gnu.org; Mon, 25 Nov 2024 10:38:45 -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 1tFbAg-00045o-3z; Mon, 25 Nov 2024 10:38:42 -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:Subject:To:From:in-reply-to: references; bh=GhaLcmd3QMM+6dvhe1pR5+dKoggSM+wyS8/BPR4yN80=; b=i4r3l98U8KyPFp ehkZP+pafj/oLW16jcajSQbqqHKc0qb5sfzZPXflg9Bwb61Bgs1ZQ3IBdwCcBKglaDN1w9dI+9yOK P88vCqQM+3OSvbFMlarZQdl1pBkTMdS0wr65LZUnUMCJ3rSsyzOE8GDhq7WXEc5EksEHVOWz5b2LE FeWbIsVHNmB9HMIbU7AW8Hcma4yK6nun2dDtrQAncu6khMk6trZt++G7EiErNx15FSMAnbAwhezHN 2Wv0RJOwNtd8bhHjvV/U02FqFcXIf0cUUK6uKB93vTa1jcjvwprIm7o3pVhIJrRlg13Qmda7KsnqU 6Km460UFqFtv/B7neLxg==; From: Organization: AvatarAcademy.nl X-Url: http://AvatarAcademy.nl Date: Mon, 25 Nov 2024 16:38:33 +0100 Message-ID: <87mshngw7a.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.49 X-Spam-Score: -2.49 X-Migadu-Queue-Id: 17ACA8EC82 X-Migadu-Scanner: mx10.migadu.com X-TUID: OMguOZm5rDaz --=-=-= Content-Type: text/plain As suggested by Mathieu , this patch adds the `guix system installer' subcommand. The groundwork was already there. Greetigns, Janneke --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-system-Add-installer-sub-command.patch Content-Transfer-Encoding: quoted-printable >From c852c393ba77e702c7e57412ac031bca457d8602 Mon Sep 17 00:00:00 2001 Message-ID: From: Janneke Nieuwenhuizen Date: Mon, 25 Nov 2024 16:17:33 +0100 Subject: [PATCH] system: Add "installer" sub-command. * guix/scripts/system/installer.scm: New file. * Makefile.am (MODULES)[ENABLE_INSTALLER]: Register it. (MODULES_NOT_COMPILED)[!ENABLE_INSTALLER]: Likewise. * guix/scripts/system.scm (show-help): Add help for "installer" sub-command. (actions): Register "installer". (guix-system): Invoke `guix-system-installer' sub-command. * doc/guix.texi (Invoking guix system): Document it. * gnu/installer.scm (run-installer): Remove "./pre-inst env". Change-Id: I5a05b941c060682c17d45d871df3cf34e3f8643a --- Makefile.am | 8 ++++ doc/guix.texi | 17 ++++++++ gnu/installer.scm | 2 +- guix/scripts/system.scm | 7 +++- guix/scripts/system/installer.scm | 70 +++++++++++++++++++++++++++++++ 5 files changed, 102 insertions(+), 2 deletions(-) create mode 100644 guix/scripts/system/installer.scm diff --git a/Makefile.am b/Makefile.am index e94ba87797..6812049e02 100644 --- a/Makefile.am +++ b/Makefile.am @@ -408,6 +408,14 @@ MODULES +=3D \ =20 endif BUILD_DAEMON_OFFLOAD =20 +INSTALLER_SCRIPT =3D guix/scripts/system/installer.scm + +if ENABLE_INSTALLER +MODULES +=3D $(INSTALLER_SCRIPT) +else +MODULES_NOT_COMPILED +=3D $(INSTALLER_SCRIPT) +endif !ENABLE_INSTALLER + # Scheme implementation of the build daemon and related functionality. STORE_MODULES =3D \ guix/store/database.scm \ diff --git a/doc/guix.texi b/doc/guix.texi index 26488b41c8..d35bfccd06 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -43196,6 +43196,23 @@ Invoking guix system @file{my-os-config}, unless the @option{--no-bootloader} option was passed. =20 +@item installer +Run the installer. Usually the installer is built as an @file{iso} +image, copied to a USB Stick or DVD, and booted from (@ref{USB Stick and +DVD Installation}). If your machine already runs Guix and you still +want to run the installer, e.g., for testing purposes, you can skip the +creatiing of an @file{iso} and run for instance: + +@example +guix system installer --dry-run +@end example + +@quotation Note +If you do not use @option{--dry-run} then you need to run as root. Be +very careful when running the installer as root, it can cause data loss +or render your system unbootable! +@end quotation + @item vm @cindex virtual machine @cindex VM diff --git a/gnu/installer.scm b/gnu/installer.scm index 0a36f1f67b..4acad60f21 100644 --- a/gnu/installer.scm +++ b/gnu/installer.scm @@ -642,4 +642,4 @@ (define* (run-installer #:key dry-run?) (outputs (build-derivations store (list drv)))) (close-connection store) (format #t "running installer: ~a\n" program) - (invoke "./pre-inst-env" "guile" program))) + (invoke "guile" program))) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 7989b183ad..dd34f6cd15 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -56,6 +56,7 @@ (define-module (guix scripts system) delete-matching-generations list-installed) #:autoload (guix scripts pull) (channel-commit-hyperlink) + #:autoload (guix scripts system installer) (guix-system-installer) #:autoload (guix graph) (export-graph node-type graph-backend-name lookup-backend) #:use-module (guix scripts system reconfigure) @@ -996,6 +997,8 @@ (define (show-help) docker-image build a Docker image\n")) (display (G_ "\ init initialize a root file system to run GNU\n")) + (display (G_ "\ + installer run the graphical installer\n")) (display (G_ "\ extension-graph emit the service extension graph in Dot format\n")) (display (G_ "\ @@ -1229,7 +1232,7 @@ (define actions '("build" "container" "vm" "vm-image"= "image" "disk-image" "list-generations" "describe" "delete-generations" "roll-back" "switch-generation" "search" "edit" - "docker-image")) + "docker-image" "installer")) =20 (define (process-action action args opts) "Process ACTION, a sub-command, with the arguments are listed in ARGS. @@ -1441,6 +1444,8 @@ (define-command (guix-system . args) ;; Parse sub-command ARG and augment RESULT accordingly. (cond ((assoc-ref result 'action) (alist-cons 'argument arg result)) + ((equal? arg "installer") + (apply guix-system-installer args)) ((member arg actions) (let ((action (string->symbol arg))) (alist-cons 'action action result))) diff --git a/guix/scripts/system/installer.scm b/guix/scripts/system/instal= ler.scm new file mode 100644 index 0000000000..48baaefe42 --- /dev/null +++ b/guix/scripts/system/installer.scm @@ -0,0 +1,70 @@ +;;; 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 (guix scripts system installer) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-37) + #:use-module (gnu installer) + #:use-module (guix scripts) + #:use-module (guix ui) + #:use-module (guix utils) + #:export (guix-system-installer)) + +;;; Commentary: +;;; +;;; Implement the 'guix system installer' command, which runs the installe= r, +;;; directly as a Guix command, also in dry-run mode. +;;; +;;; Code: + +(define %options + (list (option '(#\n "dry-run") #f #f + (lambda (opt name arg result) + (alist-cons 'dry-run? #t result))) + (option '(#\h "help") #f #f + (lambda args + (show-help) + (exit 0))) + (option '(#\V "version") #f #f + (lambda args + (show-version-and-exit "guix system installer"))))) + +(define (show-help) + (display (G_ "Usage: guix system installer [OPTION]... +Run the system installler.\n")) + (display (G_ " + -n, --dry-run skip network setup, partitioning, and actual inst= all")) + (display (G_ " + -h, --help display this help and exit")) + (display (G_ " + -V, --version display version information and exit")) + (newline) + (show-bug-report-information)) + + +;;; +;;; Entry Point. +;;; +(define-command (guix-system-installer . args) + (synopsis "run the graphical installer program") + + (with-error-handling + (let* ((opts (parse-command-line args %options '((dry-run? . #f)) + #:build-options? #f)) + (dry-run? (assoc-ref opts 'dry-run?))) + (run-installer #:dry-run? dry-run?)))) base-commit: 9b1fb12978482ffb6d37c456343f05609b28b3e8 --=20 2.46.0 --=-=-=--