Re: [PATCH 6/6] gnu: Add grub-efi.

2017-01-04 Thread Ludovic Courtès
Chris Marusich  skribis:

> l...@gnu.org (Ludovic Courtès) writes:
>
>> Howdy!
>>
>> There I typed at the GRUB command prompt:
>>
>>   insmod efi_gop
>>   insmod efi_uga
>>   cat /var/guix/gcroots/grub.cfg
>
> Slightly off-topic question: how does one find out what the possible
> values for X are in a command like "insmod X"?  I've searched before and
> I couldn't find a list in the manual, so I presume it's something you
> have to "just know" at runtime, somehow.

Yeah, I run “ls /boot/grub/x86_64-efi” too.  :-)

>> and typed the ‘search.file’, ‘linux’, and ‘initrd’ that appear
>> ‘grub.cfg’ (“source /…/grub.cfg” did not work.)
>>
>> That actually booted GuixSD.  This time it had /sys/firmware/efi.  Thus
>> I re-run ‘grub-install’ from there and upon reboot, the thing would
>> immediately boot GRUB!  \o/
>>
>> I still need to sort out a few shenanigans but I’m getting there.
>
> Sweet!  I've been tentatively following this thread; glad to see you're
> making progress.

So the last bit was to add this to ‘file-systems’:

  (file-system
(title 'device)
(device "/dev/sda1")
(mount-point "/boot/efi")
(type "vfat")
(check? #f))   ;work around lack of fsck support for vfat

That allows ‘grub-install’ to do its thing when I run ‘guix system
reconfigure’.

Essentially, what remains to be done is:

  1. fsck support for vfat (discussed with David C. and Marius);
  2. produce an EFI installation image;
  3. document it, add an example config probably.

Ludo’.



Re: [PATCH 6/6] gnu: Add grub-efi.

2017-01-03 Thread Chris Marusich
l...@gnu.org (Ludovic Courtès) writes:

> Howdy!
>
> There I typed at the GRUB command prompt:
>
>   insmod efi_gop
>   insmod efi_uga
>   cat /var/guix/gcroots/grub.cfg

Slightly off-topic question: how does one find out what the possible
values for X are in a command like "insmod X"?  I've searched before and
I couldn't find a list in the manual, so I presume it's something you
have to "just know" at runtime, somehow.

> and typed the ‘search.file’, ‘linux’, and ‘initrd’ that appear
> ‘grub.cfg’ (“source /…/grub.cfg” did not work.)
>
> That actually booted GuixSD.  This time it had /sys/firmware/efi.  Thus
> I re-run ‘grub-install’ from there and upon reboot, the thing would
> immediately boot GRUB!  \o/
>
> I still need to sort out a few shenanigans but I’m getting there.

Sweet!  I've been tentatively following this thread; glad to see you're
making progress.

-- 
Chris


signature.asc
Description: PGP signature


Re: [PATCH 6/6] gnu: Add grub-efi.

2017-01-03 Thread Ludovic Courtès
Howdy!

l...@gnu.org (Ludovic Courtès) skribis:

> Marius Bakke  skribis:
>
 OK. I'll try to find out why tests don't work with the UEFI variant
 first in order to at least write a meaningful comment. Maybe qemu needs
 UEFI support or something like that.
>>>
>>> It might be that we no longer need QEMU 1.3.1 to run the tests (see the
>>> top of gnu/packages/grub.scm)?
>>
>> The problem is missing UEFI firmware for the qemu calls. But we indeed
>> no longer need qemu@1.3.1 for the tests, at least on x86_64. I replaced
>> it with 'qemu-minimal'. Pushed!
>
> Great!
>
> I’m failing at installing GuixSD on a new laptop I have here.
> ‘efibootmgr’ exits with code 2 and this message:
>
>   EFI variables are not supported on this system.
>
> (which ‘grub-install’ happily ignores.)
>
> This is because /sys/firmware/efi is missing, which apparently is
> because I booted off the GuixSD USB image (“legacy”) and not in EFI
> mode.

So it turns out that GRUB was properly installed in the EFI partition,
but the effect of the efivar failure above was that the computer would
not boot it automatically.

I found a “Boot from file” menu entry in HP’s BIOS, under “EFI boot”,
and from there I could select ‘grubx64.efi’ and boot GRUB.

There I typed at the GRUB command prompt:

  insmod efi_gop
  insmod efi_uga
  cat /var/guix/gcroots/grub.cfg

and typed the ‘search.file’, ‘linux’, and ‘initrd’ that appear
‘grub.cfg’ (“source /…/grub.cfg” did not work.)

That actually booted GuixSD.  This time it had /sys/firmware/efi.  Thus
I re-run ‘grub-install’ from there and upon reboot, the thing would
immediately boot GRUB!  \o/

I still need to sort out a few shenanigans but I’m getting there.

To be continued…

Ludo’.



Re: [PATCH 6/6] gnu: Add grub-efi.

2016-12-21 Thread Danny Milosavljevic
Hi,

efibootmgr is trying to add an entry for Linux to the EFI bootmanager and set 
the boot priority order. It won't usefully autoboot without it. That said, 
depending on how good the UEFI implementation on your laptop is you might be 
able to hit a function key on POST and select the image file manually. (There 
has to be a FAT partition which is supposed to contain all the things that the 
bootloader can boot)

The problem is when you boot in legacy BIOS mode you don't have UEFI 
functionality available, including the calls that would modify the boot order 
and boot menu.

The best way would to also boot the GuixSD USB image via UEFI and not MBR. I 
think all you need for that is the image file on the USB stick on a FAT 
partition under \EFI\BOOT\BOOTX64.EFI . So it should be easy to have a dual ISO 
image.

That said, I only have Libreboot personally so I can't help much with it. I 
just had to fix UEFI problems for a customer of mine (two months ago) so it's 
still fresh in my mind.

Note that many UEFI setups have a "Lock Boot Order" option. Make sure it's not 
locked, otherwise it doesn't matter what efibootmgr does - it will just be 
cleared on next reboot.



Re: [PATCH 6/6] gnu: Add grub-efi.

2016-12-21 Thread Ludovic Courtès
Marius Bakke  skribis:

> Ludovic Courtès  writes:

[...]

 I’m failing at installing GuixSD on a new laptop I have here.
 ‘efibootmgr’ exits with code 2 and this message:

   EFI variables are not supported on this system.

 (which ‘grub-install’ happily ignores.)

 This is because /sys/firmware/efi is missing, which apparently is
 because I booted off the GuixSD USB image (“legacy”) and not in EFI
 mode.

 What would you suggest?  :-)
>>>
>>> What I did was a normal BIOS install, backup the grub.cfg, switch laptop
>>> to UEFI (only) and boot a Debian live CD. From there "apt-get install
>>> grub-efi; grub-install /dev/sda" and afterwards copy grub.cfg in place.
>>>
>>> You may want to add "insmod efi_gop" and "insmod efi_uga" to grub.cfg,
>>> otherwise you won't get a framebuffer until the proper video driver is
>>> loaded (which may require unlocking root partition etc).
>>
>> Wait, all I need is /sys/firmware/efi in the install image.  Is it
>> impossible?
>
> Perhaps you can trick Linux into creating it without booting UEFI mode.
> Not sure if grub/efibootmgr actually need to read or write there.

‘efivar’ (used by ‘efibootmgr’) uses it, and otherwise bails out with
the error message shown above.

Thanks,
Ludo’.



Re: [PATCH 6/6] gnu: Add grub-efi.

2016-12-20 Thread Marius Bakke
Ludovic Courtès  writes:

> Marius Bakke  skribis:
>
>> Ludovic Courtès  writes:
>>
>>> Hello!
>>>
>>> Marius Bakke  skribis:
>>>
>> OK. I'll try to find out why tests don't work with the UEFI variant
>> first in order to at least write a meaningful comment. Maybe qemu needs
>> UEFI support or something like that.
>
> It might be that we no longer need QEMU 1.3.1 to run the tests (see the
> top of gnu/packages/grub.scm)?

 The problem is missing UEFI firmware for the qemu calls. But we indeed
 no longer need qemu@1.3.1 for the tests, at least on x86_64. I replaced
 it with 'qemu-minimal'. Pushed!
>>>
>>> Great!
>>>
>>> I’m failing at installing GuixSD on a new laptop I have here.
>>> ‘efibootmgr’ exits with code 2 and this message:
>>>
>>>   EFI variables are not supported on this system.
>>>
>>> (which ‘grub-install’ happily ignores.)
>>>
>>> This is because /sys/firmware/efi is missing, which apparently is
>>> because I booted off the GuixSD USB image (“legacy”) and not in EFI
>>> mode.
>>>
>>> What would you suggest?  :-)
>>
>> What I did was a normal BIOS install, backup the grub.cfg, switch laptop
>> to UEFI (only) and boot a Debian live CD. From there "apt-get install
>> grub-efi; grub-install /dev/sda" and afterwards copy grub.cfg in place.
>>
>> You may want to add "insmod efi_gop" and "insmod efi_uga" to grub.cfg,
>> otherwise you won't get a framebuffer until the proper video driver is
>> loaded (which may require unlocking root partition etc).
>
> Wait, all I need is /sys/firmware/efi in the install image.  Is it
> impossible?

Perhaps you can trick Linux into creating it without booting UEFI mode.
Not sure if grub/efibootmgr actually need to read or write there.

>> Not the most user friendly installation instructions! I'm researching
>> methods to make the base install image hybrid BIOS/UEFI.
>
> What would it take?

The scripts I've looked at so far seems to use ISOLINUX as the initial
bootloader and then chainload to grub. Didn't experiment much, haven't
been able to get syslinux packaged yet.

It's *probably* possible do it with grub only, by partitioning the
installation image and create both a "bios_grub" GPT partition and an
EFI system partition and install to both with a different --target.


signature.asc
Description: PGP signature


Re: [PATCH 6/6] gnu: Add grub-efi.

2016-12-20 Thread Ludovic Courtès
Marius Bakke  skribis:

> Ludovic Courtès  writes:
>
>> Hello!
>>
>> Marius Bakke  skribis:
>>
> OK. I'll try to find out why tests don't work with the UEFI variant
> first in order to at least write a meaningful comment. Maybe qemu needs
> UEFI support or something like that.

 It might be that we no longer need QEMU 1.3.1 to run the tests (see the
 top of gnu/packages/grub.scm)?
>>>
>>> The problem is missing UEFI firmware for the qemu calls. But we indeed
>>> no longer need qemu@1.3.1 for the tests, at least on x86_64. I replaced
>>> it with 'qemu-minimal'. Pushed!
>>
>> Great!
>>
>> I’m failing at installing GuixSD on a new laptop I have here.
>> ‘efibootmgr’ exits with code 2 and this message:
>>
>>   EFI variables are not supported on this system.
>>
>> (which ‘grub-install’ happily ignores.)
>>
>> This is because /sys/firmware/efi is missing, which apparently is
>> because I booted off the GuixSD USB image (“legacy”) and not in EFI
>> mode.
>>
>> What would you suggest?  :-)
>
> What I did was a normal BIOS install, backup the grub.cfg, switch laptop
> to UEFI (only) and boot a Debian live CD. From there "apt-get install
> grub-efi; grub-install /dev/sda" and afterwards copy grub.cfg in place.
>
> You may want to add "insmod efi_gop" and "insmod efi_uga" to grub.cfg,
> otherwise you won't get a framebuffer until the proper video driver is
> loaded (which may require unlocking root partition etc).

