GNU bug report logs - #30311
efi-less grub install fails

Previous Next

Package: guix;

Reported by: Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>

Date: Wed, 31 Jan 2018 18:57:02 UTC

Severity: important

To reply to this bug, email your comments to 30311 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#30311; Package guix. (Wed, 31 Jan 2018 18:57:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Wed, 31 Jan 2018 18:57:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>
To: <bug-guix <at> gnu.org>
Subject: efi-less grub install fails
Date: Wed, 31 Jan 2018 19:55:58 +0100
“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 <at> gnu.org:
bug#30311; Package guix. (Wed, 31 Jan 2018 23:35:02 GMT) Full text and rfc822 format available.

Message #8 received at 30311 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>
Cc: 30311 <at> debbugs.gnu.org
Subject: Re: bug#30311: efi-less grub install fails
Date: Thu, 1 Feb 2018 00:34:14 +0100
Hi Ricardo,

On Wed, 31 Jan 2018 19:55:58 +0100
Ricardo Wurmus <ricardo.wurmus <at> 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 <at> gnu.org:
bug#30311; Package guix. (Wed, 31 Jan 2018 23:56:01 GMT) Full text and rfc822 format available.

Message #11 received at 30311 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>
Cc: Danny Milosavljevic <dannym <at> scratchpost.org>,
 Marius Bakke <mbakke <at> fastmail.com>, 30311 <at> debbugs.gnu.org
Subject: Re: bug#30311: efi-less grub install fails
Date: Thu, 01 Feb 2018 00:55:29 +0100
Heya,

Ricardo Wurmus <ricardo.wurmus <at> 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 <at> gnu.org:
bug#30311; Package guix. (Thu, 01 Feb 2018 12:41:02 GMT) Full text and rfc822 format available.

Message #14 received at 30311 <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <mbakke <at> fastmail.com>
To: Danny Milosavljevic <dannym <at> scratchpost.org>,
 Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>
Cc: 30311 <at> debbugs.gnu.org
Subject: Re: bug#30311: efi-less grub install fails
Date: Thu, 01 Feb 2018 13:40:22 +0100
[Message part 1 (text/plain, inline)]
Danny Milosavljevic <dannym <at> scratchpost.org> writes:

> Hi Ricardo,
>
> On Wed, 31 Jan 2018 19:55:58 +0100
> Ricardo Wurmus <ricardo.wurmus <at> 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.
[signature.asc (application/pgp-signature, inline)]

Severity set to 'important' from 'normal' Request was from ludo <at> gnu.org (Ludovic Courtès) to control <at> debbugs.gnu.org. (Tue, 06 Feb 2018 16:06:02 GMT) Full text and rfc822 format available.

Reply sent to Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>:
You have taken responsibility. (Sun, 18 Feb 2018 11:29:02 GMT) Full text and rfc822 format available.

Notification sent to Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>:
bug acknowledged by developer. (Sun, 18 Feb 2018 11:29:04 GMT) Full text and rfc822 format available.

Message #21 received at 30311-done <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>
To: Marius Bakke <mbakke <at> fastmail.com>
Cc: Danny Milosavljevic <dannym <at> scratchpost.org>, 30311-done <at> debbugs.gnu.org
Subject: Re: bug#30311: efi-less grub install fails
Date: Sun, 18 Feb 2018 12:28:13 +0100
Marius Bakke <mbakke <at> fastmail.com> writes:

> Danny Milosavljevic <dannym <at> scratchpost.org> writes:
>
>> Hi Ricardo,
>>
>> On Wed, 31 Jan 2018 19:55:58 +0100
>> Ricardo Wurmus <ricardo.wurmus <at> 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 <at> gnu.org:
bug#30311; Package guix. (Sun, 18 Feb 2018 16:22:02 GMT) Full text and rfc822 format available.

Message #24 received at 30311 <at> debbugs.gnu.org (full text, mbox):

From: Mark H Weaver <mhw <at> netris.org>
To: 30311 <at> debbugs.gnu.org
Cc: Danny Milosavljevic <dannym <at> scratchpost.org>,
 Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>
