Gentoo Archives: gentoo-user

From: "Poison BL." <poisonbl@×××××.com>
To: gentoo-user <gentoo-user@l.g.o>
Subject: Re: [gentoo-user] SOLVED: NVMe drive and grub
Date: Tue, 12 Apr 2016 02:31:59
Message-Id: CAOTuDKr=YLgU_=E-WBQD_nmtFQnGVqmn9L96BWt29NHNLvDjiw@mail.gmail.com
In Reply to: Re: [gentoo-user] SOLVED: NVMe drive and grub by Adam Carter
1 On Mon, Apr 11, 2016 at 8:56 PM, Adam Carter <adamcarter3@×××××.com> wrote:
2 >
3 >> The problem was sys-boot/grub-2.02_beta2-r9, which UEFI never ran.
4 >>
5 >> The fix was to get rid of grub altogether and instead use
6 >> sys-boot/gummiboot.
7 >> Not only was it fully functional, it was a welcome relief not to have to
8 >> grapple with grub's baroque complexity and to be able to return to the
9 >> simple
10 >> booting I remember from years ago.
11 >>
12 >> I'd spent five long days wrestling with grub, going round in circles and
13 >> getting nowhere, before I was pointed to gummiboot.
14 >
15 >
16 > I also failed to get grub2 + UEFI working. So either;
17 > 1. We're both dummies
18 > 2. The handbook instructions are incorrect and/or inadequate
19 >
20 > Can anyone else that is familiar comment on the grub2 + UEFI doc quality?
21
22 Well, the uefi related commands in the kernel build section appears to
23 gloss over the potential issues that having a misconfigured kernel
24 (notably, one lacking either a builtin root= command line or an
25 initramfs that will handle that) directly uefi-stub booted will bring,
26 and installing the kernel as bootx64.efi might be contributing to grub
27 itself not being loaded.
28
29 The other potential source of an issue I see is that, while the kernel
30 build section of the handbook appears to point towards using
31 /boot/efi/ for the fat32 EFI partition (presumably based on earlier
32 usage/recommendations/commands), the grub2 part of the bootloaders
33 page in the handbook gives "--efi-directory=/boot". That would cause
34 grub to be on the wrong partition, completely out of reach of the uefi
35 firmware's boot process.
36
37 If it's in the right place despite that (such as, the user noticing
38 the discrepancy and adjusting for it, or me assuming the effect of
39 that flag all wrong), it's still potentially being overridden by the
40 bootx64.efi file put in place in the earlier chapter, unless grub
41 auto-adds itself to the efi boot list with a higher priority than the
42 generic quasi-bios-style 'disk' boot entry (with, say, efibootmgr).
43
44 The file 'bootx64.efi' is the default that uefi looks for when booting
45 a 'disk' in a quasi-bios-style fallback (if there's not a real 'boot
46 this particular thing' like the windows boot manager adds), which also
47 makes the efibootmgr example that sets up a boot entry for it a little
48 redundant (though using efibootmgr, one could add an entry for grub to
49 fix the whole mess).
50
51 Of course, using efibootmgr, you could also just add entries for your
52 kernels, having copied them to files named something sensible in the
53 efi filesystem, each built with an embedded command line and/or
54 initramfs that's sufficient to boot, and cut out the middleman. It's a
55 little more 'hands on' than running grub2-mkconfig when you're
56 changing things around for a new kernel, though.
57
58 --
59 Poison [BLX]
60 Joshua M. Murphy

Replies

Subject Author
Re: [gentoo-user] SOLVED: NVMe drive and grub Sam Jorna <wraeth@g.o>