Report forwarded
to bug-guix@gnu.org: bug#30311; Package guix.
(Wed, 31 Jan 2018 18:57:02 GMT) (full text, mbox, link).
Acknowledgement sent
to Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>:
New bug report received and forwarded. Copy sent to bug-guix@gnu.org.
(Wed, 31 Jan 2018 18:57:02 GMT) (full text, mbox, link).
“guix system init” fails with a configuration file that specifies
grub-bootloader (not grub-efi-bootloader).
“grub-install” reports an error about “lib/grub/x86_64-efi/modinfo.sh”
not being available. It suggests passing “--target” or “--device”.
Our invocation of grub-install does not include a “--target” argument.
Only after I edited it to pass “--target=i386-pc” did “guix system init”
pass.
This is on an x86_64 laptop where “legacy” BIOS booting is enabled.
--
Ricardo
Information forwarded
to bug-guix@gnu.org: bug#30311; Package guix.
(Wed, 31 Jan 2018 23:35:02 GMT) (full text, mbox, link).
Hi Ricardo,
On Wed, 31 Jan 2018 19:55:58 +0100
Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> wrote:
> “guix system init” fails with a configuration file that specifies
> grub-bootloader (not grub-efi-bootloader).
>
> “grub-install” reports an error about “lib/grub/x86_64-efi/modinfo.sh”
> not being available. It suggests passing “--target” or “--device”.
>
> Our invocation of grub-install does not include a “--target” argument.
> Only after I edited it to pass “--target=i386-pc” did “guix system init”
> pass.
Hmm, I wonder what happened here.
We've been very careful to keep grub and grub-efi separate.
The entire directory lib/grub/x86_64-efi shouldn't be available in the
"grub" package output - and I checked on master, it isn't. Good.
So that leaves automatic target selection as the culprit.
And indeed, there's a call to grub_install_get_default_x86_platform
in util/grub-install.c . And that checks for availability of
/sys/firmware/efi and if it exists, defaults to EFI.
I think it's a bug in grub to do that for a grub which doesn't have EFI
platform support. :P
We could just always pass i386-pc in install-grub for i386, but then
we lose i386-ieee1275 (which I have never heard anyone using so maybe
not so bad).
Please report a bug with grub...
Information forwarded
to bug-guix@gnu.org: bug#30311; Package guix.
(Wed, 31 Jan 2018 23:56:01 GMT) (full text, mbox, link).
Heya,
Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> skribis:
> “guix system init” fails with a configuration file that specifies
> grub-bootloader (not grub-efi-bootloader).
>
> “grub-install” reports an error about “lib/grub/x86_64-efi/modinfo.sh”
> not being available. It suggests passing “--target” or “--device”.
>
> Our invocation of grub-install does not include a “--target” argument.
> Only after I edited it to pass “--target=i386-pc” did “guix system init”
> pass.
>
> This is on an x86_64 laptop where “legacy” BIOS booting is enabled.
To complement from what we’ve discussed on IRC:
• It’s a UEFI laptop with legacy-BIOS enabled, but UEFI still.
• AIUI the installation image boots in UEFI mode on UEFI machines, and
then ‘grub-install’ (probably via ‘efivar’ or /sys or similar)
detects that it’s UEFI, decides that the target is thus
“x86_64-efi”, and fails because it lacks the EFI files.
I can think of two possible workarounds:
1. Default to ‘grub-hybrid’. But in that case, you’d have done a UEFI
install unconditionally.
2. For ‘grub-bootloader’ (not EFI), always pass ‘--target=i386-pc’.
Danny, Marius, thoughts? :-)
Ludo’.
Information forwarded
to bug-guix@gnu.org: bug#30311; Package guix.
(Thu, 01 Feb 2018 12:41:02 GMT) (full text, mbox, link).
Danny Milosavljevic <dannym@scratchpost.org> writes:
> Hi Ricardo,
>
> On Wed, 31 Jan 2018 19:55:58 +0100
> Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> wrote:
>
>> “guix system init” fails with a configuration file that specifies
>> grub-bootloader (not grub-efi-bootloader).
>>
>> “grub-install” reports an error about “lib/grub/x86_64-efi/modinfo.sh”
>> not being available. It suggests passing “--target” or “--device”.
>>
>> Our invocation of grub-install does not include a “--target” argument.
>> Only after I edited it to pass “--target=i386-pc” did “guix system init”
>> pass.
>
> Hmm, I wonder what happened here.
>
> We've been very careful to keep grub and grub-efi separate.
>
> The entire directory lib/grub/x86_64-efi shouldn't be available in the
> "grub" package output - and I checked on master, it isn't. Good.
>
> So that leaves automatic target selection as the culprit.
>
> And indeed, there's a call to grub_install_get_default_x86_platform
> in util/grub-install.c . And that checks for availability of
> /sys/firmware/efi and if it exists, defaults to EFI.
>
> I think it's a bug in grub to do that for a grub which doesn't have EFI
> platform support. :P
>
> We could just always pass i386-pc in install-grub for i386, but then
> we lose i386-ieee1275 (which I have never heard anyone using so maybe
> not so bad).
I agree, passing --target seems like the best workaround for this GRUB
bug.
Severity set to 'important' from 'normal'
Request was from ludo@gnu.org (Ludovic Courtès)
to control@debbugs.gnu.org.
(Tue, 06 Feb 2018 16:06:02 GMT) (full text, mbox, link).
Reply sent
to Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>:
You have taken responsibility.
(Sun, 18 Feb 2018 11:29:02 GMT) (full text, mbox, link).
Notification sent
to Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>:
bug acknowledged by developer.
(Sun, 18 Feb 2018 11:29:04 GMT) (full text, mbox, link).
Marius Bakke <mbakke@fastmail.com> writes:
> Danny Milosavljevic <dannym@scratchpost.org> writes:
>
>> Hi Ricardo,
>>
>> On Wed, 31 Jan 2018 19:55:58 +0100
>> Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> wrote:
>>
>>> “guix system init” fails with a configuration file that specifies
>>> grub-bootloader (not grub-efi-bootloader).
>>>
>>> “grub-install” reports an error about “lib/grub/x86_64-efi/modinfo.sh”
>>> not being available. It suggests passing “--target” or “--device”.
>>>
>>> Our invocation of grub-install does not include a “--target” argument.
>>> Only after I edited it to pass “--target=i386-pc” did “guix system init”
>>> pass.
>>
>> Hmm, I wonder what happened here.
>>
>> We've been very careful to keep grub and grub-efi separate.
>>
>> The entire directory lib/grub/x86_64-efi shouldn't be available in the
>> "grub" package output - and I checked on master, it isn't. Good.
>>
>> So that leaves automatic target selection as the culprit.
>>
>> And indeed, there's a call to grub_install_get_default_x86_platform
>> in util/grub-install.c . And that checks for availability of
>> /sys/firmware/efi and if it exists, defaults to EFI.
>>
>> I think it's a bug in grub to do that for a grub which doesn't have EFI
>> platform support. :P
>>
>> We could just always pass i386-pc in install-grub for i386, but then
>> we lose i386-ieee1275 (which I have never heard anyone using so maybe
>> not so bad).
>
> I agree, passing --target seems like the best workaround for this GRUB
> bug.
Okay, I’ve added “--target=i386-pc” to the list of arguments.
Thanks for the comments.
--
Ricardo
Information forwarded
to bug-guix@gnu.org: bug#30311; Package guix.
(Sun, 18 Feb 2018 16:22:02 GMT) (full text, mbox, link).
reopen 30311
thanks
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.
It would be great if we could find another solution to this issue.
GRUB's automatic target selection seems to work on most systems, since
we've been relying on it for a long time without anyone reporting
problems until this bug report.
In the rare cases where GRUB fails to detect the target, perhaps we
could provide a way to specify an explicit GRUB 'target' in the grub
configuration? What do you think?
Mark
Did not alter fixed versions and reopened.
Request was from Debbugs Internal Request <help-debbugs@gnu.org>
to internal_control@debbugs.gnu.org.
(Sun, 18 Feb 2018 16:22:02 GMT) (full text, mbox, link).
Information forwarded
to bug-guix@gnu.org: bug#30311; Package guix.
(Sun, 18 Feb 2018 16:50:02 GMT) (full text, mbox, link).
Hi Mark,
> 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.
A pretty safe workaround is to substitute /sys/firmware/efi by /sys/firmware/non-efi
in ./grub-core/osdep/linux/platform.c for non-efi grub.
See attachment...
> In the rare cases where GRUB fails to detect the target, perhaps we
> could provide a way to specify an explicit GRUB 'target' in the grub
> configuration?
I still think that upstream should fix this bug. It's silly that we have to
massage grub to not select a target which grub wasn't compiled for - we
patch/configure one part of grub so another part of grub isn't confused.
It's the same package :P
Bootloader configuration is complicated enough already. In this case I'd rather
grub did the right thing automatically.
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.
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).
Hi Marius,
hmm, if the conditional doesn't have an alternative case, doesn't that mean that the
value is unspecified? The list constructor doesn't like that...
You probably meant '()
Other than that, I agree that something like this patch is the low-risk workaround
to do.
Information forwarded
to bug-guix@gnu.org: bug#30311; Package guix.
(Tue, 20 Feb 2018 21:01:02 GMT) (full text, mbox, link).
Hi Danny,
>> 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.
>
> A pretty safe workaround is to substitute /sys/firmware/efi by /sys/firmware/non-efi
> in ./grub-core/osdep/linux/platform.c for non-efi grub.
I don’t understand this patch. How does it work?
What is the effect of replacing /sys/firmware/efi with
/sys/firmware/non-efi?
--
Ricardo
GPG: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC
https://elephly.net
Information forwarded
to bug-guix@gnu.org: bug#30311; Package guix.
(Tue, 20 Feb 2018 21:44:01 GMT) (full text, mbox, link).
> I don’t understand this patch. How does it work?
>
> What is the effect of replacing /sys/firmware/efi with
> /sys/firmware/non-efi?
It won't find EFI since it's looking in the wrong place.
That's what we want :)
Information forwarded
to bug-guix@gnu.org: bug#30311; Package guix.
(Tue, 20 Feb 2018 21:50:02 GMT) (full text, mbox, link).
Danny Milosavljevic <dannym@scratchpost.org> writes:
>> I don’t understand this patch. How does it work?
>>
>> What is the effect of replacing /sys/firmware/efi with
>> /sys/firmware/non-efi?
>
> It won't find EFI since it's looking in the wrong place.
>
> That's what we want :)
So the value “/sys/firmware/non-efi” might as well be
“/does-not-exist”?
Your patch subject says “Make sure that non-EFI grub doesn't try to use
EFI”, but the problem I had was that GRUB insisted on being passed a
“--target” option. That was with a GRUB installation on a system in
legacy mode. Do you mean that this failed because GRUB erroneously
attempted an EFI installation?
I’m thoroughly confused.
--
Ricardo
GPG: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC
https://elephly.net
Information forwarded
to bug-guix@gnu.org: bug#30311; Package guix.
(Tue, 20 Feb 2018 22:01:01 GMT) (full text, mbox, link).
Hi Ricardo,
On Tue, 20 Feb 2018 22:49:19 +0100
Ricardo Wurmus <rekado@elephly.net> wrote:
> So the value “/sys/firmware/non-efi” might as well be
> “/does-not-exist”?
Yes.
> Your patch subject says “Make sure that non-EFI grub doesn't try to use
> EFI”, but the problem I had was that GRUB insisted on being passed a
> “--target” option.
> That was with a GRUB installation on a system in
> legacy mode. Do you mean that this failed because GRUB erroneously
> attempted an EFI installation?
Yes, I think so.
There's a default-platform function in grub which determines the default
platform to use at runtime if you don't specify one. It one checks for
the existence of /sys/firmware/efi, and if so, returns "i386-efi" or
"x86_64-efi" (see ./grub-core/osdep/linux/platform.c).
Grub's "configure" script has the ability to select which platform you
want to compile. For the "grub" package, we choose i386, and for the
"grub-efi" package, we choose i386-efi.
The "grub-hybrid" package unions the "grub" and "grub-efi" packages,
preferring files from the "grub-efi" package. I think this
configuration is what upstream actually tests (only).
In the "grub" package we then had the situation that it was compiled
for i386 (not EFI) but THEIR OWN default-platform function specified
to use i386-efi which is some seriously strange stuff.
Do you think that this was not the cause?
Information forwarded
to bug-guix@gnu.org: bug#30311; Package guix.
(Thu, 22 Feb 2018 15:07:01 GMT) (full text, mbox, link).
Danny Milosavljevic <dannym@scratchpost.org> writes:
> Also, grub-hybrid is supposed to use efi so the workaround shouldn't be used with it...
Right, I had forgotten about grub-hybrid. That complicates things.
> What do you think about my direct grub patch?
That works too :-) It just felt a little "heavy-handed". I'll let
Ricardo judge which approach to take.
I do wonder if we can do better though, and maybe even fix it properly.
Ricardo: Can you post the output of `find /sys/firmware/efi -maxdepth 1`
on the affected machine? With luck, we'll find a variable that is only
present on "real" EFI.
Can you also post the contents of '/sys/firmware/efi/runtime'?
Marius Bakke <mbakke@fastmail.com> writes:
> Ricardo: Can you post the output of `find /sys/firmware/efi -maxdepth 1`
> on the affected machine? With luck, we'll find a variable that is only
> present on "real" EFI.
>
> Can you also post the contents of '/sys/firmware/efi/runtime'?
Now that I have GuixSD installed on that machine I don’t have
/sys/firmware/efi at all. /sys/firmware contains “acpi”, “dmi”, and
“memmap” only.
The problem occurred when I tried to install GuixSD (after booting from
a GuixSD installer USB drive), not when reconfiguring. I don’t have a
USB drive with me at the moment, so I cannot check the contents of
/sys/firmware in the installer GuixSD now.
--
Ricardo
GPG: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC
https://elephly.net
Information forwarded
to bug-guix@gnu.org: bug#30311; Package guix.
(Fri, 23 Feb 2018 11:31:02 GMT) (full text, mbox, link).
Ricardo Wurmus <rekado@elephly.net> writes:
> Marius Bakke <mbakke@fastmail.com> writes:
>
>> Ricardo: Can you post the output of `find /sys/firmware/efi -maxdepth 1`
>> on the affected machine? With luck, we'll find a variable that is only
>> present on "real" EFI.
>>
>> Can you also post the contents of '/sys/firmware/efi/runtime'?
>
> Now that I have GuixSD installed on that machine I don’t have
> /sys/firmware/efi at all. /sys/firmware contains “acpi”, “dmi”, and
> “memmap” only.
>
> The problem occurred when I tried to install GuixSD (after booting from
> a GuixSD installer USB drive), not when reconfiguring. I don’t have a
> USB drive with me at the moment, so I cannot check the contents of
> /sys/firmware in the installer GuixSD now.
In this case I'm certain that the installer booted in EFI mode, crushing
my dreams of a proper fix. So we'll need one of the proposed
workarounds to prevent this problem in the future.
Any news on how to proceed on this grub target thing?
I think the patch below is harmless enough and makes each grub package
self-consistent (the non-efi grub doesn't try to use efi, the grub-efi
tries to use efi and grub-hybrid tries to use efi, then).
>From 263b1dc0de9643094bc41f4be47b4b2317e95d7c Mon Sep 17 00:00:00 2001
From: Danny Milosavljevic <dannym@scratchpost.org>
Date: Sun, 18 Feb 2018 17:30:48 +0100
Subject: [PATCH] gnu: grub: Make sure that non-EFI grub doesn't try to use
EFI.
Tags: patch
* gnu/packages/bootloader.scm (grub)[arguments]<:phases>
[patch-/sys/firmware/efi-out]: New phase.
(grub-efi)[arguments]<:phases>[patch-/sys/firmware/efi-out]: Delete phase.
Fixes <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=30311>.
---
gnu/packages/bootloaders.scm | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index 59eb22f24..c09829e17 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -103,6 +103,11 @@
(copy-file (assoc-ref inputs "unifont") "unifont.bdf.gz")
(system* "gunzip" "unifont.bdf.gz")
#t))
+ (add-after 'unpack 'patch-/sys/firmware/efi-out
+ (lambda _
+ (substitute* "grub-core/osdep/linux/platform.c"
+ (("/sys/firmware/efi") "/sys/firmware/non-efi"))
+ #t))
(add-before 'check 'disable-flaky-test
(lambda _
;; This test is unreliable. For more information, see:
@@ -177,6 +182,7 @@ menu to select one of the installed operating systems.")
`(cons "--with-platform=efi" ,flags))
((#:phases phases)
`(modify-phases ,phases
+ (delete 'patch-/sys/firmware/efi-out)
(add-after 'patch-stuff 'use-absolute-efibootmgr-path
(lambda* (#:key inputs #:allow-other-keys)
(substitute* "grub-core/osdep/unix/platform.c"
Debbugs is free software and licensed under the terms of the
GNU Public License version 2. The current version can be
obtained from https://bugs.debian.org/debbugs-source/.