summaryrefslogtreecommitdiff
path: root/gnu/system/file-systems.scm
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2020-03-04 12:04:42 +0100
committerMarius Bakke <mbakke@fastmail.com>2020-03-04 12:04:42 +0100
commite32aea5472007507e62933b27a4db9a50810e5dc (patch)
tree55ccbe4ed5baf1fd2689b16d7108da8f7be857a9 /gnu/system/file-systems.scm
parentfb98351621a6b311d4ff9593d6c22d40a3b3fe8f (diff)
parentd46f9f833b190aac04f7f4683b84a06a291a3f8f (diff)
downloadpatches-e32aea5472007507e62933b27a4db9a50810e5dc.tar
patches-e32aea5472007507e62933b27a4db9a50810e5dc.tar.gz
Merge branch 'master' into staging
Diffstat (limited to 'gnu/system/file-systems.scm')
-rw-r--r--gnu/system/file-systems.scm15
1 files changed, 15 insertions, 0 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."