guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: image: Add comments.


From: guix-commits
Subject: branch master updated: image: Add comments.
Date: Wed, 31 Aug 2022 09:00:01 -0400

This is an automated email from the git hooks/post-receive script.

mothacehe pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new 16a6cbe947 image: Add comments.
16a6cbe947 is described below

commit 16a6cbe94700da82ab223999df1ed4ba049676b1
Author: Mathieu Othacehe <othacehe@gnu.org>
AuthorDate: Wed Aug 31 14:59:06 2022 +0200

    image: Add comments.
    
    * gnu/image.scm: Add some comments across the whole module.
---
 gnu/image.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/image.scm b/gnu/image.scm
index 64bae48d51..a031e87924 100644
--- a/gnu/image.scm
+++ b/gnu/image.scm
@@ -64,6 +64,9 @@
 ;;; Sanitizers.
 ;;;
 
+;; Image and partition sizes can be either be a size in bytes or the 'guess
+;; symbol denoting that the size should be estimated by Guix, according to the
+;; image content.
 (define-with-syntax-properties (validate-size (value properties))
   (unless (and value
                (or (eq? value 'guess) (integer? value)))
@@ -82,6 +85,7 @@
 ;;; Partition record.
 ;;;
 
+;; The partition offset should be a bytes count as an integer.
 (define-with-syntax-properties (validate-partition-offset (value properties))
   (unless (and value (integer? value))
     (raise
@@ -94,6 +98,7 @@
 numeric expression ~%") value 'field))))
   value)
 
+;; The supported partition flags.
 (define-with-syntax-properties (validate-partition-flags (value properties))
   (let ((bad-flags (lset-difference eq? value '(boot esp))))
     (unless (and (list? value) (null? bad-flags))
@@ -144,8 +149,11 @@ that is not in SET, mentioning FIELD in the error message."
         (formatted-message (G_ "~s: invalid '~a' value") value 'field))))
     value))
 
+;; The supported image formats.
 (define-set-sanitizer validate-image-format format
   (disk-image compressed-qcow2 docker iso9660))
+
+;; The supported partition table types.
 (define-set-sanitizer validate-partition-table-type partition-table-type
   (mbr gpt))
 
@@ -184,6 +192,22 @@ that is not in SET, mentioning FIELD in the error message."
 ;;; Image type.
 ;;;
 
+;; The role of this record is to provide a constructor that is able to turn an
+;; <operating-system> record into an <image> record.  Some basic <image-type>
+;; records are defined in the (gnu system image) module.  They are able to
+;; turn an <operating-system> record into an EFI or an ISO 9660 bootable
+;; image, a Docker image or even a QCOW2 image.
+;;
+;; Other <image-type> records are defined in the (gnu system images ...)
+;; modules.  They are dedicated to specific machines such as Novena and Pine64
+;; SoC boards that require specific images.
+;;
+;; All the available <image-type> records are collected by the 'image-modules'
+;; procedure.  This allows the "guix system image" command to turn a given
+;; <operating-system> record into an image, thanks to the specified
+;; <image-type>.  In that case, the <image-type> look up is done using the
+;; name field of the <image-type> record.
+
 (define-record-type* <image-type>
   image-type make-image-type
   image-type?
@@ -196,10 +220,15 @@ that is not in SET, mentioning FIELD in the error 
message."
 ;;;
 
 (define* (os->image os #:key type)
+  "Use the image constructor from TYPE, an <image-type> record to turn the
+given OS, an <operating-system> record into an image and return it."
   (let ((constructor (image-type-constructor type)))
     (constructor os)))
 
 (define* (os+platform->image os platform #:key type)
+  "Use the image constructor from TYPE, an <image-type> record to turn the
+given OS, an <operating-system> record into an image targeting PLATFORM, a
+<platform> record and return it."
   (image
    (inherit (os->image os #:type type))
    (platform platform)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]