[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/03: services: file-system: Filter what goes to /etc/fstab.

From: guix-commits
Subject: 01/03: services: file-system: Filter what goes to /etc/fstab.
Date: Fri, 26 Apr 2019 18:51:45 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 74685a4369033e79a776c5dec1c8480e8b446f6b
Author: Ludovic Court├Ęs <address@hidden>
Date:   Fri Apr 26 23:46:20 2019 +0200

    services: file-system: Filter what goes to /etc/fstab.
    Fixes a longstanding issue whereby, due to our long fstab that included
    pseudo file systems like cgroup mounts, graphical file managers would
    display all of these.  Initially reported at
    * gnu/services/base.scm (file-system-fstab-entries): New procedure.
    (file-system-service-type): Use it to extend FSTAB-SERVICE-TYPE.
 gnu/services/base.scm | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 65f7ff2..952f6f9 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -510,13 +510,30 @@ FILE-SYSTEM."
     (cons* sink user-unmount
            (map file-system-shepherd-service file-systems))))
+(define (file-system-fstab-entries file-systems)
+  "Return the subset of @var{file-systems} that should have an entry in
+  ;; /etc/fstab is about telling fsck(8), mount(8), and umount(8) about
+  ;; relevant file systems they'll have to deal with.  That excludes "pseudo"
+  ;; file systems.
+  ;;
+  ;; In particular, things like GIO (part of GLib) use it to determine the set
+  ;; of mounts, which is then used by graphical file managers and desktop
+  ;; environments to display "volume" icons.  Thus, we really need to exclude
+  ;; those pseudo file systems from the list.
+  (remove (lambda (file-system)
+            (or (member (file-system-type file-system)
+                        %pseudo-file-system-types)
+                (memq 'bind-mount (file-system-flags file-system))))
+          file-systems))
 (define file-system-service-type
   (service-type (name 'file-systems)
                  (list (service-extension shepherd-root-service-type
                        (service-extension fstab-service-type
-                                          identity)
+                                          file-system-fstab-entries)
                        ;; Have 'user-processes' depend on 'file-systems'.
                        (service-extension user-processes-service-type

reply via email to

[Prev in Thread] Current Thread [Next in Thread]