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:46:22 +0100 [thread overview]
Message-ID: <87606scohd.fsf@fastmail.com> (raw)
In-Reply-To: <878tbocpm2.fsf@fastmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 815 bytes --]
Marius Bakke <mbakke@fastmail.com> writes:
> 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.
Bah, here is a fixed version that actually works (for the normal case).
[-- 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: 1700 bytes --]
From 968ccb27e40ce683ec469f3ac7973827a7e8ddf5 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 | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm
index 3b01125c7..17ded5f6d 100644
--- a/gnu/bootloader/grub.scm
+++ b/gnu/bootloader/grub.scm
@@ -386,9 +386,15 @@ submenu \"GNU system, old configurations...\" {~%")
;; root partition.
(setenv "GRUB_ENABLE_CRYPTODISK" "y")
- (unless (zero? (system* grub "--no-floppy" "--target=i386-pc"
- "--boot-directory" install-dir
- device))
+ (unless (zero? (apply system* grub
+ (list "--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)")))))
(define install-grub-efi
--
2.16.2
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
next prev parent reply other threads:[~2018-02-20 3:47 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
2018-02-20 3:46 ` Marius Bakke [this message]
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=87606scohd.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.