summaryrefslogtreecommitdiff
path: root/gnu/system/image.scm
diff options
context:
space:
mode:
authorMathieu Othacehe <othacehe@gnu.org>2023-09-09 17:57:25 +0200
committerMathieu Othacehe <othacehe@gnu.org>2023-09-20 09:38:36 +0200
commite5ed1712da049b1c3dcf01e0a7e02e48a8aff012 (patch)
treef03647099e8b3ad67267c180ecfb2edc602921bb /gnu/system/image.scm
parent00a1ee15cdc046708d2df35d3854156da14fcbb9 (diff)
image: Introduce the mbr-hybrid-raw image type.
Until 209204e23b39af09e0ea92540b6fa00a60e6a0ae and d57cab764122af69d52d8cc9c843456044e5d7bc, the default image type used by "guix system image" was an MBR image with an ESP partition. Having both an MBR image and an ESP partition is handy because the image will boot on most x86 based systems using legacy BIOS and/or UEFI. We now have a distinction between MBR images and EFI images. Introduce a new MBR hybrid image type and default to it to restore the default behaviour. This also fixes the images section of (gnu ci) that was trying to install a BIOS bootloader on an EFI, GPT image and failing to do so. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
Diffstat (limited to 'gnu/system/image.scm')
-rw-r--r--gnu/system/image.scm14
1 files changed, 14 insertions, 0 deletions
diff --git a/gnu/system/image.scm b/gnu/system/image.scm
index 5b8da2f8965..b1b928b222c 100644
--- a/gnu/system/image.scm
+++ b/gnu/system/image.scm
@@ -77,6 +77,7 @@
77 root-partition 77 root-partition
78 78
79 mbr-disk-image 79 mbr-disk-image
80 mbr-hybrid-disk-image
80 efi-disk-image 81 efi-disk-image
81 iso9660-image 82 iso9660-image
82 docker-image 83 docker-image
@@ -86,6 +87,7 @@
86 87
87 image-with-os 88 image-with-os
88 mbr-raw-image-type 89 mbr-raw-image-type
90 mbr-hybrid-raw-image-type
89 efi-raw-image-type 91 efi-raw-image-type
90 efi32-raw-image-type 92 efi32-raw-image-type
91 qcow2-image-type 93 qcow2-image-type
@@ -156,6 +158,13 @@ parent image record."
156 (inherit root-partition) 158 (inherit root-partition)
157 (offset root-offset)))))) 159 (offset root-offset))))))
158 160
161(define mbr-hybrid-disk-image
162 (image-without-os
163 (format 'disk-image)
164 (partition-table-type 'mbr)
165 (partitions
166 (list esp-partition root-partition))))
167
159(define efi-disk-image 168(define efi-disk-image
160 (image-without-os 169 (image-without-os
161 (format 'disk-image) 170 (format 'disk-image)
@@ -217,6 +226,11 @@ set to the given OS."
217 (name 'mbr-raw) 226 (name 'mbr-raw)
218 (constructor (cut image-with-os mbr-disk-image <>)))) 227 (constructor (cut image-with-os mbr-disk-image <>))))
219 228
229(define mbr-hybrid-raw-image-type
230 (image-type
231 (name 'mbr-hybrid-raw)
232 (constructor (cut image-with-os mbr-hybrid-disk-image <>))))
233
220(define efi-raw-image-type 234(define efi-raw-image-type
221 (image-type 235 (image-type
222 (name 'efi-raw) 236 (name 'efi-raw)