diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2016-04-17 17:53:20 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2016-04-18 01:24:06 +0200 |
| commit | 060d62a740fc1932a3be505534feff099b59ac9f (patch) | |
| tree | 1b085f9a0f2c7581365f2ce79fe4fa24657d1d16 /gnu/system | |
| parent | fac34dfe2a576907bf9f612d8ed8f4e9dee826be (diff) | |
system: Add (gnu system mapped-devices).
* gnu/system/file-systems.scm (<mapped-device>, <mapped-device-type>):
Move to...
* gnu/system/mapped-devices.scm: ... here. New file.
* gnu/system.scm, gnu/services/base.scm,
gnu/system/linux-initrd.scm: Use it.
* gnu-system.am (GNU_SYSTEM_MODULES): Add it.
* gnu.scm (%public-modules): Add it.
Diffstat (limited to 'gnu/system')
| -rw-r--r-- | gnu/system/file-systems.scm | 31 | ||||
| -rw-r--r-- | gnu/system/linux-initrd.scm | 1 | ||||
| -rw-r--r-- | gnu/system/mapped-devices.scm | 53 |
3 files changed, 54 insertions, 31 deletions
diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm index d0726d2b614..7e8c4489ddd 100644 --- a/gnu/system/file-systems.scm +++ b/gnu/system/file-systems.scm | |||
| @@ -54,17 +54,6 @@ | |||
| 54 | %base-file-systems | 54 | %base-file-systems |
| 55 | %container-file-systems | 55 | %container-file-systems |
| 56 | 56 | ||
| 57 | mapped-device | ||
| 58 | mapped-device? | ||
| 59 | mapped-device-source | ||
| 60 | mapped-device-target | ||
| 61 | mapped-device-type | ||
| 62 | |||
| 63 | mapped-device-kind | ||
| 64 | mapped-device-kind? | ||
| 65 | mapped-device-kind-open | ||
| 66 | mapped-device-kind-close | ||
| 67 | |||
| 68 | <file-system-mapping> | 57 | <file-system-mapping> |
| 69 | file-system-mapping | 58 | file-system-mapping |
| 70 | file-system-mapping? | 59 | file-system-mapping? |
| @@ -293,26 +282,6 @@ initrd code." | |||
| 293 | (create-mount-point? #t) | 282 | (create-mount-point? #t) |
| 294 | (check? #f)))) | 283 | (check? #f)))) |
| 295 | 284 | ||
| 296 | |||
| 297 | |||
| 298 | ;;; | ||
| 299 | ;;; Mapped devices, for Linux's device-mapper. | ||
| 300 | ;;; | ||
| 301 | |||
| 302 | (define-record-type* <mapped-device> mapped-device | ||
| 303 | make-mapped-device | ||
| 304 | mapped-device? | ||
| 305 | (source mapped-device-source) ;string | ||
| 306 | (target mapped-device-target) ;string | ||
| 307 | (type mapped-device-type)) ;<mapped-device-kind> | ||
| 308 | |||
| 309 | (define-record-type* <mapped-device-type> mapped-device-kind | ||
| 310 | make-mapped-device-kind | ||
| 311 | mapped-device-kind? | ||
| 312 | (open mapped-device-kind-open) ;source target -> gexp | ||
| 313 | (close mapped-device-kind-close ;source target -> gexp | ||
| 314 | (default (const #~(const #f))))) | ||
| 315 | |||
| 316 | 285 | ||
| 317 | ;;; | 286 | ;;; |
| 318 | ;;; Shared file systems, for VMs/containers. | 287 | ;;; Shared file systems, for VMs/containers. |
diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm index 8ca74104fbb..aa9fbf6fe98 100644 --- a/gnu/system/linux-initrd.scm +++ b/gnu/system/linux-initrd.scm | |||
| @@ -32,6 +32,7 @@ | |||
| 32 | #:use-module ((gnu packages make-bootstrap) | 32 | #:use-module ((gnu packages make-bootstrap) |
| 33 | #:select (%guile-static-stripped)) | 33 | #:select (%guile-static-stripped)) |
| 34 | #:use-module (gnu system file-systems) | 34 | #:use-module (gnu system file-systems) |
| 35 | #:use-module (gnu system mapped-devices) | ||
| 35 | #:use-module (ice-9 match) | 36 | #:use-module (ice-9 match) |
| 36 | #:use-module (ice-9 regex) | 37 | #:use-module (ice-9 regex) |
| 37 | #:use-module (srfi srfi-1) | 38 | #:use-module (srfi srfi-1) |
diff --git a/gnu/system/mapped-devices.scm b/gnu/system/mapped-devices.scm new file mode 100644 index 00000000000..81afb91f868 --- /dev/null +++ b/gnu/system/mapped-devices.scm | |||
| @@ -0,0 +1,53 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | ||
| 2 | ;;; Copyright © 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org> | ||
| 3 | ;;; | ||
| 4 | ;;; This file is part of GNU Guix. | ||
| 5 | ;;; | ||
| 6 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | ||
| 7 | ;;; under the terms of the GNU General Public License as published by | ||
| 8 | ;;; the Free Software Foundation; either version 3 of the License, or (at | ||
| 9 | ;;; your option) any later version. | ||
| 10 | ;;; | ||
| 11 | ;;; GNU Guix is distributed in the hope that it will be useful, but | ||
| 12 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | ;;; GNU General Public License for more details. | ||
| 15 | ;;; | ||
| 16 | ;;; You should have received a copy of the GNU General Public License | ||
| 17 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | ||
| 18 | |||
| 19 | (define-module (gnu system mapped-devices) | ||
| 20 | #:use-module (guix records) | ||
| 21 | #:export (mapped-device | ||
| 22 | mapped-device? | ||
| 23 | mapped-device-source | ||
| 24 | mapped-device-target | ||
| 25 | mapped-device-type | ||
| 26 | |||
| 27 | mapped-device-kind | ||
| 28 | mapped-device-kind? | ||
| 29 | mapped-device-kind-open | ||
| 30 | mapped-device-kind-close)) | ||
| 31 | |||
| 32 | ;;; Commentary: | ||
| 33 | ;;; | ||
| 34 | ;;; This module supports "device mapping", a concept implemented by Linux's | ||
| 35 | ;;; device-mapper. | ||
| 36 | ;;; | ||
| 37 | ;;; Code: | ||
| 38 | |||
| 39 | (define-record-type* <mapped-device> mapped-device | ||
| 40 | make-mapped-device | ||
| 41 | mapped-device? | ||
| 42 | (source mapped-device-source) ;string | ||
| 43 | (target mapped-device-target) ;string | ||
| 44 | (type mapped-device-type)) ;<mapped-device-kind> | ||
| 45 | |||
| 46 | (define-record-type* <mapped-device-type> mapped-device-kind | ||
| 47 | make-mapped-device-kind | ||
| 48 | mapped-device-kind? | ||
| 49 | (open mapped-device-kind-open) ;source target -> gexp | ||
| 50 | (close mapped-device-kind-close ;source target -> gexp | ||
| 51 | (default (const #~(const #f))))) | ||
| 52 | |||
| 53 | ;;; mapped-devices.scm ends here | ||