Subject: Re: bug#30311: efi-less grub install fails
Date: Sun, 18 Feb 2018 11:20:40 -0500
reopen 30311
thanks

Hi Ricardo,

Ricardo Wurmus <ricardo.wurmus <at> 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 <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 18 Feb 2018 16:22:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-guix <at> gnu.org:
bug#30311; Package guix. (Sun, 18 Feb 2018 16:50:02 GMT) Full text and rfc822 format available.

Message #29 received at 30311 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: Mark H Weaver <mhw <at> netris.org>
Cc: Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>, 30311 <at> debbugs.gnu.org
Subject: Re: bug#30311: efi-less grub install fails
Date: Sun, 18 Feb 2018 17:49:22 +0100
[Message part 1 (text/plain, inline)]
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.
[0001-gnu-grub-Make-sure-that-non-EFI-grub-doesn-t-try-to-.patch (text/x-patch, attachment)]

Information forwarded to bug-guix <at> gnu.org:
bug#30311; Package guix. (Tue, 20 Feb 2018 03:23:01 GMT) Full text and rfc822 format available.

Message #32 received at 30311 <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <mbakke <at> fastmail.com>
To: Mark H Weaver <mhw <at> netris.org>, 30311 <at> debbugs.gnu.org
Cc: Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>
Subject: Re: bug#30311: efi-less grub install fails
Date: Tue, 20 Feb 2018 04:21:57 +0100
[Message part 1 (text/plain, inline)]
Mark H Weaver <mhw <at> netris.org> writes:

> Hi Ricardo,
>
> Ricardo Wurmus <ricardo.wurmus <at> 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.

