summaryrefslogtreecommitdiff
path: root/gnu/installer
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2020-10-23 11:31:56 +0200
committerLudovic Courtès <ludo@gnu.org>2020-10-30 01:14:21 +0100
commit1c6d98533153bc8e0e36236e7fbcf1eb5e178d26 (patch)
treefbf06a3262fa92122aedeec1bdba902cfb1f41a6 /gnu/installer
parent81c3dd9cad29f2b0999aa1f22b3a7d4c04f1a842 (diff)
installer: Use UUIDs in the 'swap-devices' field.
Note: This change requires an updated 'guix' package that contains Linux-swap support in (gnu build file-systems). * gnu/installer/parted.scm (user-partitions->configuration): Use UUIDs in the 'swap-devices' field. * gnu/installer/newt/final.scm (run-final-page)[wait-for-clients]: New procedure. Use it. * gnu/installer/tests.scm (choose-partitioning): Wait for 'starting-final-step' message and move configuration file dialog handling to... (conclude-installation): ... here. Send over PORT the reply corresponding to 'starting-final-step'. * gnu/tests/install.scm (gui-test-program): When ENCRYPTED? is false, invoke 'swaplabel' in the marionette. (installation-target-os-for-gui-tests): When ENCRYPTED? is false, except a fixed UUID.
Diffstat (limited to 'gnu/installer')
-rw-r--r--gnu/installer/newt/final.scm14
-rw-r--r--gnu/installer/parted.scm7
-rw-r--r--gnu/installer/tests.scm31
3 files changed, 43 insertions, 9 deletions
diff --git a/gnu/installer/newt/final.scm b/gnu/installer/newt/final.scm
index 89684c4d8ad..5019a67429d 100644
--- a/gnu/installer/newt/final.scm
+++ b/gnu/installer/newt/final.scm
@@ -29,6 +29,7 @@
29 #:use-module (srfi srfi-34) 29 #:use-module (srfi srfi-34)
30 #:use-module (srfi srfi-35) 30 #:use-module (srfi srfi-35)
31 #:use-module (ice-9 match) 31 #:use-module (ice-9 match)
32 #:use-module ((ice-9 rdelim) #:select (read-line))
32 #:use-module (newt) 33 #:use-module (newt)
33 #:export (run-final-page)) 34 #:export (run-final-page))
34 35
@@ -107,6 +108,19 @@ a specific step, or restart the installer."))
107 install-ok?)) 108 install-ok?))
108 109
109(define (run-final-page result prev-steps) 110(define (run-final-page result prev-steps)
111 (define (wait-for-clients)
112 (unless (null? (current-clients))
113 (syslog "waiting with clients before starting final step~%")
114 (send-to-clients '(starting-final-step))
115 (match (select (current-clients) '() '())
116 (((port _ ...) _ _)
117 (read-line port)))))
118
119 ;; Before generating the configuration file, give clients a chance to do
120 ;; things such as changing the swap partition label.
121 (wait-for-clients)
122
123 (syslog "proceeding with final step~%")
110 (let* ((configuration (format-configuration prev-steps result)) 124 (let* ((configuration (format-configuration prev-steps result))
111 (user-partitions (result-step result 'partition)) 125 (user-partitions (result-step result 'partition))
112 (locale (result-step result 'locale)) 126 (locale (result-step result 'locale))
diff --git a/gnu/installer/parted.scm b/gnu/installer/parted.scm
index fffd5abf3b0..d799ee0e735 100644
--- a/gnu/installer/parted.scm
+++ b/gnu/installer/parted.scm
@@ -1327,7 +1327,12 @@ USER-PARTITIONS, or return nothing."
1327 ,@(initrd-configuration user-partitions) 1327 ,@(initrd-configuration user-partitions)
1328 ,@(if (null? swap-devices) 1328 ,@(if (null? swap-devices)
1329 '() 1329 '()
1330 `((swap-devices (list ,@swap-devices)))) 1330 (let* ((uuids (map (lambda (file)
1331 (uuid->string (read-partition-uuid file)))
1332 swap-devices)))
1333 `((swap-devices (list ,@(map (lambda (uuid)
1334 `(uuid ,uuid))
1335 uuids))))))
1331 ,@(if (null? encrypted-partitions) 1336 ,@(if (null? encrypted-partitions)
1332 '() 1337 '()
1333 `((mapped-devices 1338 `((mapped-devices
diff --git a/gnu/installer/tests.scm b/gnu/installer/tests.scm
index 58bf0a2700f..f318546a2fd 100644
--- a/gnu/installer/tests.scm
+++ b/gnu/installer/tests.scm
@@ -286,8 +286,9 @@ instrumented for further testing."
286 edit-configuration-file)) 286 edit-configuration-file))
287 "Converse over PORT to choose the partitioning method. When ENCRYPTED? is 287 "Converse over PORT to choose the partitioning method. When ENCRYPTED? is
288true, choose full-disk encryption with PASSPHRASE as the LUKS passphrase. 288true, choose full-disk encryption with PASSPHRASE as the LUKS passphrase.
289This conversation goes past the final dialog box that shows the configuration 289This conversation stops when the user partitions have been formatted, right
290file, actually starting the installation process." 290before the installer generates the configuration file and shows it in a dialog
291box."
291 (converse port 292 (converse port
292 ((list-selection (title "Partitioning method") 293 ((list-selection (title "Partitioning method")
293 (multiple-choices? #f) 294 (multiple-choices? #f)
@@ -330,15 +331,29 @@ file, actually starting the installation process."
330 #t) 331 #t)
331 ((info (title "Preparing partitions") _ ...) 332 ((info (title "Preparing partitions") _ ...)
332 (values)) ;nothing to return 333 (values)) ;nothing to return
333 ((file-dialog (title "Configuration file") 334 ((starting-final-step)
334 (text _) 335 ;; Do not return anything. The reply will be sent by
335 (file ,configuration-file)) 336 ;; 'conclude-installation' and in the meantime the installer just waits
336 (edit-configuration-file configuration-file)))) 337 ;; for us, giving us a chance to do things such as changing partition
338 ;; UUIDs before it generates the configuration file.
339 (values))))
337 340
338(define (conclude-installation port) 341(define (conclude-installation port)
339 "Conclude the installation by checking over PORT that we get the final 342 "Conclude the installation by checking over PORT that we get the generated
340messages once the 'guix system init' process has completed." 343configuration file, accepting it and starting the installation, and then
344receiving the final messages once the 'guix system init' process has
345completed."
346 ;; Assume the previous message received was 'starting-final-step'; here we
347 ;; send the reply to that message, which lets the installer continue.
348 (write #t port)
349 (newline port)
350 (force-output port)
351
341 (converse port 352 (converse port
353 ((file-dialog (title "Configuration file")
354 (text _)
355 (file ,configuration-file))
356 (edit-configuration-file configuration-file))
342 ((pause) ;"Press Enter to continue." 357 ((pause) ;"Press Enter to continue."
343 #t) 358 #t)
344 ((installation-complete) ;congratulations! 359 ((installation-complete) ;congratulations!