[lfs-support] Configuring and Installing GRUB for {,U}EFI

Dan McGhee beesnees at grm.net
Mon Oct 28 10:03:56 PDT 2013

On 10/28/2013 10:55 AM, Bruce Dubbs wrote:
> Dan McGhee wrote:
>> GRUB is the next package in Ch. 6 that I will be building.  I'm going to
>> have to deviate from the book to do this since I have a GPT hard drive
>> and want to maintain it "as is."  This means installing GRUB with EFI
>> enabled.
> NO, it doesn't.  EFI is the replacement for the BIOS, not the partition
> table type.  EFI required GPT, but GPT can be used in a BIOS based system.
I want to make sure I understand what you're saying. I know enough about 
this just to make me dangerous.

So when <parted /dev/sda print> reports "Partition Table: gpt," I have a 
BIOS based system, because I have a Partition Table, that uses GPT?
> How do you boot to Linux now?  If you are using GRUB, I recommend just
> editing /boot/grub/grub.cfg and adding a new menuentry.  Get it to boot
> with what you have before changing the boot loader.
This was my line of thought when I originally posted. Right now, I boot 
right into GRUB. My selections start with "Ubuntu" and trail off for all 
the efi files on my hard drive. It's a long list. What I want is a menu 
with five entries: LFS, Ubuntu, HP, Windows, Windows Rec. Except for LFS 
and Windows Rec, these are all directories on my efi partition and I'm 
hoping I can get my LFS build to act the same way.

Two of the files in /boot/efi/EFI/ubuntu in the ubuntu tree are 
grubx64.efi and shimx64.efi. On the efi partition /EFI/ubuntu has the 
same files. I just wanted to make sure to build GRUB with these two 
files in my LFS build. But then again, I may not have to and just copy 
{grubx64,shimx64}.efi files that alredy exist into an LFS directory. 
I'll know more once I get GRUB built and installed in my LFS partition.

And I'm thinking about being *really* lazy and just copying the ubuntu 
grub config to LFS and modifying it as necessary.
>> When all this is successful, I could write the procedure up and post
>> it.  Then, if anyone wanted to, it could be put in the book somewhere.
>> I could also write a hint if that were more practical.
> For now, just let us know your results.
I will do that.

Oh and by the way, if anyone cares, you can get the uuid of all your 
partitions by

ls -l /dev/disk/by-uuid

Thanks, Bruce.

More information about the lfs-support mailing list