summaryrefslogtreecommitdiff
path: root/gnu/system
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2020-03-04 23:16:17 +0100
committerMarius Bakke <mbakke@fastmail.com>2020-03-04 23:16:17 +0100
commitebb7cf9e21060105d9950dd5142c0eb918083666 (patch)
tree36c1607b80d92e27fb9d09029d1d3b57a1fd5065 /gnu/system
parent0b870f7915f5da43758753fd088a22033936dc50 (diff)
parentc2d7e800e6788277bc56f31d5836f9d507dc1506 (diff)
downloadpatches-ebb7cf9e21060105d9950dd5142c0eb918083666.tar
patches-ebb7cf9e21060105d9950dd5142c0eb918083666.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'gnu/system')
-rw-r--r--gnu/system/file-systems.scm15
-rw-r--r--gnu/system/vm.scm8
2 files changed, 16 insertions, 7 deletions
diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm
index d47a514b66..3b599efa8e 100644
--- a/gnu/system/file-systems.scm
+++ b/gnu/system/file-systems.scm
@@ -30,6 +30,7 @@
#:export (file-system
file-system?
file-system-device
+ file-system-device->string
file-system-title ;deprecated
file-system-mount-point
file-system-type
@@ -235,6 +236,20 @@ where both FILE1 and FILE2 are absolute file name. For example:
(()
#f)))))))
+(define* (file-system-device->string device #:key uuid-type)
+ "Return the string representations of the DEVICE field of a <file-system>
+record. When the device is a UUID, its representation is chosen depending on
+UUID-TYPE, a symbol such as 'dce or 'iso9660."
+ (match device
+ ((? file-system-label?)
+ (file-system-label->string device))
+ ((? uuid?)
+ (if uuid-type
+ (uuid->string (uuid-bytevector device) uuid-type)
+ (uuid->string device)))
+ ((? string?)
+ device)))
+
(define (file-system-needed-for-boot? fs)
"Return true if FS has the 'needed-for-boot?' flag set, or if it holds the
store--e.g., if FS is the root file system."
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index 81b2e06ba2..03a511cdde 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -609,13 +609,7 @@ TYPE (one of 'iso9660 or 'dce). Return a UUID object."
(let ((device (file-system-device fs)))
(list (file-system-mount-point fs)
(file-system-type fs)
- (cond ((file-system-label? device)
- (file-system-label->string device))
- ((uuid? device)
- (uuid->string device))
- ((string? device)
- device)
- (else #f))
+ (file-system-device->string device)
(file-system-options fs))))
(if (eq? type 'iso9660)