From 2bdd7ac17ceff60cd5ef77e530f62cea902bf90d Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 18 Jul 2016 00:51:02 +0200 Subject: system: Honor the 'dependencies' field of file systems. This allows mapped devices listed in 'dependencies' to be properly taken into account. Reported by Andreas Enge . * gnu/system.scm (mapped-device-user): Check whether DEVICE is a member of the 'dependencies' of FS. * tests/system.scm (%luks-device, %os-with-mapped-device): New variables. ("operating-system-user-mapped-devices") ("operating-system-boot-mapped-devices") ("operating-system-boot-mapped-devices, implicit dependency"): New tests. --- gnu/system.scm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'gnu/system.scm') diff --git a/gnu/system.scm b/gnu/system.scm index a49b3f29b3..476720b9f9 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -81,6 +81,8 @@ operating-system-mapped-devices operating-system-file-systems operating-system-store-file-system + operating-system-user-mapped-devices + operating-system-boot-mapped-devices operating-system-activation-script operating-system-user-accounts operating-system-shepherd-service-names @@ -208,8 +210,9 @@ as 'needed-for-boot'." "Return a file system among FILE-SYSTEMS that uses DEVICE, or #f." (let ((target (string-append "/dev/mapper/" (mapped-device-target device)))) (find (lambda (fs) - (and (eq? 'device (file-system-title fs)) - (string=? (file-system-device fs) target))) + (or (member device (file-system-dependencies fs)) + (and (eq? 'device (file-system-title fs)) + (string=? (file-system-device fs) target)))) file-systems))) (define (operating-system-user-mapped-devices os) -- cgit v1.2.3