image: Add qcow2-gpt image type.

qcow2 is a mbr-hybrid image. But on aarch64, we
have to use grub-efi bootloader. For that bootloader,
gpt should be used and Guix errors if it isn't (due to
failed check in Guix code). So it's impossible to generate
qcow2 type aarch64 image without using customized bootloader.
One would have to define their own image instead of using
the ones pre-defined.

* gnu/system/system.scm (qcow2-gpt-image-type): New variable.
* doc/guix.texi: Document qcow2-gpt and its use.

Change-Id: I93f0880c7ca2d3f934067c12dd1143ad20828333
Signed-off-by: Rutherther <rutherther@ditigal.xyz>
This commit is contained in:
Rutherther 2025-12-01 08:02:24 +01:00
parent 2576c66e47
commit 20157dae27
No known key found for this signature in database
GPG key ID: 0322798269E471C3
2 changed files with 26 additions and 2 deletions

View file

@ -47841,7 +47841,9 @@ machine. The @code{grub-bootloader} bootloader is always used
independently of what is declared in the @code{operating-system} file
passed as argument. This is to make it easier to work with QEMU, which
uses the SeaBIOS BIOS by default, expecting a bootloader to be installed
in the Master Boot Record (MBR).
in the Master Boot Record (MBR). In case the virtual machine is
going to be AArch64, you might want to take a look at @code{qcow2-gpt}
image type that installs bootloader only in EFI.
@cindex docker-image, creating docker images
When using the @code{docker} image type, a Docker image is produced.
@ -54765,7 +54767,18 @@ Build an image based on the @code{efi32-disk-image} image.
@defvar qcow2-image-type
Build an image based on the @code{mbr-disk-image} image but with the
@code{compressed-qcow2} image format.
@code{compressed-qcow2} image format. The resulting image will have
an MBR embedded bootloader as well as an EFI bootloader. This image
is not suitable for architectures that do not support `grub-pc`,
such as AArch64. See @code{qcow2-gpt-image-type} for an alternative.
@end defvar
@defvar qcow2-gpt-image-type
Build an image based on the @code{efi-disk-image} image but with the
@code{compressed-qcow2} image format. The resulting image will have
only EFI bootloader, unlike @code{qcow2-image-type}. This image
is suitable for architectures that do not support `grub-pc`, such
as AArch64.
@end defvar
@defvar iso-image-type

View file

@ -98,6 +98,7 @@
efi-raw-image-type
efi32-raw-image-type
qcow2-image-type
qcow2-gpt-image-type
iso-image-type
uncompressed-iso-image-type
docker-image-type
@ -265,6 +266,16 @@ set to the given OS."
(format 'compressed-qcow2))
<>))))
(define qcow2-gpt-image-type
(image-type
(name 'qcow2-gpt)
(constructor (cut image-with-os
(image
(inherit efi-disk-image)
(name 'image.qcow2)
(format 'compressed-qcow2))
<>))))
(define iso-image-type
(image-type
(name 'iso9660)