Mark H Weaver <> writes:

> Hi Ricardo,
> Ricardo Wurmus <> writes:
>> Okay, I’ve added “--target=i386-pc” to the list of arguments.
> This change breaks my mips64el-linux GuixSD system, which is supported
> by GRUB, but where "--target=i386-pc" is obviously not appropriate.  On
> my system I need a different 'target' setting.

Maybe we can make it conditional on EFI for now.  Ricardo, are you able
to test the attached patch?  I suspect we might get problems on POWER
and some ARM systems down the road, but it should at least fix this
immediate issue.

Note: I haven't tested this patch myself.

From ce5d6089aff0cf6c31260ac2bbe0aeb2803eb8a0 Mon Sep 17 00:00:00 2001
From: Marius Bakke <>
Date: Tue, 20 Feb 2018 04:02:23 +0100
Subject: [PATCH] gnu: Pass "--target" to EFI-less GRUB only when EFI variables
 are present.

Fixes <>.

* gnu/bootloader/grub.scm (install-grub): Make "--target" argument
conditional on the presence of "/sys/firmware/efi".
 gnu/bootloader/grub.scm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm
index 3b01125c7..2b8458161 100644
--- a/gnu/bootloader/grub.scm
+++ b/gnu/bootloader/grub.scm
@@ -386,8 +386,13 @@ submenu \"GNU system, old configurations...\" {~%")
         ;; root partition.
         (setenv "GRUB_ENABLE_CRYPTODISK" "y")
-        (unless (zero? (system* grub "--no-floppy" "--target=i386-pc"
+        (unless (zero? (system* grub "--no-floppy"
                                 "--boot-directory" install-dir
+                                ;; Explicitly pass target if the non-EFI
+                                ;; GRUB is requested on an EFI system.
+                                ;; See <>.
+                                ,@(if (file-exists? "/sys/firmware/efi")
+                                      "--target=i386-pc")
           (error "failed to install GRUB (BIOS)")))))

Attachment: signature.asc
Description: PGP signature

Reply via email to