From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id UOtAEOCpll+uEgAA0tVLHw (envelope-from ) for ; Mon, 26 Oct 2020 10:50:08 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id EMMbDOCpll8rLwAA1q6Kng (envelope-from ) for ; Mon, 26 Oct 2020 10:50:08 +0000 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 7646A94036A for ; Mon, 26 Oct 2020 10:50:07 +0000 (UTC) Received: from localhost ([::1]:50478 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kX04k-0000KR-ED for larch@yhetil.org; Mon, 26 Oct 2020 06:50:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42142) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kWzai-00024C-LZ for guix-patches@gnu.org; Mon, 26 Oct 2020 06:19:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:55208) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kWzag-0002ZU-Km for guix-patches@gnu.org; Mon, 26 Oct 2020 06:19:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kWzag-0003bU-Eo for guix-patches@gnu.org; Mon, 26 Oct 2020 06:19:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#44169] [PATCH 3/3] installer: Use UUIDs in the 'swap-devices' field. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 26 Oct 2020 10:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44169 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Mathieu Othacehe Cc: 44169@debbugs.gnu.org Received: via spool by 44169-submit@debbugs.gnu.org id=B44169.160370750113802 (code B ref 44169); Mon, 26 Oct 2020 10:19:02 +0000 Received: (at 44169) by debbugs.gnu.org; 26 Oct 2020 10:18:21 +0000 Received: from localhost ([127.0.0.1]:38521 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kWza1-0003aY-0t for submit@debbugs.gnu.org; Mon, 26 Oct 2020 06:18:21 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41816) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kWzZy-0003aK-Ph for 44169@debbugs.gnu.org; Mon, 26 Oct 2020 06:18:19 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51673) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kWzZt-0002KB-GT for 44169@debbugs.gnu.org; Mon, 26 Oct 2020 06:18:13 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=60738 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kWzZp-0002Az-Kq; Mon, 26 Oct 2020 06:18:13 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20201023100754.20924-1-ludo@gnu.org> <20201023100754.20924-3-ludo@gnu.org> <87imb1i2kf.fsf@gnu.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 4 Brumaire an 229 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 26 Oct 2020 11:18:07 +0100 In-Reply-To: <87imb1i2kf.fsf@gnu.org> (Mathieu Othacehe's message of "Fri, 23 Oct 2020 13:50:24 +0200") Message-ID: <871rhle1eo.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -3.3 (---) 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" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: -1.51 X-TUID: sRCo0df8Gosz --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi! Mathieu Othacehe skribis: >> + `((swap-devices (list ,@(map (lambda (uuid) >> + `(uuid ,uuid)) >> + uuids)))))) > > I fear that this will break the "gui-installed-os" test. The > "installation-target-os-for-gui-tests" procedure declares "/dev/vda2" as > swap-device, while the installer will declare it using an UUID. > > This mismatch will probably make "shepherd services" test unhappy. We > could maybe set a swap label during installation and use it in the > installer tests? Good point, I had overlooked that. I came up with the following trick: during installation, once user partitions are formatted, we set a pre-defined UUID on /dev/vda2, and we use that label in =E2=80=98installation-target-os-for-gui-tests=E2=80=99. It works, but I think it=E2=80=99s racy: the config file could be generated before we=E2=80=99ve changed the UUID. Problem is that since formatting is the last step that occurs before config file generation, there=E2=80=99s no synchronization point where the installer could wait for the client (i.e., wait until the client has run =E2=80=98swaplabel=E2=80=99.) Ideas? Thanks, Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/gnu/installer/newt/partition.scm b/gnu/installer/newt/partition.scm index ed38287fe8..1854b35656 100644 --- a/gnu/installer/newt/partition.scm +++ b/gnu/installer/newt/partition.scm @@ -777,5 +777,9 @@ by pressing the Exit button.~%~%"))) ;; Make sure the disks are not in use before proceeding to formatting. (free-parted non-install-devices) (format-user-partitions user-partitions-with-pass) + (syslog "user partitions formatted~%") + + ;; Let clients know that the partitions are ready. + (send-to-clients '(partitions-formatted)) (destroy-form-and-pop form) user-partitions)) diff --git a/gnu/installer/tests.scm b/gnu/installer/tests.scm index 58bf0a2700..5962391e61 100644 --- a/gnu/installer/tests.scm +++ b/gnu/installer/tests.scm @@ -286,8 +286,8 @@ instrumented for further testing." edit-configuration-file)) "Converse over PORT to choose the partitioning method. When ENCRYPTED? is true, choose full-disk encryption with PASSPHRASE as the LUKS passphrase. -This conversation goes past the final dialog box that shows the configuration -file, actually starting the installation process." +This conversation stops when the user partitions have been formatted, right +before the final dialog box that shows the configuration file." (converse port ((list-selection (title "Partitioning method") (multiple-choices? #f) @@ -330,15 +330,19 @@ file, actually starting the installation process." #t) ((info (title "Preparing partitions") _ ...) (values)) ;nothing to return + ((partitions-formatted) + (values)))) + +(define (conclude-installation port) + "Conclude the installation by checking over PORT that we get the generated +configuration file, accepting it and starting the installation, and then +receiving the final messages once the 'guix system init' process has +completed." + (converse port ((file-dialog (title "Configuration file") (text _) (file ,configuration-file)) - (edit-configuration-file configuration-file)))) - -(define (conclude-installation port) - "Conclude the installation by checking over PORT that we get the final -messages once the 'guix system init' process has completed." - (converse port + (edit-configuration-file configuration-file)) ((pause) ;"Press Enter to continue." #t) ((installation-complete) ;congratulations! diff --git a/gnu/tests/install.scm b/gnu/tests/install.scm index 86bd93966b..0dc5f6ad94 100644 --- a/gnu/tests/install.scm +++ b/gnu/tests/install.scm @@ -1211,6 +1211,14 @@ build (current-guix) and then store a couple of full system images.") #$marionette) (screenshot "installer-run.ppm") + (unless #$encrypted? + ;; Choose a fixed UUID for the swap partition that matches what + ;; 'installation-target-os-for-gui-tests' expects. + (marionette-eval* '(invoke #$(file-append util-linux "/sbin/swaplabel") + "-U" "11111111-2222-3333-4444-123456789abc" + "/dev/vda2") + #$marionette)) + (marionette-eval* '(conclude-installation installer-socket) #$marionette) @@ -1257,8 +1265,12 @@ build (current-guix) and then store a couple of full system images.") '("wheel" "audio" "video")))) %base-user-accounts)) ;; The installer does not create a swap device in guided mode with - ;; encryption support. - (swap-devices (if encrypted? '() '("/dev/vda2"))) + ;; encryption support. The installer produces a UUID for the partition; + ;; this "UUID" is explicitly set in 'gui-test-program' to the value shown + ;; below. + (swap-devices (if encrypted? + '() + (list (uuid "11111111-2222-3333-4444-123456789abc")))) (services (cons (service dhcp-client-service-type) (operating-system-user-services %minimal-os-on-vda))))) --=-=-=--