summaryrefslogtreecommitdiff
path: root/gnu/system/images/hurd.scm
diff options
context:
space:
mode:
authorMathieu Othacehe <m.othacehe@gmail.com>2020-07-31 16:49:28 +0200
committerMathieu Othacehe <othacehe@gnu.org>2020-09-30 10:47:59 +0200
commit10b135cef54348e48805bd9c64b463c465c65eb5 (patch)
treec6b9d108124eb63d0127eb5db0add0d8444635b3 /gnu/system/images/hurd.scm
parent99d036ce8402326352c8aa181d89c6d0c7ce85a8 (diff)
system: image: Add image-type support.
* gnu/system/image.scm (image-with-os): New macro. Rename the old "image-with-os" procedure to ... (image-with-os*): ... this new procedure, (system-image): adapt according, (raw-image-type, iso-image-type, uncompressed-iso-image-type %image-types): new variables, (lookup-image-type-by-name): new procedure. (find-image): remove it. * gnu/system/images/hurd.scm (hurd-image-type): New variable, use it to define ... (hurd-disk-image): ... this variable, using "os->image" procedure. * gnu/tests/install.scm (run-install): Rename installation-disk-image-file-system-type parameter to installation-image-type, use os->config instead of find-image to compute the image passed to system-image, (%test-iso-image-installer) adapt accordingly, (guided-installation-test): ditto. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
Diffstat (limited to 'gnu/system/images/hurd.scm')
-rw-r--r--gnu/system/images/hurd.scm29
1 files changed, 23 insertions, 6 deletions
diff --git a/gnu/system/images/hurd.scm b/gnu/system/images/hurd.scm
index 6d46eb5eda..4417952c5d 100644
--- a/gnu/system/images/hurd.scm
+++ b/gnu/system/images/hurd.scm
@@ -29,8 +29,11 @@
#:use-module (gnu system file-systems)
#:use-module (gnu system hurd)
#:use-module (gnu system image)
+ #:use-module (srfi srfi-26)
#:export (hurd-barebones-os
hurd-disk-image
+ hurd-image-type
+ hurd-qcow2-image-type
hurd-barebones-disk-image
hurd-barebones-qcow2-image))
@@ -83,14 +86,28 @@
(flags '(boot))
(initializer hurd-initialize-root-partition))))))
+(define hurd-image-type
+ (image-type
+ (name 'hurd-raw)
+ (constructor (cut image-with-os hurd-disk-image <>))))
+
+(define hurd-qcow2-image-type
+ (image-type
+ (name 'hurd-qcow2)
+ (constructor (lambda (os)
+ (image
+ (inherit hurd-disk-image)
+ (format 'compressed-qcow2)
+ (operating-system os))))))
+
(define hurd-barebones-disk-image
(image
- (inherit hurd-disk-image)
- (name 'hurd-barebones-disk-image)
- (operating-system hurd-barebones-os)))
+ (inherit
+ (os->image hurd-barebones-os #:type hurd-image-type))
+ (name 'hurd-barebones-disk-image)))
(define hurd-barebones-qcow2-image
(image
- (inherit hurd-barebones-disk-image)
- (name 'hurd-barebones.qcow2)
- (format 'compressed-qcow2)))
+ (inherit
+ (os->image hurd-barebones-os #:type hurd-qcow2-image-type))
+ (name 'hurd-barebones.qcow2)))