diff mbox series

[bug#65842,2/2] image: Do not allow BIOS bootloader and GPT.

Message ID 627b212f6b5bf9fd412e8c899b67b031cb1c4a00.1694273927.git.othacehe@gnu.org
State New
Headers show
Series image: Introduce mbr-hybrid-raw image type. | expand

Commit Message

Mathieu Othacehe Sept. 9, 2023, 3:57 p.m. UTC
When using grub-bootloader with a GPT image, GRUB will fail during
installation with a cryptic error message.

* gnu/system/image.scm (system-disk-image): Raise an error when trying to use
a non-EFI compatible bootloader with a GPT image partitioning.
---
 gnu/system/image.scm | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/gnu/system/image.scm b/gnu/system/image.scm
index b1b928b222..fa4cab0b03 100644
--- a/gnu/system/image.scm
+++ b/gnu/system/image.scm
@@ -530,6 +530,13 @@  (define* (system-disk-image image
                 (image-partition-table-type image)))
        (else "")))
 
+    (when (and (gpt-image? image)
+               (not
+                (memq (bootloader-name bootloader) '(grub-efi grub-efi32))))
+      (raise
+       (formatted-message
+        (G_ "EFI bootloader required with GPT partitioning"))))
+
     (let* ((format (image-format image))
            (image-type (format->image-type format))
            (image-type-options (genimage-type-options image-type image))