Wait, all I need is /sys/firmware/efi in the install image.  Is it
impossible?

> Not the most user friendly installation instructions! I'm researching
> methods to make the base install image hybrid BIOS/UEFI.

What would it take?

Woow, I didn’t expect UEFI to be that much of a pain.  :-/

Ludo’.



Re: [PATCH 6/6] gnu: Add grub-efi.

2016-12-20 Thread Marius Bakke
Ludovic Courtès  writes:

> Hello!
>
> Marius Bakke  skribis:
>
 OK. I'll try to find out why tests don't work with the UEFI variant
 first in order to at least write a meaningful comment. Maybe qemu needs
 UEFI support or something like that.
>>>
>>> It might be that we no longer need QEMU 1.3.1 to run the tests (see the
>>> top of gnu/packages/grub.scm)?
>>
>> The problem is missing UEFI firmware for the qemu calls. But we indeed
>> no longer need qemu@1.3.1 for the tests, at least on x86_64. I replaced
>> it with 'qemu-minimal'. Pushed!
>
> Great!
>
> I’m failing at installing GuixSD on a new laptop I have here.
> ‘efibootmgr’ exits with code 2 and this message:
>
>   EFI variables are not supported on this system.
>
> (which ‘grub-install’ happily ignores.)
>
> This is because /sys/firmware/efi is missing, which apparently is
> because I booted off the GuixSD USB image (“legacy”) and not in EFI
> mode.
>
> What would you suggest?  :-)

What I did was a normal BIOS install, backup the grub.cfg, switch laptop
to UEFI (only) and boot a Debian live CD. From there "apt-get install
grub-efi; grub-install /dev/sda" and afterwards copy grub.cfg in place.

You may want to add "insmod efi_gop" and "insmod efi_uga" to grub.cfg,
otherwise you won't get a framebuffer until the proper video driver is
loaded (which may require unlocking root partition etc).

Not the most user friendly installation instructions! I'm researching
methods to make the base install image hybrid BIOS/UEFI.

Once booted, you should apply the following two patches when
reconfiguring the system. I think they are safe for BIOS systems too,
but haven't done extensive testing.



signature.asc
Description: PGP signature
>From fa12cd92a2e4eead22f640d6231813e50b8191bf Mon Sep 17 00:00:00 2001
From: Marius Bakke 
Date: Sun, 6 Nov 2016 17:26:06 +
Subject: [PATCH 1/2] build: Make grub-install command UEFI aware.

* gnu/build/install.scm (install-grub): Extend grub-install command with
'--bootloader-id' and '--efi-directory'.
---
 gnu/build/install.scm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gnu/build/install.scm b/gnu/build/install.scm
index 5c2b35632..ddd95bbf6 100644
--- a/gnu/build/install.scm
+++ b/gnu/build/install.scm
@@ -54,6 +54,9 @@ GC'd."
   (unless (zero? (system* "grub-install" "--no-floppy"
   "--boot-directory"
   (string-append mount-point "/boot")
+			  "--bootloader-id=GNU"
+			  "--efi-directory"
+  (string-append mount-point "/boot")
   device))
 (error "failed to install GRUB")))
 
-- 
2.11.0

>From dd71d9b334ceccc09cd42484c6deac2079c44c70 Mon Sep 17 00:00:00 2001
From: Marius Bakke 
Date: Mon, 7 Nov 2016 12:24:01 +
Subject: [PATCH 2/2] system: Load efi modules in grub.cfg.

