mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 05:18:07 -05:00
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 <https://lists.gnu.org/archive/html/help-guix/2017-11/msg00084.html>. * gnu/services/base.scm (file-system-fstab-entries): New procedure. (file-system-service-type): Use it to extend FSTAB-SERVICE-TYPE.
This commit is contained in:
parent
cdb57a831c
commit
74685a4369
1 changed files with 18 additions and 1 deletions
|
@ -510,13 +510,30 @@ (define (known? mount-point)
|
|||
(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
|
||||
@file{/etc/fstab}."
|
||||
;; /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)
|
||||
(extensions
|
||||
(list (service-extension shepherd-root-service-type
|
||||
file-system-shepherd-services)
|
||||
(service-extension fstab-service-type
|
||||
identity)
|
||||
file-system-fstab-entries)
|
||||
|
||||
;; Have 'user-processes' depend on 'file-systems'.
|
||||
(service-extension user-processes-service-type
|
||||
|
|
Loading…
Reference in a new issue