Subject: bug#64593: ‘guix system image’ fails to create image while invoking ‘grub-bios-setup’

From: Ludovic Courtès <[email-masked]>
Date: Mon, 17 Jul 2023 18:11:44 +0200

Hi Josselin,

Josselin Poiret <[email-masked]> skribis:

> Ludovic Courtès <[email-masked]> writes:
>
>> The culprit might be 209204e23b39af09e0ea92540b6fa00a60e6a0ae, from
>> <https://issues.guix.gnu.org/62223>.
>>
>> Josselin, Sergey, WDYT?
>
> Apologies!  Our install-grub-disk-image doesn't really support GPT
> right, now but this is easy to fix (I've successfully booted your
> example with a local change).  However, for this to work we need to have
> a BIOS Boot partition instead of the ESP that's defined for efi images.
> We have two options here, either add a new image type that has that
> instead of the ESP (which means duplicating a bunch of them...), or make
> the partition of efi-raw change depending on the bootloader, which would
> need some refactoring.  I'm not a big fan of either options though :)

I’m not sure what a good fix is, but I think we should make sure ‘guix
system image’ (‘-t efi-raw’, that is) doesn’t remain broken.

One possible short-term option is to revert, or maybe we could
special-case along these lines:

diff --git a/gnu/system/image.scm b/gnu/system/image.scm
index 841e7e0c7e..b4ed4181ac 100644
--- a/gnu/system/image.scm
+++ b/gnu/system/image.scm
@@ -204,7 +204,12 @@ (define-syntax-rule (image-with-os base-image os)
 (define efi-raw-image-type
   (image-type
    (name 'efi-raw)
-   (constructor (cut image-with-os efi-disk-image <>))))
+   (constructor (cut image-with-os
+                     (image-without-os
+                      (format 'disk-image)
+                      (partition-table-type 'mbr) ;XXX
+                      (partitions (list esp-partition root-partition)))
+                     <>))))
 
 (define efi32-raw-image-type
   (image-type

WDYT?

Ludo’.