[0001-gnu-Pass-target-to-EFI-less-GRUB-only-when-EFI-varia.patch (text/x-patch, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#30311; Package guix. (Tue, 20 Feb 2018 03:47:02 GMT) Full text and rfc822 format available.

Message #35 received at 30311 <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <mbakke <at> fastmail.com>
To: Mark H Weaver <mhw <at> netris.org>, 30311 <at> debbugs.gnu.org
Cc: Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>
Subject: Re: bug#30311: efi-less grub install fails
Date: Tue, 20 Feb 2018 04:46:22 +0100
[Message part 1 (text/plain, inline)]
Marius Bakke <mbakke <at> fastmail.com> writes:

> Mark H Weaver <mhw <at> netris.org> writes:
>
>> Hi Ricardo,
>>
>> Ricardo Wurmus <ricardo.wurmus <at> 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).

[0001-gnu-Pass-target-to-EFI-less-GRUB-only-when-EFI-varia.patch (text/x-patch, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#30311; Package guix. (Tue, 20 Feb 2018 20:55:02 GMT) Full text and rfc822 format available.

Message #38 received at 30311 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: Marius Bakke <mbakke <at> fastmail.com>
Cc: Mark H Weaver <mhw <at> netris.org>,
 Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>, 30311 <at> debbugs.gnu.org
Subject: Re: bug#30311: efi-less grub install fails
Date: Tue, 20 Feb 2018 21:54:20 +0100
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 <at> gnu.org:
bug#30311; Package guix. (Tue, 20 Feb 2018 21:01:02 GMT) Full text and rfc822 format available.

Message #41 received at 30311 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: Marius Bakke <mbakke <at> fastmail.com>
Cc: Mark H Weaver <mhw <at> netris.org>,
 Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>, 30311 <at> debbugs.gnu.org
Subject: Re: bug#30311: efi-less grub install fails
Date: Tue, 20 Feb 2018 22:00:11 +0100
Also, grub-hybrid is supposed to use efi so the workaround shouldn't be used with it...

What do you think about my direct grub patch?




Information forwarded to bug-guix <at> gnu.org:
bug#30311; Package guix. (Tue, 20 Feb 2018 21:42:02 GMT) Full text and rfc822 format available.

Message #44 received at 30311 <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <rekado <at> elephly.net>
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: Mark H Weaver <mhw <at> netris.org>,
 Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>, 30311 <at> debbugs.gnu.org
Subject: Re: bug#30311: efi-less grub install fails
Date: Tue, 20 Feb 2018 22:40:35 +0100
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 <at> gnu.org:
bug#30311; Package guix. (Tue, 20 Feb 2018 21:44:01 GMT) Full text and rfc822 format available.

Message #47 received at 30311 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: Ricardo Wurmus <rekado <at> elephly.net>
Cc: Mark H Weaver <mhw <at> netris.org>,
 Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>, 30311 <at> debbugs.gnu.org
Subject: Re: bug#30311: efi-less grub install fails
Date: Tue, 20 Feb 2018 22:43:17 +0100
> 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 <at> gnu.org:
bug#30311; Package guix. (Tue, 20 Feb 2018 21:50:02 GMT) Full text and rfc822 format available.

Message #50 received at 30311 <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <rekado <at> elephly.net>
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: Mark H Weaver <mhw <at> netris.org>,
 Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>, 30311 <at> debbugs.gnu.org
Subject: Re: bug#30311: efi-less grub install fails
Date: Tue, 20 Feb 2018 22:49:19 +0100
Danny Milosavljevic <dannym <at> 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 <at> gnu.org:
bug#30311; Package guix. (Tue, 20 Feb 2018 22:01:01 GMT) Full text and rfc822 format available.

Message #53 received at 30311 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: Ricardo Wurmus <rekado <at> elephly.net>
Cc: Mark H Weaver <mhw <at> netris.org>,
 Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>, 30311 <at> debbugs.gnu.org
Subject: Re: bug#30311: efi-less grub install fails
Date: Tue, 20 Feb 2018 23:00:27 +0100
Hi Ricardo,

On Tue, 20 Feb 2018 22:49:19 +0100
Ricardo Wurmus <rekado <at> 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 <at> gnu.org:
bug#30311; Package guix. (Thu, 22 Feb 2018 15:07:01 GMT) Full text and rfc822 format available.

Message #56 received at 30311 <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <mbakke <at> fastmail.com>
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: Mark H Weaver <mhw <at> netris.org>,
 Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>, 30311 <at> debbugs.gnu.org
Subject: Re: bug#30311: efi-less grub install fails
Date: Thu, 22 Feb 2018 16:06:31 +0100
[Message part 1 (text/plain, inline)]
Danny Milosavljevic <dannym <at> 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'?
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#30311; Package guix. (Thu, 22 Feb 2018 15:48:02 GMT) Full text and rfc822 format available.

Message #59 received at 30311 <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <rekado <at> elephly.net>
To: Marius Bakke <mbakke <at> fastmail.com>
Cc: Danny Milosavljevic <dannym <at> scratchpost.org>,
 Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>, 30311 <at> debbugs.gnu.org
Subject: Re: bug#30311: efi-less grub install fails
Date: Thu, 22 Feb 2018 16:47:13 +0100
Marius Bakke <mbakke <at> 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 <at> gnu.org:
bug#30311; Package guix. (Fri, 23 Feb 2018 11:31:02 GMT) Full text and rfc822 format available.

Message #62 received at 30311 <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <mbakke <at> fastmail.com>
To: Ricardo Wurmus <rekado <at> elephly.net>
Cc: Danny Milosavljevic <dannym <at> scratchpost.org>,
 Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>, 30311 <at> debbugs.gnu.org
Subject: Re: bug#30311: efi-less grub install fails
Date: Fri, 23 Feb 2018 12:30:48 +0100
[Message part 1 (text/plain, inline)]
Ricardo Wurmus <rekado <at> elephly.net> writes:

> Marius Bakke <mbakke <at> 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.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#30311; Package guix. (Mon, 26 Mar 2018 21:17:01 GMT) Full text and rfc822 format available.

Message #65 received at 30311 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: Ricardo Wurmus <rekado <at> elephly.net>
Cc: Mark H Weaver <mhw <at> netris.org>,
 Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>, 30311 <at> debbugs.gnu.org
Subject: Re: bug#30311: efi-less grub install fails
Date: Mon, 26 Mar 2018 23:15:45 +0200
[Message part 1 (text/plain, inline)]
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 <at> 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"
[Message part 2 (application/pgp-signature, inline)]

This bug report was last modified 6 years and 32 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.