From 10b135cef54348e48805bd9c64b463c465c65eb5 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Fri, 31 Jul 2020 16:49:28 +0200 Subject: 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 --- gnu/system/images/hurd.scm | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'gnu/system/images/hurd.scm') 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 @@ (define-module (gnu system images hurd) #: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 @@ (define hurd-disk-image (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))) -- cgit v1.2.3