summaryrefslogtreecommitdiff
path: root/gnu/system
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-10-03 22:27:27 +0200
committerLudovic Courtès <ludo@gnu.org>2017-10-11 11:12:33 +0200
commit9976c76aab2fe75d7fc672034090e19bdab6879c (patch)
treeca63380f7b926c21df7f9cc4edbedc641d43d41d /gnu/system
parent1c65cca5743e9171bbd94307195f123d26c0535e (diff)
downloadpatches-9976c76aab2fe75d7fc672034090e19bdab6879c.tar
patches-9976c76aab2fe75d7fc672034090e19bdab6879c.tar.gz
file-systems: Preserve UUID types when serializing.
Reported by Roel Janssen <roel@gnu.org> at <https://lists.gnu.org/archive/html/help-guix/2017-09/msg00094.html>. * gnu/system/file-systems.scm (file-system->spec): When DEVICE is a UUID, serialize it in a way that preserves its type. (spec->file-system): Adjust accordingly. * gnu/build/file-systems.scm (canonicalize-device-spec): Add case for when SPEC is 'uuid?'.
Diffstat (limited to 'gnu/system')
-rw-r--r--gnu/system/file-systems.scm10
1 files changed, 8 insertions, 2 deletions
diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm
index 92f040425d..27734e892a 100644
--- a/gnu/system/file-systems.scm
+++ b/gnu/system/file-systems.scm
@@ -18,6 +18,7 @@
(define-module (gnu system file-systems)
#:use-module (ice-9 match)
+ #:use-module (rnrs bytevectors)
#:use-module (srfi srfi-1)
#:use-module (guix records)
#:use-module (gnu system uuid)
@@ -161,7 +162,7 @@ initrd code."
(match fs
(($ <file-system> device title mount-point type flags options _ _ check?)
(list (if (uuid? device)
- (uuid-bytevector device)
+ `(uuid ,(uuid-type device) ,(uuid-bytevector device))
device)
title mount-point type flags options check?))))
@@ -170,7 +171,12 @@ initrd code."
(match sexp
((device title mount-point type flags options check?)
(file-system
- (device device) (title title)
+ (device (match device
+ (('uuid (? symbol? type) (? bytevector? bv))
+ (bytevector->uuid bv type))
+ (_
+ device)))
+ (title title)
(mount-point mount-point) (type type)
(flags flags) (options options)
(check? check?)))))