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

Bruce Dubbs bruce.dubbs at gmail.com
Mon Oct 28 10:20:51 PDT 2013


Dan McGhee wrote:
> 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?

No.  BIOS firmware can use either GPT or MDSOS partition tables.  EFI 
systems require GPT partition tables.

>> 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.

That won't work.  GRUB will only read the .cfg file from one location. 
You have to reinstall to change it and I don't think you want to do that 
yet, if at all.

Send me a copy of grub.cfg off list and I'll see if I can make any 
recommendations.  I need to know the device for the LFS partition and 
where the grub.cfg file is located.

   -- Bruce



More information about the lfs-support mailing list