summary refs log tree commit diff
path: root/gnu/system/image.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/system/image.scm')
-rw-r--r--gnu/system/image.scm16
1 files changed, 15 insertions, 1 deletions
diff --git a/gnu/system/image.scm b/gnu/system/image.scm
index afef79185f..841e7e0c7e 100644
--- a/gnu/system/image.scm
+++ b/gnu/system/image.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2022 Pavel Shlyak <p.shlyak@pantherx.org>
 ;;; Copyright © 2022 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
 ;;; Copyright © 2022 Alex Griffin <a@ajgrf.com>
+;;; Copyright © 2023 Efraim Flashner <efraim@flashner.co.il>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -147,11 +148,13 @@ parent image record."
 (define efi-disk-image
   (image-without-os
    (format 'disk-image)
+   (partition-table-type 'gpt)
    (partitions (list esp-partition root-partition))))
 
 (define efi32-disk-image
   (image-without-os
    (format 'disk-image)
+   (partition-table-type 'gpt)
    (partitions (list esp32-partition root-partition))))
 
 (define iso9660-image
@@ -214,6 +217,7 @@ set to the given OS."
    (constructor (cut image-with-os
                  (image
                   (inherit efi-disk-image)
+                  (partition-table-type 'mbr)
                   (name 'image.qcow2)
                   (format 'compressed-qcow2))
                  <>))))
@@ -390,6 +394,9 @@ used in the image."
          ((or (string=? file-system "vfat")
               (string=? file-system "fat16")
               (string=? file-system "fat32")) "F")
+         ((and (string=? file-system "unformatted")
+               (partition-uuid partition))
+          (uuid->string (partition-uuid partition)))
          (else
           (raise (condition
                   (&message
@@ -414,7 +421,14 @@ used in the image."
               (with-imported-modules*
                (let ((initializer (or #$(partition-initializer partition)
                                       initialize-root-partition))
-                     (inputs '#+(list e2fsprogs fakeroot dosfstools mtools))
+                     (inputs '#+(cond
+                                  ((string-prefix? "ext" type)
+                                   (list e2fsprogs fakeroot))
+                                  ((or (string=? type "vfat")
+                                       (string-prefix? "fat" type))
+                                   (list dosfstools fakeroot mtools))
+                                  (else
+                                    '())))
                      (image-root "tmp-root"))
                  (sql-schema #$schema)