WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Grub2 and BOOTX64.EFI  (Read 12792 times)

Offline lemming

  • Newbie
  • *
  • Posts: 37
Grub2 and BOOTX64.EFI
« on: June 17, 2015, 01:18:34 AM »
I am installing grub2 with the following command:

sudo x86_64-grub-install --target=x86_64-efi --boot-directory=/mnt/mmcblk0p1/EFI/BOOT --efi-directory=/mnt/mmcblk0p1

It seems to be setting up all the correct files in their respective directories however I am missing  in directory
/mnt/mmcblk0p1/EFI/BOOT/.  All it shows is the grub directory.

Should grub2 install be copying BOOTX64.EFI into the EFI/BOOT/  directory or does it copy it elsewhere or am I meant to get it from somewhere else and copy it in?
 

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14847
Re: Grub2 and BOOTX64.EFI
« Reply #1 on: June 17, 2015, 04:30:36 AM »
That should work and it should copy BOOTX64.EFI.

I recently experienced an error doing something similar and had to reformat the usb stick I was using so that the single partition started at cylinder 2 rather than cylinder 1 and then things worked.

You could also try the grub2-multi extension, which is a more recent version.

Offline lemming

  • Newbie
  • *
  • Posts: 37
Re: Grub2 and BOOTX64.EFI
« Reply #2 on: June 17, 2015, 05:43:34 AM »
Thanks Juanito,

Being a uefi install the first partition starts at sector 2048 to allow for the 1MB blank space at the start of the drive so hopefully that will put me into a 'cylinder' greater than one (it is a 4GB solid state memory drive on the motherboard).

I didn't know of the grub2-multi so I will give that a try.

Offline lemming

  • Newbie
  • *
  • Posts: 37
Re: Grub2 and BOOTX64.EFI
« Reply #3 on: June 17, 2015, 06:01:27 AM »
I've tried the grub2-multi on both the solid state memory drive and a normal sata drive and still no BOOTX64.EFI . All the other files are created though.  There is a "grubx64.efi" created in the EFI/grub/ directory.  Should I be copying this into the EFI/BOOT/ directory and renaming it "BOOTX64.EFI"?
« Last Edit: June 17, 2015, 06:03:32 AM by lemming »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14847
Re: Grub2 and BOOTX64.EFI
« Reply #4 on: June 17, 2015, 09:51:50 AM »
Not necessarily - did you try and boot using grubx64.efi instead of BOOTX64.EFI?

Offline lemming

  • Newbie
  • *
  • Posts: 37
Re: Grub2 and BOOTX64.EFI
« Reply #5 on: June 17, 2015, 07:42:34 PM »
I don't know how to do that. There is nowhere, that I can see, where BOOTX64.EFI is specified in the config files. Therefore I can't see where I can substitute grubx64.efi.  Do I copy grubx64.efi into the EFI/BOOT/ directory and rename it "BOOTX64.EFI"?

What is BOOTX64.EFI?  Is it the grub executable (bringing up the grub OS selection menu etc) that the PC firmware looks for straight after POST?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14847
Re: Grub2 and BOOTX64.EFI
« Reply #6 on: June 18, 2015, 05:33:19 AM »
You shouldn't have to rename, move or refer to grubx64.efi, just create a grub.cfg and try to boot.

Offline lemming

  • Newbie
  • *
  • Posts: 37
Re: Grub2 and BOOTX64.EFI
« Reply #7 on: June 27, 2015, 02:21:40 AM »
Quote
You shouldn't have to rename, move or refer to grubx64.efi, just create a grub.cfg and try to boot.

 grubx64.efi resides in the  EFI/grub/ directory. 

BOOTX64.EFI  should reside in  the EFI/BOOT/ directory.

As I can't specify which .efi file to use (and from which directory) in the grub.cfg file, I assume that the file to use and its directory are hardcoded somewhere.
Therefore if it is looking for EFI/BOOT/BOOTX64.EFI why should it the  go and find EFI/grub/ grubx64.efi and use that instead?
Does it recursively check every directory and use whichever .efi files that it can find?

What is BOOTX64.EFI? Is it the grub executable or a boot stub called by grub that then side-loads the OS?



Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14847
Re: Grub2 and BOOTX64.EFI
« Reply #8 on: June 27, 2015, 03:39:19 AM »
As per google:
Quote
This process should have created a file on the USB stick

/EFI/grub/grubx64.efi.

At this point it is advisable that to check that it is possible to boot from the USB stick with grubx64.efi. If the UEFI system does not see it copy it to /EFI/BOOT/bootx64.efi

Again, did you try to boot without changing anything?

Edit: I just checked the uefi boot usb stick I made a while ago with:
Code: [Select]
$ sudo x86_64-grub-install --target=x86_64-efi --boot-directory=/mnt/sdb1/EFI/BOOT --efi-directory=/mnt/sdb1 --removable

..this copied files as follows:

/EFI/BOOT/BOOTX64.EFI
/EFI/BOOT/grub/grubenv
/EFI/BOOT/grub/x86_64-efi/*mod
/EFI/BOOT/grub/fonts/unicode.pf2
/EFI/BOOT/grub/locale

This was a beta version of grub2 - perhaps it now creates grubx64.efi instead of BOOTX64.EFI?
« Last Edit: June 27, 2015, 04:46:13 AM by Juanito »

Offline lemming

  • Newbie
  • *
  • Posts: 37
Re: Grub2 and BOOTX64.EFI
« Reply #9 on: June 27, 2015, 08:13:21 PM »
Quote
Again, did you try to boot without changing anything?

Yes I did. As usual after installing any OS, I rebooted the device and just came up with a blank screen. Thats when I started investigating and found the grub64x.efi rather than the  BOOTX64.EFI.

I will try yet again from scratch.  This time I will try it with  the "--removable" on the end even though the storage is flash soldered onto the motherboard.