From 68a58775e071d4b0e000b93ad121b6e64d161b79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 21 Jun 2018 23:50:47 +0200 Subject: system: Mapped devices needed for boot do not yield Shepherd services. Fixes . Reported by Taylan Kammer . * gnu/system.scm (non-boot-file-system-service)[mapped-devices-for-boot]: New variable. Remove dependencies of FS that are members of MAPPED-DEVICES-FOR-BOOT. (mapped-device-user): Rename to... (mapped-device-users): ... this. Use 'filter' instead of 'find'. (operating-system-user-mapped-devices) (operating-system-boot-mapped-devices): Use 'any file-system-needed-for-boot?' instead of looking at the first user. * tests/system.scm ("non-boot-file-system-service"): New test. --- tests/system.scm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'tests/system.scm') diff --git a/tests/system.scm b/tests/system.scm index 7d55da7174..9416b950e6 100644 --- a/tests/system.scm +++ b/tests/system.scm @@ -19,6 +19,7 @@ (define-module (test-system) #:use-module (gnu) + #:use-module ((gnu services) #:select (service-value)) #:use-module (guix store) #:use-module (srfi srfi-1) #:use-module (srfi srfi-64)) @@ -117,4 +118,26 @@ (type "ext4")) %base-file-systems))))) +(test-equal "non-boot-file-system-service" + '() + + ;; Make sure that mapped devices with at least one needed-for-boot user are + ;; handled exclusively from the initrd. See . + (append-map file-system-dependencies + (service-value + ((@@ (gnu system) non-boot-file-system-service) + (operating-system + (inherit %os-with-mapped-device) + (file-systems + (list (file-system + (mount-point "/foo/bar") + (device "qux:baz") + (type "none") + (dependencies (list %luks-device))) + (file-system + (device (file-system-label "my-root")) + (mount-point "/") + (type "ext4") + (dependencies (list %luks-device)))))))))) + (test-end) -- cgit v1.2.3