summaryrefslogtreecommitdiff
path: root/guix/scripts/system.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-05-18 13:43:07 +0200
committerLudovic Courtès <ludo@gnu.org>2018-05-28 13:24:11 +0200
commita5acc17a3c10a3779b5b8b1a2565ef130be77e51 (patch)
tree988afc136bcdb5848543167375118283a958fb38 /guix/scripts/system.scm
parent25816c4306ff7d4cec21a3f0e7ce917aea75385f (diff)
downloadpatches-a5acc17a3c10a3779b5b8b1a2565ef130be77e51.tar
patches-a5acc17a3c10a3779b5b8b1a2565ef130be77e51.tar.gz
file-systems: Remove 'title' field and add <file-system-label>.
The 'title' field was easily overlooked and was an endless source of confusion. Now, the value of the 'device' field is self-contained. * gnu/system/file-systems.scm (<file-system>): Change constructor name to '%file-system'. [title]: Remove. (<file-system-label>): New record type with printer. (report-deprecation, device-expression) (process-file-system-declaration, file-system): New macros. (file-system-title): New procedure. (file-system->spec, spec->file-system): Adjust to handle <file-system-label>. * gnu/system.scm (bootable-kernel-arguments): Add case for 'file-system-label?'. (read-boot-parameters): Likewise. (mapped-device-user): Avoid 'file-system-title'. (fs->boot-device): Remove. (operating-system-boot-parameters): Use 'file-system-device' instead of 'fs->boot-device'. (device->sexp): Add case for 'file-system-label?'. * gnu/bootloader/grub.scm (grub-root-search): Add case for 'file-system-label?'. * gnu/system/examples/bare-bones.tmpl, gnu/system/examples/beaglebone-black.tmpl, gnu/system/examples/lightweight-desktop.tmpl, gnu/system/examples/vm-image.tmpl: Remove uses of 'title'. * gnu/system/vm.scm (virtualized-operating-system): Remove uses of 'file-system-title'. * guix/scripts/system.scm (check-file-system-availability): Likewise, and adjust fix-it hint. (check-initrd-modules)[file-system-/dev]: Likewise. * gnu/build/file-systems.scm (canonicalize-device-spec): Remove 'title' parameter. [canonical-title]: Remove. Match on SPEC's type rather than on CANONICAL-TITLE. (mount-file-system): Adjust caller. * gnu/build/linux-boot.scm (boot-system): Interpret ROOT here. * gnu/services/base.scm (file-system->fstab-entry): Remove use of 'file-system-title'. * doc/guix.texi (File Systems): Remove documentation of the 'title' field. Rewrite documentation of 'device' and document 'file-system-label'.
Diffstat (limited to 'guix/scripts/system.scm')
-rw-r--r--guix/scripts/system.scm31
1 files changed, 17 insertions, 14 deletions
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index af501eb8f7..5d0df14924 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -590,17 +590,17 @@ any, are available. Raise an error if they're not."
(define labeled
(filter (lambda (fs)
- (eq? (file-system-title fs) 'label))
+ (file-system-label? (file-system-device fs)))
relevant))
(define literal
(filter (lambda (fs)
- (eq? (file-system-title fs) 'device))
+ (string? (file-system-device fs)))
relevant))
(define uuid
(filter (lambda (fs)
- (eq? (file-system-title fs) 'uuid))
+ (uuid? (file-system-device fs)))
relevant))
(define fail? #f)
@@ -628,15 +628,15 @@ any, are available. Raise an error if they're not."
(strerror errno))
(unless (string-prefix? "/" device)
(display-hint (format #f (G_ "If '~a' is a file system
-label, you need to add @code{(title 'label)} to your @code{file-system}
-definition.")
- device)))))))
+label, write @code{(file-system-label ~s)} in your @code{device} field.")
+ device device)))))))
literal)
(for-each (lambda (fs)
- (unless (find-partition-by-label (file-system-device fs))
- (error (G_ "~a: error: file system with label '~a' not found~%")
- (file-system-location* fs)
- (file-system-device fs))))
+ (let ((label (file-system-label->string
+ (file-system-device fs))))
+ (unless (find-partition-by-label label)
+ (error (G_ "~a: error: file system with label '~a' not found~%")
+ (file-system-location* fs) label))))
labeled)
(for-each (lambda (fs)
(unless (find-partition-by-uuid (file-system-device fs))
@@ -677,10 +677,13 @@ available in the initrd. Note that mapped devices are responsible for
checking this by themselves in their 'check' procedure."
(define (file-system-/dev fs)
(let ((device (file-system-device fs)))
- (match (file-system-title fs)
- ('device device)
- ('uuid (find-partition-by-uuid device))
- ('label (find-partition-by-label device)))))
+ (match device
+ ((? string?)
+ device)
+ ((? uuid?)
+ (find-partition-by-uuid device))
+ ((? file-system-label?)
+ (find-partition-by-label (file-system-label->string device))))))
(define file-systems
(filter file-system-needed-for-boot?