From 722554a306be645026d75893b77863769dcd861d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 18 Sep 2014 19:18:39 +0200 Subject: system: Define 'device-mapping-kind', and add a 'close' procedure. * gnu/system/file-systems.scm (): New record type. ()[command]: Remove field. [type]: New field. * gnu/services/base.scm (device-mapping-service): Rename 'command' parameter to 'open'. Add 'close' parameter and honor it. * gnu/system.scm (luks-device-mapping): Rename to... (open-luks-device): ... this. (close-luks-device): New procedure. (luks-device-mapping): New variable. (device-mapping-services): Get the type of MD, and pass its 'open' and 'close' fields to 'device-mapping-service'. --- gnu/system/file-systems.scm | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'gnu/system') diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm index 90e2b0c796..ed9d70587f 100644 --- a/gnu/system/file-systems.scm +++ b/gnu/system/file-systems.scm @@ -17,6 +17,7 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu system file-systems) + #:use-module (guix gexp) #:use-module (guix records) #:export ( file-system @@ -43,7 +44,12 @@ mapped-device? mapped-device-source mapped-device-target - mapped-device-command)) + mapped-device-type + + mapped-device-kind + mapped-device-kind? + mapped-device-kind-open + mapped-device-kind-close)) ;;; Commentary: ;;; @@ -145,6 +151,13 @@ mapped-device? (source mapped-device-source) ;string (target mapped-device-target) ;string - (command mapped-device-command)) ;source target -> gexp + (type mapped-device-type)) ; + +(define-record-type* mapped-device-kind + make-mapped-device-kind + mapped-device-kind? + (open mapped-device-kind-open) ;source target -> gexp + (close mapped-device-kind-close ;source target -> gexp + (default (const #~(const #f))))) ;;; file-systems.scm ends here -- cgit v1.2.3