diff mbox series

[bug#44169,3/3] installer: Use UUIDs in the 'swap-devices' field.

Message ID 20201023100754.20924-3-ludo@gnu.org
State Accepted
Headers show
Series Referring to swap with UUIDs and labels | expand

Checks

Context Check Description
cbaines/issue success View issue
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job

Commit Message

Ludovic Courtès Oct. 23, 2020, 10:07 a.m. UTC
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/parted.scm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Mathieu Othacehe Oct. 23, 2020, 11:50 a.m. UTC | #1
> +              `((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?

Thanks,

Mathieu
diff mbox series

Patch

diff --git a/gnu/installer/parted.scm b/gnu/installer/parted.scm
index fffd5abf3b..d799ee0e73 100644
--- a/gnu/installer/parted.scm
+++ b/gnu/installer/parted.scm
@@ -1327,7 +1327,12 @@  USER-PARTITIONS, or return nothing."
       ,@(initrd-configuration user-partitions)
       ,@(if (null? swap-devices)
             '()
-            `((swap-devices (list ,@swap-devices))))
+            (let* ((uuids (map (lambda (file)
+                                 (uuid->string (read-partition-uuid file)))
+                               swap-devices)))
+              `((swap-devices (list ,@(map (lambda (uuid)
+                                             `(uuid ,uuid))
+                                           uuids))))))
       ,@(if (null? encrypted-partitions)
             '()
             `((mapped-devices