[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
214/377: services: base: Honor file-system-create-mount-point? at all ti
From: |
guix-commits |
Subject: |
214/377: services: base: Honor file-system-create-mount-point? at all times. |
Date: |
Thu, 2 Sep 2021 17:55:35 -0400 (EDT) |
raghavgururajan pushed a commit to branch wip-gnome
in repository guix.
commit 8ad6624b96b31c2eeaf9a17309da2d2c6fdcf1d9
Author: Maxim Cournoyer <maxim.cournoyer@gmail.com>
AuthorDate: Thu Aug 5 14:16:50 2021 -0400
services: base: Honor file-system-create-mount-point? at all times.
Fixes <https://issues.guix.gnu.org/40158>.
* gnu/services/base.scm (file-system-shepherd-service): Update doc. Return
a
shepherd service for the mount point when either MOUNT? or CREATE? is true.
[start]: Only mount when MOUNT? is true.
(file-system-shepherd-services): Also consider file systems with
create-mount-point? set to #t.
---
gnu/services/base.scm | 53 ++++++++++++++++++++++++++++++---------------------
1 file changed, 31 insertions(+), 22 deletions(-)
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index c784d31..5086505 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -15,6 +15,7 @@
;;; Copyright © 2020, 2021 Brice Waegeneire <brice@waegenei.re>
;;; Copyright © 2021 qblade <qblade@protonmail.com>
;;; Copyright © 2021 Hui Lu <luhuins@163.com>
+;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -311,17 +312,20 @@ FILE-SYSTEM."
(define (file-system-shepherd-service file-system)
"Return the shepherd service for @var{file-system}, or @code{#f} if
-@var{file-system} is not auto-mounted upon boot."
+@var{file-system} is not auto-mounted or doesn't have its mount point created
+upon boot."
(let ((target (file-system-mount-point file-system))
(create? (file-system-create-mount-point? file-system))
+ (mount? (file-system-mount? file-system))
(dependencies (file-system-dependencies file-system))
(packages (file-system-packages (list file-system))))
- (and (file-system-mount? file-system)
+ (and (or mount? create?)
(with-imported-modules (source-module-closure
'((gnu build file-systems)))
(shepherd-service
(provision (list (file-system->shepherd-service-name file-system)))
- (requirement `(root-file-system udev
+ (requirement `(root-file-system
+ udev
,@(map dependency->shepherd-service-name
dependencies)))
(documentation "Check, mount, and unmount the given file system.")
(start #~(lambda args
@@ -329,24 +333,26 @@ FILE-SYSTEM."
#~(mkdir-p #$target)
#t)
- (let (($PATH (getenv "PATH")))
- ;; Make sure fsck.ext2 & co. can be found.
- (dynamic-wind
- (lambda ()
- ;; Don’t display the PATH settings.
- (with-output-to-port (%make-void-port "w")
- (lambda ()
- (set-path-environment-variable "PATH"
- '("bin" "sbin")
- '#$packages))))
- (lambda ()
- (mount-file-system
- (spec->file-system
- '#$(file-system->spec file-system))
- #:root "/"))
- (lambda ()
- (setenv "PATH" $PATH)))
- #t)))
+ #$(if mount?
+ #~(let (($PATH (getenv "PATH")))
+ ;; Make sure fsck.ext2 & co. can be found.
+ (dynamic-wind
+ (lambda ()
+ ;; Don’t display the PATH settings.
+ (with-output-to-port (%make-void-port "w")
+ (lambda ()
+ (set-path-environment-variable "PATH"
+
'("bin" "sbin")
+
'#$packages))))
+ (lambda ()
+ (mount-file-system
+ (spec->file-system
+ '#$(file-system->spec file-system))
+ #:root "/"))
+ (lambda ()
+ (setenv "PATH" $PATH))))
+ #t)
+ #t))
(stop #~(lambda args
;; Normally there are no processes left at this point, so
;; TARGET can be safely unmounted.
@@ -365,7 +371,10 @@ FILE-SYSTEM."
(define (file-system-shepherd-services file-systems)
"Return the list of Shepherd services for FILE-SYSTEMS."
- (let* ((file-systems (filter file-system-mount? file-systems)))
+ (let* ((file-systems (filter (lambda (x)
+ (or (file-system-mount? x)
+ (file-system-create-mount-point? x)))
+ file-systems)))
(define sink
(shepherd-service
(provision '(file-systems))
- 197/377: gnu: Add python-resolvelib-0.5., (continued)
- 197/377: gnu: Add python-resolvelib-0.5., guix-commits, 2021/09/02
- 193/377: gnu: bootloader: Support multiple targets., guix-commits, 2021/09/02
- 199/377: gnu: Add python-pyspnego., guix-commits, 2021/09/02
- 200/377: gnu: python-pytest-6: Update to 6.2.4 and propagate iniconfig., guix-commits, 2021/09/02
- 202/377: gnu: python-rope: Update to 0.19.0 and remove python2-rope., guix-commits, 2021/09/02
- 205/377: gnu: python-pytest-forked: Update to 1.3.0 and run test suite., guix-commits, 2021/09/02
- 204/377: gnu: python-py-next: Update to 1.10.0., guix-commits, 2021/09/02
- 211/377: gnu: ansible: Update to 4.4.0., guix-commits, 2021/09/02
- 209/377: gnu: Add python-pytest-xdist-next., guix-commits, 2021/09/02
- 207/377: gnu: python-pytest-mock: Update to 3.6.1 and run test suite., guix-commits, 2021/09/02
- 214/377: services: base: Honor file-system-create-mount-point? at all times.,
guix-commits <=
- 235/377: gnu: Add python-pybbi., guix-commits, 2021/09/02
- 228/377: build: Build (gnu packages rocm)., guix-commits, 2021/09/02
- 220/377: gnu: mu: Update to 1.6.5., guix-commits, 2021/09/02
- 217/377: gnu: rofi: Update to 1.7.0., guix-commits, 2021/09/02
- 226/377: bootloader: Report location of the deprecated 'target' field., guix-commits, 2021/09/02
- 222/377: gnu: guile-websocket: Update to 0.1-d17878f6., guix-commits, 2021/09/02
- 213/377: gnu: python-pytest-django: Update to 4.4.0., guix-commits, 2021/09/02
- 224/377: gnu: extra-cmake-modules: Avoid dependency on qtbase when on armhf., guix-commits, 2021/09/02
- 225/377: build: Build (gnu system setuid)., guix-commits, 2021/09/02
- 236/377: gnu: Add python-svgutils., guix-commits, 2021/09/02