On 08/17/2015 11:37 PM, Jeremi Piotrowski wrote:
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.

Ok, thnks for your help, all was checked out as you said, the boot partition was correct, boot, esp which was a good thing.


Just found a slight problem, my .efi program that the system was trying to boot was /boot/efi/EFI/gentoo/grubx64.efi

copying the .efi to /boot/efi/EFI/BOOT changed nothing, I filed to notice that the name was incorrect, as installing the UEFI with the bootloader (without the efivar loaded) resulted in a file named "grubx86.efi" which doesn't work when copied in to the BOOT directory :(

    Renaming this file    ->  mv grubx86.efi bootx86.efi

System now happily boots in UEFI mode, I guess I didn't read "Find grubx64.efi in /boot/efi and copy it to /boot/efi/EFI/BOOT/BOOTX64.EFI" correctly :P

during this time, the original sda drive I was using failed (SMART was reporting that I should replace it soon) and I guess it was slightly too soon, but I did have the chance to rsync the filesystem across :P

    Thanks heaps for your help :)

--
---

      Regards,
Rod Smart
      0417 513 286


Reply via email to