From 644cdc819fc6c49bbfcfa48d2d2cd52034862d2b Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Tue, 29 Sep 2020 11:40:58 +0200 Subject: images: hurd: Add hurd-barebones-qcow2-image. * gnu/system/images/hurd.scm (hurd-barebones-qcow2-image): New variable. --- gnu/system/images/hurd.scm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'gnu/system/images') diff --git a/gnu/system/images/hurd.scm b/gnu/system/images/hurd.scm index d87640e8e3..6d46eb5eda 100644 --- a/gnu/system/images/hurd.scm +++ b/gnu/system/images/hurd.scm @@ -31,7 +31,8 @@ #:use-module (gnu system image) #:export (hurd-barebones-os hurd-disk-image - hurd-barebones-disk-image)) + hurd-barebones-disk-image + hurd-barebones-qcow2-image)) (define hurd-barebones-os (operating-system @@ -87,3 +88,9 @@ (inherit hurd-disk-image) (name 'hurd-barebones-disk-image) (operating-system hurd-barebones-os))) + +(define hurd-barebones-qcow2-image + (image + (inherit hurd-barebones-disk-image) + (name 'hurd-barebones.qcow2) + (format 'compressed-qcow2))) -- cgit v1.2.3 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/image.scm | 90 +++++++++++++++++++++++++++++++++++++--------- gnu/system/images/hurd.scm | 29 +++++++++++---- gnu/tests/install.scm | 46 ++++++++++++------------ 3 files changed, 118 insertions(+), 47 deletions(-) (limited to 'gnu/system/images') diff --git a/gnu/system/image.scm b/gnu/system/image.scm index 0f2fb62a6b..c81054f847 100644 --- a/gnu/system/image.scm +++ b/gnu/system/image.scm @@ -18,6 +18,8 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu system image) + #:use-module (guix diagnostics) + #:use-module (guix discovery) #:use-module (guix gexp) #:use-module (guix modules) #:use-module (guix monads) @@ -64,9 +66,16 @@ efi-disk-image iso9660-image - find-image + image-with-os + raw-image-type + iso-image-type + uncompressed-iso-image-type + + image-with-label system-image - image-with-label)) + + %image-types + lookup-image-type-by-name)) ;;; @@ -113,6 +122,37 @@ (label "GUIX_IMAGE") (flags '(boot))))))) + +;;; +;;; Images types. +;;; + +(define-syntax-rule (image-with-os base-image os) + "Return an image inheriting from BASE-IMAGE, with the operating-system field +set to the given OS." + (image + (inherit base-image) + (operating-system os))) + +(define raw-image-type + (image-type + (name 'raw) + (constructor (cut image-with-os efi-disk-image <>)))) + +(define iso-image-type + (image-type + (name 'iso9660) + (constructor (cut image-with-os iso9660-image <>)))) + +(define uncompressed-iso-image-type + (image-type + (name 'uncompressed-iso9660) + (constructor (cut image-with-os + (image + (inherit iso9660-image) + (compression? #f)) + <>)))) + ;; ;; Helpers. @@ -442,7 +482,7 @@ returns an image record where the first partition's label is set to