1 |
On Mon, 17 Aug 2015, Rod wrote: |
2 |
> Hi list, |
3 |
|
4 |
Hi |
5 |
|
6 |
> I'm trying to figure out how to make my boot partition to boot from UEFI, |
7 |
> I have grub2 installed, but I keep getting a error when I ask it to install |
8 |
> the boot information. |
9 |
|
10 |
First things first, are you installing gentoo from an UEFI booted |
11 |
installation media? From what I know the gentoo minimal install cd does |
12 |
not allow for this, and I will assume you are using that. |
13 |
|
14 |
If you're using some other installation method, check whether the |
15 |
directory /sys/firmware/efi/efivars has any content, try to mount efivarfs |
16 |
following the instructions in this link: |
17 |
|
18 |
https://wiki.gentoo.org/wiki/Efibootmgr#Configuration |
19 |
|
20 |
and then check again. |
21 |
|
22 |
> # efibootmgr |
23 |
> efibootmgr: EFI variables are not supported on this system. |
24 |
> |
25 |
> |
26 |
> # grub2-install --target=x86_64-efi /dev/sdc |
27 |
> Installing for x86_64-efi platform. |
28 |
> efibootmgr: EFI variables are not supported on this system. |
29 |
> efibootmgr: EFI variables are not supported on this system. |
30 |
> Installation finished. No error reported. |
31 |
|
32 |
In your case it seems that the system is not in an UEFI-booted state. But |
33 |
we can work around this by using a nice part of the UEFI specification, |
34 |
details below. |
35 |
|
36 |
> mount |
37 |
> /dev/sdc1 201633 156 201478 1% /boot/efi |
38 |
> |
39 |
> I have the /boot/efi part mounted ok.. |
40 |
|
41 |
Before we go further make sure that the partition is a valid EFI boot |
42 |
partition: code EF00 (gdisk), partition flags boot/esp (for parted). |
43 |
|
44 |
> How can I get this UEFI be become bootable without media to make it boot |
45 |
> in to that mode to begin with ? |
46 |
|
47 |
It's actually much easier than it may seem, and it's outlined here: |
48 |
|
49 |
https://wiki.gentoo.org/wiki/GRUB2#Alternative:_using_the_default_UEFI_firmware_location |
50 |
|
51 |
Basically, for all sorts of removable media there must be a way to tell |
52 |
UEFI what to boot without having to hardcode the entries into NVRAM (like |
53 |
efibootmgr does). Therefore UEFI firmware is supposed to check for the |
54 |
first ESP partition on a drive and boot \EFI\boot\bootx64.efi from it. |
55 |
This also works for harddrives, and since you can access a FAT partition |
56 |
even when booted in bios mode you just put grub there. |
57 |
|
58 |
Now this works perfectly well for a linux kernel with efi stub and cmdline |
59 |
built-in, but grub may have trouble finding it's configuration files, I do |
60 |
not know. So I suggest you try it. Find grubx64.efi in /boot/efi and copy |
61 |
it to /boot/efi/EFI/BOOT/BOOTX64.EFI. Voila, should boot just fine. |
62 |
|
63 |
On my first UEFI install I did not know about this, efibootmgr did not |
64 |
work, but the handbook says to place the kernel at /EFI/boot/bootx64.efi |
65 |
and it just magically worked. |
66 |
|
67 |
Generally you will find that provided the UEFI implementation of your |
68 |
vendor is not complete shit (lots of them exist) UEFI makes it generally |
69 |
easier to handle booting. One partition and the EFI variables and you can |
70 |
boot anything, no more hidden sectors. |