On Mon, 17 Aug 2015, Rod wrote:
>     Hi list,

Hi

>     I'm trying to figure out how to make my boot partition to boot from UEFI,
> I have grub2 installed, but I keep getting a error when I ask it to install
> the boot information.

First things first, are you installing gentoo from an UEFI booted 
installation media? From what I know the gentoo minimal install cd does 
not allow for this, and I will assume you are using that.

If you're using some other installation method, check whether the 
directory /sys/firmware/efi/efivars has any content, try to mount efivarfs 
following the instructions in this link: 

https://wiki.gentoo.org/wiki/Efibootmgr#Configuration 

and then check again.

> # efibootmgr
> efibootmgr: EFI variables are not supported on this system.
> 
> 
> # grub2-install --target=x86_64-efi /dev/sdc
> Installing for x86_64-efi platform.
> efibootmgr: EFI variables are not supported on this system.
> efibootmgr: EFI variables are not supported on this system.
> Installation finished. No error reported.

In your case it seems that the system is not in an UEFI-booted state. But 
we can work around this by using a nice part of the UEFI specification, 
details below.

> mount
> /dev/sdc1                   201633        156     201478   1% /boot/efi
> 
>     I have the /boot/efi part mounted ok..

Before we go further make sure that the partition is a valid EFI boot
partition: code EF00 (gdisk), partition flags boot/esp (for parted).  

>     How can I get this UEFI be become bootable without media to make it boot
> in to that mode to begin with ?

It's actually much easier than it may seem, and it's outlined here: 

https://wiki.gentoo.org/wiki/GRUB2#Alternative:_using_the_default_UEFI_firmware_location

Basically, for all sorts of removable media there must be a way to tell
UEFI what to boot without having to hardcode the entries into NVRAM (like
efibootmgr does). Therefore UEFI firmware is supposed to check for the
first ESP partition on a drive and boot \EFI\boot\bootx64.efi from it.
This also works for harddrives, and since you can access a FAT partition
even when booted in bios mode you just put grub there.

Now this works perfectly well for a linux kernel with efi stub and cmdline
built-in, but grub may have trouble finding it's configuration files, I do
not know. So I suggest you try it. Find grubx64.efi in /boot/efi and copy
it to /boot/efi/EFI/BOOT/BOOTX64.EFI. Voila, should boot just fine. 

On my first UEFI install I did not know about this, efibootmgr did not 
work, but the handbook says to place the kernel at /EFI/boot/bootx64.efi 
and it just magically worked.

Generally you will find that provided the UEFI implementation of your
vendor is not complete shit (lots of them exist) UEFI makes it generally
easier to handle booting. One partition and the EFI variables and you can
boot anything, no more hidden sectors.

Reply via email to