summary refs log tree commit diff
path: root/gnu/system.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-11-29 14:40:26 +0100
committerLudovic Courtès <ludo@gnu.org>2014-11-29 14:40:26 +0100
commit3b09332adf7ce8e976a4d117a62c586a53af04aa (patch)
tree0400980787f83e8eb2b9a379af9b9f59347504a1 /gnu/system.scm
parent9cd0dfaa4654e49cd0af82993b91789cb3012354 (diff)
downloadguix-3b09332adf7ce8e976a4d117a62c586a53af04aa.tar.gz
system: Add a 'needed-for-boot?' field to 'mapped-device'.
* gnu/system/file-systems.scm (<mapped-device>)[needed-for-boot?]: New
  field.
* gnu/system.scm (operating-system-user-mapped-devices,
  operating-system-boot-mapped-devices): Use it instead of trying to
  guess.  Guessing doesn't work when one refers to a partition using its
  label, for instance.
* doc/guix.texi (Mapped Devices): Document 'needed-for-boot?'.
Diffstat (limited to 'gnu/system.scm')
-rw-r--r--gnu/system.scm17
1 files changed, 4 insertions, 13 deletions
diff --git a/gnu/system.scm b/gnu/system.scm
index e1ed1a2f19..731f9de55f 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -250,23 +250,14 @@ as 'needed-for-boot'."
 (define (operating-system-user-mapped-devices os)
   "Return the subset of mapped devices that can be installed in
 user-land--i.e., those not needed during boot."
-  (let ((devices      (operating-system-mapped-devices os))
-        (file-systems (operating-system-file-systems os)))
-   (filter (lambda (md)
-             (let ((user (mapped-device-user md file-systems)))
-               (or (not user)
-                   (not (file-system-needed-for-boot? user)))))
-           devices)))
+  (remove mapped-device-needed-for-boot?
+          (operating-system-mapped-devices os)))
 
 (define (operating-system-boot-mapped-devices os)
   "Return the subset of mapped devices that must be installed during boot,
 from the initrd."
-  (let ((devices      (operating-system-mapped-devices os))
-        (file-systems (operating-system-file-systems os)))
-   (filter (lambda (md)
-             (let ((user (mapped-device-user md file-systems)))
-               (and user (file-system-needed-for-boot? user))))
-           devices)))
+  (filter mapped-device-needed-for-boot?
+          (operating-system-mapped-devices os)))
 
 (define (device-mapping-services os)
   "Return the list of device-mapping services for OS as a monadic list."