* gnu/system/grub.scm (eye-candy): Load 'efi_gop' and 'efi_uga' grub modules.
---
 gnu/system/grub.scm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gnu/system/grub.scm b/gnu/system/grub.scm
index 4657b06b5..9477b2494 100644
--- a/gnu/system/grub.scm
+++ b/gnu/system/grub.scm
@@ -183,6 +183,8 @@ system string---e.g., \"x86_64-linux\"."
 (if (string-match "^(x86_64|i[3-6]86)-" system)
 "
   # Leave 'gfxmode' to 'auto'.
+  insmod efi_gop
+  insmod efi_uga
   insmod vbe
   insmod vga
   insmod video_bochs
-- 
2.11.0



Re: [PATCH 6/6] gnu: Add grub-efi.

2016-12-20 Thread Ludovic Courtès
Hello!

Marius Bakke  skribis:

>>> OK. I'll try to find out why tests don't work with the UEFI variant
>>> first in order to at least write a meaningful comment. Maybe qemu needs
>>> UEFI support or something like that.
>>
>> It might be that we no longer need QEMU 1.3.1 to run the tests (see the
>> top of gnu/packages/grub.scm)?
>
> The problem is missing UEFI firmware for the qemu calls. But we indeed
> no longer need qemu@1.3.1 for the tests, at least on x86_64. I replaced
> it with 'qemu-minimal'. Pushed!

Great!

I’m failing at installing GuixSD on a new laptop I have here.
‘efibootmgr’ exits with code 2 and this message:

  EFI variables are not supported on this system.

(which ‘grub-install’ happily ignores.)

This is because /sys/firmware/efi is missing, which apparently is
because I booted off the GuixSD USB image (“legacy”) and not in EFI
mode.

What would you suggest?  :-)

TIA,
Ludo’.



Re: [PATCH 6/6] gnu: Add grub-efi.

2016-12-19 Thread Marius Bakke
Ludovic Courtès  writes:

> Marius Bakke  skribis:
>
>> Ludovic Courtès  writes:
>>
>>> Hi Marius,
>>>
>>> Marius Bakke  skribis:
>>>
 Ludovic Courtès  writes:

>> Relatedly, I think the way to build a 'multi-grub' is to have one
>> expression for each supported grub platform, and then consolidate
>> out/lib/grub from each.
>
> So in essence, GRUB itself supports only one platform at a time?

 AFAICT yes. Gentoo works around this by running the build for each
 user-specified platform and combining the outputs. Most other distros
 just carry separate grub-pc and grub-efi packages.

