diff options
| author | Mathieu Othacehe <m.othacehe@gmail.com> | 2020-07-31 16:49:27 +0200 |
|---|---|---|
| committer | Mathieu Othacehe <othacehe@gnu.org> | 2020-09-30 10:47:59 +0200 |
| commit | 99d036ce8402326352c8aa181d89c6d0c7ce85a8 (patch) | |
| tree | 0cf737c8f626b24522b1c13a517fa431b5f72b78 /gnu/image.scm | |
| parent | 2f1f7b6667e9130654987942a63fd95c8b1788be (diff) | |
image: Add image-type support.
* gnu/image.scm (<image-type>): New record,
(image-type, image-type?, image-type-name,
image-type-constructor, os->image): new procedures.
Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
Diffstat (limited to 'gnu/image.scm')
| -rw-r--r-- | gnu/image.scm | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/gnu/image.scm b/gnu/image.scm index dc66f2c5337..a60d83b175b 100644 --- a/gnu/image.scm +++ b/gnu/image.scm | |||
| @@ -39,7 +39,14 @@ | |||
| 39 | image-partitions | 39 | image-partitions |
| 40 | image-compression? | 40 | image-compression? |
| 41 | image-volatile-root? | 41 | image-volatile-root? |
| 42 | image-substitutable?)) | 42 | image-substitutable? |
| 43 | |||
| 44 | image-type | ||
| 45 | image-type? | ||
| 46 | image-type-name | ||
| 47 | image-type-constructor | ||
| 48 | |||
| 49 | os->image)) | ||
| 43 | 50 | ||
| 44 | 51 | ||
| 45 | ;;; | 52 | ;;; |
| @@ -84,3 +91,23 @@ | |||
| 84 | (default #t)) | 91 | (default #t)) |
| 85 | (substitutable? image-substitutable? ;boolean | 92 | (substitutable? image-substitutable? ;boolean |
| 86 | (default #t))) | 93 | (default #t))) |
| 94 | |||
| 95 | |||
| 96 | ;;; | ||
| 97 | ;;; Image type. | ||
| 98 | ;;; | ||
| 99 | |||
| 100 | (define-record-type* <image-type> | ||
| 101 | image-type make-image-type | ||
| 102 | image-type? | ||
| 103 | (name image-type-name) ;symbol | ||
| 104 | (constructor image-type-constructor)) ;<operating-system> -> <image> | ||
| 105 | |||
| 106 | |||
| 107 | ;;; | ||
| 108 | ;;; Image creation. | ||
| 109 | ;;; | ||
| 110 | |||
| 111 | (define* (os->image os #:key type) | ||
| 112 | (let ((constructor (image-type-constructor type))) | ||
| 113 | (constructor os))) | ||
