summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--gnu/system.scm11
-rw-r--r--gnu/system/file-systems.scm8
2 files changed, 9 insertions, 10 deletions
diff --git a/gnu/system.scm b/gnu/system.scm
index f98aa83f62..5c915d3969 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -204,9 +204,7 @@ file."
   "Return file system services for the file systems of OS that are not marked
 as 'needed-for-boot'."
   (define file-systems
-    (remove (lambda (fs)
-              (or (file-system-needed-for-boot? fs)
-                  (string=? "/" (file-system-mount-point fs))))
+    (remove file-system-needed-for-boot?
             (operating-system-file-systems os)))
 
   (define (device-mappings fs)
@@ -638,12 +636,7 @@ we're running in the final root."
 (define (operating-system-initrd-file os)
   "Return a gexp denoting the initrd file of OS."
   (define boot-file-systems
-    (filter (match-lambda
-             (($ <file-system> device title "/")
-              #t)
-             (($ <file-system> device title mount-point type flags
-                               options boot?)
-              boot?))
+    (filter file-system-needed-for-boot?
             (operating-system-file-systems os)))
 
   (define mapped-devices
diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm
index ed9d70587f..4760821840 100644
--- a/gnu/system/file-systems.scm
+++ b/gnu/system/file-systems.scm
@@ -70,13 +70,19 @@
                     (default '()))
   (options          file-system-options           ; string or #f
                     (default #f))
-  (needed-for-boot? file-system-needed-for-boot?  ; Boolean
+  (needed-for-boot? %file-system-needed-for-boot? ; Boolean
                     (default #f))
   (check?           file-system-check?            ; Boolean
                     (default #t))
   (create-mount-point? file-system-create-mount-point? ; Boolean
                        (default #f)))
 
+(define-inlinable (file-system-needed-for-boot? fs)
+  "Return true if FS has the 'needed-for-boot?' flag set, or if it's the root
+file system."
+  (or (%file-system-needed-for-boot? fs)
+      (string=? "/" (file-system-mount-point fs))))
+
 (define %fuse-control-file-system
   ;; Control file system for Linux' file systems in user-space (FUSE).
   (file-system