>>> Now there are things I didn’t quite get.  Apparently you’re supposed to
>>> have a /boot/efi as a vfat partition, and ‘grub-install’ is supposed to
>>> detect it and install the EFI stuff, or so I thought (info "(grub)
>>> Installing GRUB using grub-install").
>>>
>>> However, ‘grub-install’ still seems to be installing for “i386-pc”
>>> instead of EFI.
>>>
>>> What am I missing?
>>
>> IIRC grub-install will detect and install for the running mode (pc, efi,
>> etc). So in a classic chicken-and-egg situation, you need to be booted
>> with UEFI mode for grub to select the correct installation platform!
>
> My understanding is that it would install for UEFI if it fines
> /boot/efi or if --efi-directory is passed.

 I'm not so sure, but it's been a while since I played around with this.
 At least building the 'gnu/system/install.scm' image works fine when
 passing --efi-directory (see the bottom two patches from
 https://lists.gnu.org/archive/html/guix-devel/2016-12/txtchTym4QVKr.txt ),
 and I think it would choose i386-pc even if x86_64-efi was available
 since the VM boots in BIOS mode.

 Tangentially, I'm not aware of any way to build a "hybrid" ISO image
 using only grub. I've started work on packaging syslinux/isolinux which
 is what Debian uses for their hybrid UEFI/BIOS install image.
>>>
>>> OK.
>>>
>>> Having checked GRUB’s configure.ac etc., I realize that my suggestion of
>>> having one ‘grub’ package doing both EFI and “PC” cannot work.  What you
>>> suggested initially (a separate ‘grub-efi’ package) is the only thing we
>>> can do (we could perhaps merge the lib/grub directories as you
>>> suggested, but it’s not even clear that this would work.)
>>>
>>> Thus, I think we need to revert 3eee16130d858ae96510ec1c7d38d31290de2699
>>> and install your initial ‘grub-efi’ patch.  How does that sound?
>>
>> OK. I'll try to find out why tests don't work with the UEFI variant
>> first in order to at least write a meaningful comment. Maybe qemu needs
>> UEFI support or something like that.
>
> It might be that we no longer need QEMU 1.3.1 to run the tests (see the
> top of gnu/packages/grub.scm)?

The problem is missing UEFI firmware for the qemu calls. But we indeed
no longer need qemu@1.3.1 for the tests, at least on x86_64. I replaced
it with 'qemu-minimal'. Pushed!


signature.asc
Description: PGP signature


Re: [PATCH 6/6] gnu: Add grub-efi.

2016-12-19 Thread Ludovic Courtès
Marius Bakke  skribis:

> Ludovic Courtès  writes:
>
>> Hi Marius,
>>
>> Marius Bakke  skribis:
>>
>>> Ludovic Courtès  writes:
>>>
> Relatedly, I think the way to build a 'multi-grub' is to have one
> expression for each supported grub platform, and then consolidate
> out/lib/grub from each.

 So in essence, GRUB itself supports only one platform at a time?
>>>
>>> AFAICT yes. Gentoo works around this by running the build for each
>>> user-specified platform and combining the outputs. Most other distros
>>> just carry separate grub-pc and grub-efi packages.
>>>
>> Now there are things I didn’t quite get.  Apparently you’re supposed to
>> have a /boot/efi as a vfat partition, and ‘grub-install’ is supposed to
>> detect it and install the EFI stuff, or so I thought (info "(grub)
>> Installing GRUB using grub-install").
>>
>> However, ‘grub-install’ still seems to be installing for “i386-pc”
>> instead of EFI.
>>
>> What am I missing?
>
> IIRC grub-install will detect and install for the running mode (pc, efi,
> etc). So in a classic chicken-and-egg situation, you need to be booted
> with UEFI mode for grub to select the correct installation platform!

 My understanding is that it would install for UEFI if it fines
 /boot/efi or if --efi-directory is passed.
>>>
>>> I'm not so sure, but it's been a while since I played around with this.
>>> At least building the 'gnu/system/install.scm' image works fine when
>>> passing --efi-directory (see the bottom two patches from
>>> https://lists.gnu.org/archive/html/guix-devel/2016-12/txtchTym4QVKr.txt ),
>>> and I think it would choose i386-pc even if x86_64-efi was available
>>> since the VM boots in BIOS mode.
>>>
>>> Tangentially, I'm not aware of any way to build a "hybrid" ISO image
>>> using only grub. I've started work on packaging syslinux/isolinux which
>>> is what Debian uses for their hybrid UEFI/BIOS install image.
>>
>> OK.
>>
>> Having checked GRUB’s configure.ac etc., I realize that my suggestion of
>> having one ‘grub’ package doing both EFI and “PC” cannot work.  What you
>> suggested initially (a separate ‘grub-efi’ package) is the only thing we
>> can do (we could perhaps merge the lib/grub directories as you
>> suggested, but it’s not even clear that this would work.)
>>
>> Thus, I think we need to revert 3eee16130d858ae96510ec1c7d38d31290de2699
>> and install your initial ‘grub-efi’ patch.  How does that sound?
>
> OK. I'll try to find out why tests don't work with the UEFI variant
> first in order to at least write a meaningful comment. Maybe qemu needs
> UEFI support or something like that.

It might be that we no longer need QEMU 1.3.1 to run the tests (see the
top of gnu/packages/grub.scm)?

Ludo’.



Re: [PATCH 6/6] gnu: Add grub-efi.

2016-12-19 Thread Marius Bakke
Ludovic Courtès  writes:

> Hi Marius,
>
> Marius Bakke  skribis:
>
>> Ludovic Courtès  writes:
>>
 Relatedly, I think the way to build a 'multi-grub' is to have one
 expression for each supported grub platform, and then consolidate
 out/lib/grub from each.
>>>
>>> So in essence, GRUB itself supports only one platform at a time?
>>
>> AFAICT yes. Gentoo works around this by running the build for each
>> user-specified platform and combining the outputs. Most other distros
>> just carry separate grub-pc and grub-efi packages.
>>
> Now there are things I didn’t quite get.  Apparently you’re supposed to
> have a /boot/efi as a vfat partition, and ‘grub-install’ is supposed to
> detect it and install the EFI stuff, or so I thought (info "(grub)
> Installing GRUB using grub-install").
>
> However, ‘grub-install’ still seems to be installing for “i386-pc”
> instead of EFI.
>
> What am I missing?

 IIRC grub-install will detect and install for the running mode (pc, efi,
 etc). So in a classic chicken-and-egg situation, you need to be booted
 with UEFI mode for grub to select the correct installation platform!
>>>
>>> My understanding is that it would install for UEFI if it fines
>>> /boot/efi or if --efi-directory is passed.
>>
>> I'm not so sure, but it's been a while since I played around with this.
>> At least building the 'gnu/system/install.scm' image works fine when
>> passing --efi-directory (see the bottom two patches from
>> https://lists.gnu.org/archive/html/guix-devel/2016-12/txtchTym4QVKr.txt ),
>> and I think it would choose i386-pc even if x86_64-efi was available
>> since the VM boots in BIOS mode.
>>
>> Tangentially, I'm not aware of any way to build a "hybrid" ISO image
>> using only grub. I've started work on packaging syslinux/isolinux which
>> is what Debian uses for their hybrid UEFI/BIOS install image.
>
> OK.
>
> Having checked GRUB’s configure.ac etc., I realize that my suggestion of
> having one ‘grub’ package doing both EFI and “PC” cannot work.  What you
> suggested initially (a separate ‘grub-efi’ package) is the only thing we
> can do (we could perhaps merge the lib/grub directories as you
> suggested, but it’s not even clear that this would work.)
>
> Thus, I think we need to revert 3eee16130d858ae96510ec1c7d38d31290de2699
> and install your initial ‘grub-efi’ patch.  How does that sound?

OK. I'll try to find out why tests don't work with the UEFI variant
first in order to at least write a meaningful comment. Maybe qemu needs
UEFI support or something like that.


signature.asc
Description: PGP signature


Re: [PATCH 6/6] gnu: Add grub-efi.

2016-12-19 Thread Ludovic Courtès
Hi Marius,

Marius Bakke  skribis:

> Ludovic Courtès  writes:
>
>>> Relatedly, I think the way to build a 'multi-grub' is to have one
>>> expression for each supported grub platform, and then consolidate
>>> out/lib/grub from each.
>>
>> So in essence, GRUB itself supports only one platform at a time?
>
> AFAICT yes. Gentoo works around this by running the build for each
> user-specified platform and combining the outputs. Most other distros
> just carry separate grub-pc and grub-efi packages.
>
 Now there are things I didn’t quite get.  Apparently you’re supposed to
 have a /boot/efi as a vfat partition, and ‘grub-install’ is supposed to
 detect it and install the EFI stuff, or so I thought (info "(grub)
 Installing GRUB using grub-install").

 However, ‘grub-install’ still seems to be installing for “i386-pc”
 instead of EFI.

 What am I missing?
>>>
>>> IIRC grub-install will detect and install for the running mode (pc, efi,
>>> etc). So in a classic chicken-and-egg situation, you need to be booted
>>> with UEFI mode for grub to select the correct installation platform!
>>
>> My understanding is that it would install for UEFI if it fines
>> /boot/efi or if --efi-directory is passed.
>
> I'm not so sure, but it's been a while since I played around with this.
> At least building the 'gnu/system/install.scm' image works fine when
> passing --efi-directory (see the bottom two patches from
> https://lists.gnu.org/archive/html/guix-devel/2016-12/txtchTym4QVKr.txt ),
> and I think it would choose i386-pc even if x86_64-efi was available
> since the VM boots in BIOS mode.
>
> Tangentially, I'm not aware of any way to build a "hybrid" ISO image
> using only grub. I've started work on packaging syslinux/isolinux which
> is what Debian uses for their hybrid UEFI/BIOS install image.

OK.

Having checked GRUB’s configure.ac etc., I realize that my suggestion of
having one ‘grub’ package doing both EFI and “PC” cannot work.  What you
suggested initially (a separate ‘grub-efi’ package) is the only thing we
can do (we could perhaps merge the lib/grub directories as you
suggested, but it’s not even clear that this would work.)

Thus, I think we need to revert 3eee16130d858ae96510ec1c7d38d31290de2699
and install your initial ‘grub-efi’ patch.  How does that sound?

If that’s fine with you, please go ahead.

Apologies for the misguided suggestion!

>> The remaining issue is how to run fsck for vfat.
>>
>> Currently I still have a preference for something like what I suggested
>> at:
>>
>>   https://lists.gnu.org/archive/html/guix-devel/2016-12/msg00095.html
>>
>> Thoughts?
>
> This approach looks better than the one I started working on. It's not
> clear to me how to pass the device to these procedures, or how
> 'check-file-system' will know which checker to use. We should try to
> have this in place before 0.13 :-)

I’ll see if I can work on it if nobody beats me at it!

Thank you!

Ludo’.



Re: [PATCH 6/6] gnu: Add grub-efi.

2016-12-18 Thread Ludovic Courtès
Hello Marius!

Marius Bakke  skribis:

> Ludovic Courtès  writes:

[...]

>> It turns out I have an immediate need ;-), so I pushed this as commit
>> 3eee16130d858ae96510ec1c7d38d31290de2699.  Let me know if that doesn’t
>> seem right!
>
> I think you need to compile with '--with-platform=efi' as well.

Bah, silly me.

> Check /gnu/store/...grub-.../lib/grub. I still use a custom 'grub-efi'
> expression (attached, needs adaption to 3eee16). Otherwise grub won't
> have the required install files, even if it could detect the platform.
>
> Relatedly, I think the way to build a 'multi-grub' is to have one
> expression for each supported grub platform, and then consolidate
> out/lib/grub from each.

So in essence, GRUB itself supports only one platform at a time?

>> Now there are things I didn’t quite get.  Apparently you’re supposed to
>> have a /boot/efi as a vfat partition, and ‘grub-install’ is supposed to
>> detect it and install the EFI stuff, or so I thought (info "(grub)
>> Installing GRUB using grub-install").
>>
>> However, ‘grub-install’ still seems to be installing for “i386-pc”
>> instead of EFI.
>>
>> What am I missing?
>
> IIRC grub-install will detect and install for the running mode (pc, efi,
> etc). So in a classic chicken-and-egg situation, you need to be booted
> with UEFI mode for grub to select the correct installation platform!

My understanding is that it would install for UEFI if it fines
/boot/efi or if --efi-directory is passed.

BTW, as far as I’m concerned, most of the other patches are ready:

  https://lists.gnu.org/archive/html/guix-devel/2016-11/msg00303.html
  https://lists.gnu.org/archive/html/guix-devel/2016-11/msg00304.html

Could you push them?

The remaining issue is how to run fsck for vfat.

Currently I still have a preference for something like what I suggested
at:

  https://lists.gnu.org/archive/html/guix-devel/2016-12/msg00095.html

Thoughts?

Thanks!

Ludo’.



Re: [PATCH 6/6] gnu: Add grub-efi.

2016-12-17 Thread Marius Bakke

> For anyone following along at home, I've attached the patches I'm using
> for UEFI GuixSD. The latter two probably won't work properly on a
> non-UEFI system, needs testing.

Never mind the last part, 'guix system vm-image' works fine with these
patches.


signature.asc
Description: PGP signature


Re: [PATCH 6/6] gnu: Add grub-efi.

2016-12-17 Thread Marius Bakke
Ludovic Courtès  writes:

> Hi Marius,
>
> Marius Bakke  skribis:
>
>> Ludovic Courtès  writes:
>>
>> From 940c03c7dcddec019e27f6eb1470aeab4db57799 Mon Sep 17 00:00:00 2001
>> From: Marius Bakke 
>> Date: Thu, 20 Oct 2016 17:26:52 +0100
>> Subject: [PATCH] gnu: Add grub-efi.
>>
>> * gnu/packages/grub.scm (grub-efi): New variable.
>
> [...]
>
>> +(name "grub-efi")
>> +(synopsis (string-append (package-synopsis grub) " (UEFI version)"))
>
> Please use a literal string for ‘synopsis’; use of ‘string-append’ like
> this prevents i18n.
>
>> + `(#:tests? #f ; FIXME: 40 failures, 24 skipped, 17 passed.
>
> It would be good to investigate, especially if the tests pass in the
> ‘grub’ package.
>
> Also, what’s the rationale for making ‘grub-efi’ separate instead of
> incorporating the changes in ‘grub’ proper?  Are there issues around the
> portability of ‘efibootmgr’, or an increased closure size?

 This is a good point. The only difference with "--with-platform=efi" is
 that another directory is created in place of the i386-pc directory. It
 is perfectly possible to build multiple platforms and copying the
 platform-specific stuff to $out/lib -- grub will pick the correct
 platform at runtime. This is what the Gentoo ebuild does.
>>>
>>> Are you saying that a GRUB compiled with UEFI support will no longer
>>> work out-of-the-box on non-UEFI machines, unless platform-specific stuff
>>> is moved like you suggest?
>>
>> Ha, no, it was just a long-winded and intoxicated way of saying what you
>> proposed should work fine. :)
>
> It turns out I have an immediate need ;-), so I pushed this as commit
> 3eee16130d858ae96510ec1c7d38d31290de2699.  Let me know if that doesn’t
> seem right!
>
> Now there are things I didn’t quite get.  Apparently you’re supposed to
> have a /boot/efi as a vfat partition, and ‘grub-install’ is supposed to
> detect it and install the EFI stuff, or so I thought (info "(grub)
> Installing GRUB using grub-install").
>
> However, ‘grub-install’ still seems to be installing for “i386-pc”
> instead of EFI.
>
> What am I missing?

For anyone following along at home, I've attached the patches I'm using
for UEFI GuixSD. The latter two probably won't work properly on a
non-UEFI system, needs testing.



signature.asc
Description: PGP signature
>From 0a7c923618e8323c684ac8328ea6aa498b8cb13c Mon Sep 17 00:00:00 2001
From: Marius Bakke 
Date: Thu, 3 Nov 2016 09:58:34 +
Subject: [PATCH 1/5] linux-initrd: Support FAT filesystems.

* gnu/system/linux-initrd.scm (base-initrd): When a FAT filesystem is
present: Add fatfsck/static in 'helper-packages'; and add nls_iso8859-1
in 'linux-modules'.
---
 gnu/system/linux-initrd.scm | 9 +
 1 file changed, 9 insertions(+)

diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm
index 174239a56..a787072ba 100644
--- a/gnu/system/linux-initrd.scm
+++ b/gnu/system/linux-initrd.scm
@@ -29,6 +29,7 @@
 #:select (derivation->output-path))
   #:use-module (guix modules)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages disk)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages guile)
   #:use-module ((gnu packages make-bootstrap)
@@ -193,6 +194,9 @@ loaded at boot time in the order in which they appear."
   ,@(if (find (file-system-type-predicate "9p") file-systems)
 virtio-9p-modules
 '())
+  ,@(if (find (file-system-type-predicate "vfat") file-systems)
+'("nls_iso8859-1")
+'())
   ,@(if volatile-root?
 '("fuse")
 '())
@@ -205,6 +209,11 @@ loaded at boot time in the order in which they appear."
   file-systems)
 (list e2fsck/static)
 '())
+  ,@(if (find (lambda (fs)
+(string-suffix? "fat" (file-system-type fs)))
+  file-systems)
+(list fatfsck/static)
+'())
   ,@(if volatile-root?
 (list unionfs-fuse/static)
 '(
-- 
2.11.0


>From fbddad884b553b6a70ae4da0ee47f29599958704 Mon Sep 17 00:00:00 2001
From: Marius Bakke 
Date: Thu, 3 Nov 2016 11:08:57 +
Subject: [PATCH 2/5] file-systems: Suppress fsck status completion bar.

* gnu/build/file-systems.scm (check-file-system): Drop "-C" argument
from fsck for compatibility with other fscks.
---
 gnu/build/file-systems.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm
index 431b287d0..b8dbe499d 100644
--- a/gnu/build/file-systems.scm
+++ b/gnu/build/file-systems.scm
@@ -415,7 +415,7 @@ the following:
   (define fsck
 (string-append "fsck." type))
 
-  (let ((status (system* fsck "-v" "-p" "-C" "0" device)))
+  (let 

Re: [PATCH 6/6] gnu: Add grub-efi.

2016-12-16 Thread Marius Bakke
Ludovic Courtès  writes:

> Hi Marius,
>
> Marius Bakke  skribis:
>
>> Ludovic Courtès  writes:
>>
>> From 940c03c7dcddec019e27f6eb1470aeab4db57799 Mon Sep 17 00:00:00 2001
>> From: Marius Bakke 
>> Date: Thu, 20 Oct 2016 17:26:52 +0100
>> Subject: [PATCH] gnu: Add grub-efi.
>>
>> * gnu/packages/grub.scm (grub-efi): New variable.
>
> [...]
>
>> +(name "grub-efi")
>> +(synopsis (string-append (package-synopsis grub) " (UEFI version)"))
>
> Please use a literal string for ‘synopsis’; use of ‘string-append’ like
> this prevents i18n.
>
>> + `(#:tests? #f ; FIXME: 40 failures, 24 skipped, 17 passed.
>
> It would be good to investigate, especially if the tests pass in the
> ‘grub’ package.
>
> Also, what’s the rationale for making ‘grub-efi’ separate instead of
> incorporating the changes in ‘grub’ proper?  Are there issues around the
> portability of ‘efibootmgr’, or an increased closure size?

 This is a good point. The only difference with "--with-platform=efi" is
 that another directory is created in place of the i386-pc directory. It
 is perfectly possible to build multiple platforms and copying the
 platform-specific stuff to $out/lib -- grub will pick the correct
 platform at runtime. This is what the Gentoo ebuild does.
>>>
>>> Are you saying that a GRUB compiled with UEFI support will no longer
>>> work out-of-the-box on non-UEFI machines, unless platform-specific stuff
>>> is moved like you suggest?
>>
>> Ha, no, it was just a long-winded and intoxicated way of saying what you
>> proposed should work fine. :)
>
> It turns out I have an immediate need ;-), so I pushed this as commit
> 3eee16130d858ae96510ec1c7d38d31290de2699.  Let me know if that doesn’t
> seem right!

I think you need to compile with '--with-platform=efi' as well. Check
/gnu/store/...grub-.../lib/grub. I still use a custom 'grub-efi'
expression (attached, needs adaption to 3eee16). Otherwise grub won't
have the required install files, even if it could detect the platform.

Relatedly, I think the way to build a 'multi-grub' is to have one
expression for each supported grub platform, and then consolidate
out/lib/grub from each.

> Now there are things I didn’t quite get.  Apparently you’re supposed to
> have a /boot/efi as a vfat partition, and ‘grub-install’ is supposed to
> detect it and install the EFI stuff, or so I thought (info "(grub)
> Installing GRUB using grub-install").
>
> However, ‘grub-install’ still seems to be installing for “i386-pc”
> instead of EFI.
>
> What am I missing?

IIRC grub-install will detect and install for the running mode (pc, efi,
etc). So in a classic chicken-and-egg situation, you need to be booted
with UEFI mode for grub to select the correct installation platform!

I worked around this by installing grub from a UEFI live CD, copy and
adapt the grub.cfg from an existing (BIOS) GuixSD installation, then
coerce the GuixSD system to use EFI from that point..



signature.asc
Description: PGP signature
>From 1ca87a51f55f0b05f89eed707c1485b94f3d7d16 Mon Sep 17 00:00:00 2001
From: Marius Bakke 
Date: Thu, 20 Oct 2016 17:26:52 +0100
Subject: [PATCH] gnu: Add grub-efi.

* gnu/packages/grub.scm (grub-efi): New variable.
---
 gnu/packages/grub.scm | 23 +++
 1 file changed, 23 insertions(+)

diff --git a/gnu/packages/grub.scm b/gnu/packages/grub.scm
index ef7395e95..1cb835695 100644
--- a/gnu/packages/grub.scm
+++ b/gnu/packages/grub.scm
@@ -164,3 +164,26 @@ on the same computer; upon booting the computer, the user is presented with a
 menu to select one of the installed operating systems.")
 (license gpl3+)
 (properties '((cpe-name . "grub2")
+
+(define-public grub-efi
+  (package
+(inherit grub)
+(name "grub-efi")
+(synopsis (string-append (package-synopsis grub) " (UEFI version)"))
+(inputs
+ `(("efibootmgr" ,efibootmgr)
+   ,@(package-inputs grub)))
+(arguments
+ `(#:tests? #f ; FIXME: 40 failures, 24 skipped, 17 passed.
+   ,@(substitute-keyword-arguments (package-arguments grub)
+   ((#:configure-flags flags) `(cons* "--with-platform=efi"
+  ,flags))
+   ((#:phases phases)
+`(modify-phases ,phases
+   (add-after 'patch-stuff 'use-absolute-efibootmgr-path
+ (lambda* (#:key inputs #:allow-other-keys)
+   (substitute* "grub-core/osdep/unix/platform.c"
+ (("efibootmgr")
+  (string-append (assoc-ref inputs "efibootmgr")
+ "/sbin/efibootmgr")))
+   #t)
-- 
2.11.0



Re: [PATCH 6/6] gnu: Add grub-efi.

2016-12-16 Thread Danny Milosavljevic
Did you add (grub grub-efi) in your  in your system config? 
Or another package with --with-platform=efi ?




Re: [PATCH 6/6] gnu: Add grub-efi.

2016-12-16 Thread Ludovic Courtès
Hi Marius,

Marius Bakke  skribis:

> Ludovic Courtès  writes:
>
> From 940c03c7dcddec019e27f6eb1470aeab4db57799 Mon Sep 17 00:00:00 2001
> From: Marius Bakke 
> Date: Thu, 20 Oct 2016 17:26:52 +0100
> Subject: [PATCH] gnu: Add grub-efi.
>
> * gnu/packages/grub.scm (grub-efi): New variable.

 [...]

> +(name "grub-efi")
> +(synopsis (string-append (package-synopsis grub) " (UEFI version)"))

 Please use a literal string for ‘synopsis’; use of ‘string-append’ like
 this prevents i18n.

> + `(#:tests? #f ; FIXME: 40 failures, 24 skipped, 17 passed.

 It would be good to investigate, especially if the tests pass in the
 ‘grub’ package.

 Also, what’s the rationale for making ‘grub-efi’ separate instead of
 incorporating the changes in ‘grub’ proper?  Are there issues around the
 portability of ‘efibootmgr’, or an increased closure size?
>>>
>>> This is a good point. The only difference with "--with-platform=efi" is
>>> that another directory is created in place of the i386-pc directory. It
>>> is perfectly possible to build multiple platforms and copying the
>>> platform-specific stuff to $out/lib -- grub will pick the correct
>>> platform at runtime. This is what the Gentoo ebuild does.
>>
>> Are you saying that a GRUB compiled with UEFI support will no longer
>> work out-of-the-box on non-UEFI machines, unless platform-specific stuff
>> is moved like you suggest?
>
> Ha, no, it was just a long-winded and intoxicated way of saying what you
> proposed should work fine. :)

It turns out I have an immediate need ;-), so I pushed this as commit
3eee16130d858ae96510ec1c7d38d31290de2699.  Let me know if that doesn’t
seem right!

Now there are things I didn’t quite get.  Apparently you’re supposed to
have a /boot/efi as a vfat partition, and ‘grub-install’ is supposed to
detect it and install the EFI stuff, or so I thought (info "(grub)
Installing GRUB using grub-install").

However, ‘grub-install’ still seems to be installing for “i386-pc”
instead of EFI.

What am I missing?

Thanks!

Ludo’.



Re: [PATCH 6/6] gnu: Add grub-efi.

2016-11-07 Thread Marius Bakke
Ludovic Courtès  writes:

 From 940c03c7dcddec019e27f6eb1470aeab4db57799 Mon Sep 17 00:00:00 2001
 From: Marius Bakke 
 Date: Thu, 20 Oct 2016 17:26:52 +0100
 Subject: [PATCH] gnu: Add grub-efi.

 * gnu/packages/grub.scm (grub-efi): New variable.
>>>
>>> [...]
>>>
 +(name "grub-efi")
 +(synopsis (string-append (package-synopsis grub) " (UEFI version)"))
>>>
>>> Please use a literal string for ‘synopsis’; use of ‘string-append’ like
>>> this prevents i18n.
>>>
 + `(#:tests? #f ; FIXME: 40 failures, 24 skipped, 17 passed.
>>>
>>> It would be good to investigate, especially if the tests pass in the
>>> ‘grub’ package.
>>>
>>> Also, what’s the rationale for making ‘grub-efi’ separate instead of
>>> incorporating the changes in ‘grub’ proper?  Are there issues around the
>>> portability of ‘efibootmgr’, or an increased closure size?
>>
>> This is a good point. The only difference with "--with-platform=efi" is
>> that another directory is created in place of the i386-pc directory. It
>> is perfectly possible to build multiple platforms and copying the
>> platform-specific stuff to $out/lib -- grub will pick the correct
>> platform at runtime. This is what the Gentoo ebuild does.
>
> Are you saying that a GRUB compiled with UEFI support will no longer
> work out-of-the-box on non-UEFI machines, unless platform-specific stuff
> is moved like you suggest?

Ha, no, it was just a long-winded and intoxicated way of saying what you
proposed should work fine. :)

The platform-specific stuff ends up in $out/lib/ by default,
so there won't be any conflicts there, and grub-install will pick the
correct one automatically. That approach is better, I think. Will have a
go at it.

The tricky part is invoking the 'configure, 'build and 'install steps
with appropriate arguments for each platform in the grub expression, but
that does not sound too difficult.



signature.asc
Description: PGP signature


Re: [PATCH 6/6] gnu: Add grub-efi.

2016-11-07 Thread Ludovic Courtès
Marius Bakke  skribis:

> Ludovic Courtès  writes:

[...]

>>> Oops, not sure what went wrong when fixing up this package for
>>> publishing. Updated patch attached.
>>
>> I think Leo was asking whether you could get a bootable system with it.
>
> Yes, I'm using this right now, on top of the recent changes to "guix
> system" :) There are a couple of other changes necessary for proper UEFI
> support: the grub-install command needs "--efi-directory="
> and optionally "--bootloader-id=GNU" (I use these as well, but did not
> publish them, since I haven't tested it on a BIOS system yet, and they
> probably need to be conditional somehow). 

OK, sounds good.  :-)

>>> From 940c03c7dcddec019e27f6eb1470aeab4db57799 Mon Sep 17 00:00:00 2001
>>> From: Marius Bakke 
>>> Date: Thu, 20 Oct 2016 17:26:52 +0100
>>> Subject: [PATCH] gnu: Add grub-efi.
>>>
>>> * gnu/packages/grub.scm (grub-efi): New variable.
>>
>> [...]
>>
>>> +(name "grub-efi")
>>> +(synopsis (string-append (package-synopsis grub) " (UEFI version)"))
>>
>> Please use a literal string for ‘synopsis’; use of ‘string-append’ like
>> this prevents i18n.
>>
>>> + `(#:tests? #f ; FIXME: 40 failures, 24 skipped, 17 passed.
>>
>> It would be good to investigate, especially if the tests pass in the
>> ‘grub’ package.
>>
>> Also, what’s the rationale for making ‘grub-efi’ separate instead of
>> incorporating the changes in ‘grub’ proper?  Are there issues around the
>> portability of ‘efibootmgr’, or an increased closure size?
>
> This is a good point. The only difference with "--with-platform=efi" is
> that another directory is created in place of the i386-pc directory. It
> is perfectly possible to build multiple platforms and copying the
> platform-specific stuff to $out/lib -- grub will pick the correct
> platform at runtime. This is what the Gentoo ebuild does.

Are you saying that a GRUB compiled with UEFI support will no longer
work out-of-the-box on non-UEFI machines, unless platform-specific stuff
is moved like you suggest?

Thanks,
Ludo’.



Re: [PATCH 6/6] gnu: Add grub-efi.

2016-11-06 Thread Marius Bakke
Ludovic Courtès  writes:

> Marius Bakke  skribis:
>
>> Leo Famulari  writes:
>>
>>> On Sat, Nov 05, 2016 at 12:55:11PM +, Marius Bakke wrote:
 * gnu/packages/grub.scm (grub-efi): New variable.
 ---
  gnu/packages/grub.scm | 21 +
  1 file changed, 21 insertions(+)
 
 diff --git a/gnu/packages/grub.scm b/gnu/packages/grub.scm
 index ffce1bf..e06216f 100644
 --- a/gnu/packages/grub.scm
 +++ b/gnu/packages/grub.scm
 @@ -157,3 +157,24 @@ on the same computer; upon booting the computer, the 
 user is presented with a
  menu to select one of the installed operating systems.")
  (license gpl3+)
  (properties '((cpe-name . "grub2")
 +
 +(define-public grub-efi
 +  (package
 +(inherit grub)
 +(name "grub-efi")
 +(synopsis (string-append (package-synopsis grub) " (UEFI version)"))
 +(inputs
 + `(("efibootmgr" ,efibootmgr)
 +   ,@(package-inputs grub)))
 +(arguments
 + #:tests? #f ; FIXME: 40 failures, 24 skipped, 17 passed.
>>>
>>> Does this package work for you?
>>
>> Oops, not sure what went wrong when fixing up this package for
>> publishing. Updated patch attached.
>
> I think Leo was asking whether you could get a bootable system with it.

Yes, I'm using this right now, on top of the recent changes to "guix
system" :) There are a couple of other changes necessary for proper UEFI
support: the grub-install command needs "--efi-directory="
and optionally "--bootloader-id=GNU" (I use these as well, but did not
publish them, since I haven't tested it on a BIOS system yet, and they
probably need to be conditional somehow). 

>> From 940c03c7dcddec019e27f6eb1470aeab4db57799 Mon Sep 17 00:00:00 2001
>> From: Marius Bakke 
>> Date: Thu, 20 Oct 2016 17:26:52 +0100
>> Subject: [PATCH] gnu: Add grub-efi.
>>
>> * gnu/packages/grub.scm (grub-efi): New variable.
>
> [...]
>
>> +(name "grub-efi")
>> +(synopsis (string-append (package-synopsis grub) " (UEFI version)"))
>
> Please use a literal string for ‘synopsis’; use of ‘string-append’ like
> this prevents i18n.
>
>> + `(#:tests? #f ; FIXME: 40 failures, 24 skipped, 17 passed.
>
> It would be good to investigate, especially if the tests pass in the
> ‘grub’ package.
>
> Also, what’s the rationale for making ‘grub-efi’ separate instead of
> incorporating the changes in ‘grub’ proper?  Are there issues around the
> portability of ‘efibootmgr’, or an increased closure size?

This is a good point. The only difference with "--with-platform=efi" is
that another directory is created in place of the i386-pc directory. It
is perfectly possible to build multiple platforms and copying the
platform-specific stuff to $out/lib -- grub will pick the correct
platform at runtime. This is what the Gentoo ebuild does.

I'll give this a shot and send an updated patch later this week.


signature.asc
Description: PGP signature


Re: [PATCH 6/6] gnu: Add grub-efi.

2016-11-06 Thread Ludovic Courtès
Marius Bakke  skribis:

> Leo Famulari  writes:
>
>> On Sat, Nov 05, 2016 at 12:55:11PM +, Marius Bakke wrote:
>>> * gnu/packages/grub.scm (grub-efi): New variable.
>>> ---
>>>  gnu/packages/grub.scm | 21 +
>>>  1 file changed, 21 insertions(+)
>>> 
>>> diff --git a/gnu/packages/grub.scm b/gnu/packages/grub.scm
>>> index ffce1bf..e06216f 100644
>>> --- a/gnu/packages/grub.scm
>>> +++ b/gnu/packages/grub.scm
>>> @@ -157,3 +157,24 @@ on the same computer; upon booting the computer, the 
>>> user is presented with a
>>>  menu to select one of the installed operating systems.")
>>>  (license gpl3+)
>>>  (properties '((cpe-name . "grub2")
>>> +
>>> +(define-public grub-efi
>>> +  (package
>>> +(inherit grub)
>>> +(name "grub-efi")
>>> +(synopsis (string-append (package-synopsis grub) " (UEFI version)"))
>>> +(inputs
>>> + `(("efibootmgr" ,efibootmgr)
>>> +   ,@(package-inputs grub)))
>>> +(arguments
>>> + #:tests? #f ; FIXME: 40 failures, 24 skipped, 17 passed.
>>
>> Does this package work for you?
>
> Oops, not sure what went wrong when fixing up this package for
> publishing. Updated patch attached.

I think Leo was asking whether you could get a bootable system with it.
:-)

> From 940c03c7dcddec019e27f6eb1470aeab4db57799 Mon Sep 17 00:00:00 2001
> From: Marius Bakke 
> Date: Thu, 20 Oct 2016 17:26:52 +0100
> Subject: [PATCH] gnu: Add grub-efi.
>
> * gnu/packages/grub.scm (grub-efi): New variable.

[...]

> +(name "grub-efi")
> +(synopsis (string-append (package-synopsis grub) " (UEFI version)"))

Please use a literal string for ‘synopsis’; use of ‘string-append’ like
this prevents i18n.

> + `(#:tests? #f ; FIXME: 40 failures, 24 skipped, 17 passed.

It would be good to investigate, especially if the tests pass in the
‘grub’ package.

Also, what’s the rationale for making ‘grub-efi’ separate instead of
incorporating the changes in ‘grub’ proper?  Are there issues around the
portability of ‘efibootmgr’, or an increased closure size?

Thanks for working on it!

Ludo’.



Re: [PATCH 6/6] gnu: Add grub-efi.

2016-11-05 Thread Marius Bakke
Leo Famulari  writes:

> On Sat, Nov 05, 2016 at 12:55:11PM +, Marius Bakke wrote:
>> * gnu/packages/grub.scm (grub-efi): New variable.
>> ---
>>  gnu/packages/grub.scm | 21 +
>>  1 file changed, 21 insertions(+)
>> 
>> diff --git a/gnu/packages/grub.scm b/gnu/packages/grub.scm
>> index ffce1bf..e06216f 100644
>> --- a/gnu/packages/grub.scm
>> +++ b/gnu/packages/grub.scm
>> @@ -157,3 +157,24 @@ on the same computer; upon booting the computer, the 
>> user is presented with a
>>  menu to select one of the installed operating systems.")
>>  (license gpl3+)
>>  (properties '((cpe-name . "grub2")
>> +
>> +(define-public grub-efi
>> +  (package
>> +(inherit grub)
>> +(name "grub-efi")
>> +(synopsis (string-append (package-synopsis grub) " (UEFI version)"))
>> +(inputs
>> + `(("efibootmgr" ,efibootmgr)
>> +   ,@(package-inputs grub)))
>> +(arguments
>> + #:tests? #f ; FIXME: 40 failures, 24 skipped, 17 passed.
>
> Does this package work for you?

Oops, not sure what went wrong when fixing up this package for
publishing. Updated patch attached.

The tests are the same as the original grub package, so I don't get why
they are failing now.



signature.asc
Description: PGP signature
>From 940c03c7dcddec019e27f6eb1470aeab4db57799 Mon Sep 17 00:00:00 2001
From: Marius Bakke 
Date: Thu, 20 Oct 2016 17:26:52 +0100
Subject: [PATCH] gnu: Add grub-efi.

* gnu/packages/grub.scm (grub-efi): New variable.
---
 gnu/packages/grub.scm | 21 +
 1 file changed, 21 insertions(+)

diff --git a/gnu/packages/grub.scm b/gnu/packages/grub.scm
index ffce1bf..7dcfc47 100644
--- a/gnu/packages/grub.scm
+++ b/gnu/packages/grub.scm
@@ -157,3 +157,24 @@ on the same computer; upon booting the computer, the user is presented with a
 menu to select one of the installed operating systems.")
 (license gpl3+)
 (properties '((cpe-name . "grub2")
+
+(define-public grub-efi
+  (package
+(inherit grub)
+(name "grub-efi")
+(synopsis (string-append (package-synopsis grub) " (UEFI version)"))
+(inputs
+ `(("efibootmgr" ,efibootmgr)
+   ,@(package-inputs grub)))
+(arguments
+ `(#:tests? #f ; FIXME: 40 failures, 24 skipped, 17 passed.
+   ,@(substitute-keyword-arguments (package-arguments grub)
+   ((#:configure-flags flags) `(cons* "--with-platform=efi"
+  ,flags))
+   ((#:phases phases)
+`(modify-phases ,phases
+   (add-after 'patch-stuff 'patch-efibootmgr-path
+ (lambda* (#:key inputs #:allow-other-keys)
+   (substitute* "grub-core/osdep/unix/platform.c"
+ (("efibootmgr") (string-append (assoc-ref inputs "efibootmgr")
+"/sbin/efibootmgr"
-- 
2.10.2



Re: [PATCH 6/6] gnu: Add grub-efi.

2016-11-05 Thread Leo Famulari
On Sat, Nov 05, 2016 at 12:55:11PM +, Marius Bakke wrote:
> * gnu/packages/grub.scm (grub-efi): New variable.
> ---
>  gnu/packages/grub.scm | 21 +
>  1 file changed, 21 insertions(+)
> 
> diff --git a/gnu/packages/grub.scm b/gnu/packages/grub.scm
> index ffce1bf..e06216f 100644
> --- a/gnu/packages/grub.scm
> +++ b/gnu/packages/grub.scm
> @@ -157,3 +157,24 @@ on the same computer; upon booting the computer, the 
> user is presented with a
>  menu to select one of the installed operating systems.")
>  (license gpl3+)
>  (properties '((cpe-name . "grub2")
> +
> +(define-public grub-efi
> +  (package
> +(inherit grub)
> +(name "grub-efi")
> +(synopsis (string-append (package-synopsis grub) " (UEFI version)"))
> +(inputs
> + `(("efibootmgr" ,efibootmgr)
> +   ,@(package-inputs grub)))
> +(arguments
> + #:tests? #f ; FIXME: 40 failures, 24 skipped, 17 passed.

Does this package work for you?



[PATCH 6/6] gnu: Add grub-efi.

2016-11-05 Thread Marius Bakke
* gnu/packages/grub.scm (grub-efi): New variable.
---
 gnu/packages/grub.scm | 21 +
 1 file changed, 21 insertions(+)

diff --git a/gnu/packages/grub.scm b/gnu/packages/grub.scm
index ffce1bf..e06216f 100644
--- a/gnu/packages/grub.scm
+++ b/gnu/packages/grub.scm
@@ -157,3 +157,24 @@ on the same computer; upon booting the computer, the user 
is presented with a
 menu to select one of the installed operating systems.")
 (license gpl3+)
 (properties '((cpe-name . "grub2")
+
+(define-public grub-efi
+  (package
+(inherit grub)
+(name "grub-efi")
+(synopsis (string-append (package-synopsis grub) " (UEFI version)"))
+(inputs
+ `(("efibootmgr" ,efibootmgr)
+   ,@(package-inputs grub)))
+(arguments
+ #:tests? #f ; FIXME: 40 failures, 24 skipped, 17 passed.
+ (substitute-keyword-arguments (package-arguments grub)
+   ((#:configure-flags flags) `(cons* "--with-platform=efi"
+  ,flags))
+   ((#:phases phases)
+`(modify-phases ,phases
+   (add-after 'patch-stuff 'patch-efibootmgr-path
+ (lambda* (#:key inputs #:allow-other-keys)
+   (substitute* "grub-core/osdep/unix/platform.c"
+ (("efibootmgr") (string-append (assoc-ref inputs "efibootmgr")
+"/sbin/efibootmgr")))
-- 
2.10.2