all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Marius Bakke <mbakke@fastmail.com>
To: Mark H Weaver <mhw@netris.org>, 30311@debbugs.gnu.org
Cc: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
Subject: bug#30311: efi-less grub install fails
Date: Tue, 20 Feb 2018 04:21:57 +0100	[thread overview]
Message-ID: <878tbocpm2.fsf@fastmail.com> (raw)
In-Reply-To: <87tvuel15z.fsf@netris.org>


[-- Attachment #1.1: Type: text/plain, Size: 671 bytes --]

Mark H Weaver <mhw@netris.org> writes:

> Hi Ricardo,
>
> Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> 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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-gnu-Pass-target-to-EFI-less-GRUB-only-when-EFI-varia.patch --]
[-- Type: text/x-patch, Size: 1480 bytes --]

From ce5d6089aff0cf6c31260ac2bbe0aeb2803eb8a0 Mon Sep 17 00:00:00 2001
From: Marius Bakke <mbakke@fastmail.com>
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 <https://bugs.gnu.org/30311>.

* 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 <https://bugs.gnu.org/30311>.
+                                ,@(if (file-exists? "/sys/firmware/efi")
+                                      "--target=i386-pc")
                                 device))
           (error "failed to install GRUB (BIOS)")))))
 
-- 
2.16.2


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

  parent reply	other threads:[~2018-02-20  3:23 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-31 18:55 bug#30311: efi-less grub install fails Ricardo Wurmus
2018-01-31 23:34 ` Danny Milosavljevic
2018-02-01 12:40   ` Marius Bakke
2018-02-18 11:28     ` Ricardo Wurmus
2018-01-31 23:55 ` Ludovic Courtès
2018-02-18 16:20 ` Mark H Weaver
2018-02-18 16:49   ` Danny Milosavljevic
2018-02-20 21:40     ` Ricardo Wurmus
2018-02-20 21:43       ` Danny Milosavljevic
2018-02-20 21:49         ` Ricardo Wurmus
2018-02-20 22:00           ` Danny Milosavljevic
2018-03-26 21:15             ` Danny Milosavljevic
2018-02-20  3:21   ` Marius Bakke [this message]
2018-02-20  3:46     ` Marius Bakke
2018-02-20 20:54       ` Danny Milosavljevic
2018-02-20 21:00       ` Danny Milosavljevic
2018-02-22 15:06         ` Marius Bakke
2018-02-22 15:47           ` Ricardo Wurmus
2018-02-23 11:30             ` Marius Bakke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878tbocpm2.fsf@fastmail.com \
    --to=mbakke@fastmail.com \
    --cc=30311@debbugs.gnu.org \
    --cc=mhw@netris.org \
    --cc=ricardo.wurmus@mdc-berlin.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.