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

Dan McGhee beesnees at grm.net
Mon Oct 28 06:59:22 PDT 2013

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.  From looking at <./configure --help> in the GRUB source tree, 
I think that this is the only change I need to do in the book's 
configure options; i.e., "enable-efiemu."  Is this correct or do I need 
any other options.

That was my basic question and the purpose of this post.  However, in 
thinking about GRUB, I thought forward to making the new system bootable.

I have an HP ENVY m6 Sleekbook which came, obviously, with secure boot 
enabled and Windows 8.  If at all possible, I'd like to make it work, on 
boot, as designed.  This took me to grub-install. The options 
"--bootloader-id, --efi-directory and --uefi-secure-boot" got my 
attention.  I know how to handle the "--efi-directory." Using parted, I 
found it.  I don't know how to use "--bootloader-id" or even if it's 
necessary. If it is necessary, how do I find the id of any bootoader.  I 
know that my laptop now has three boot managers: HP, WINDOWS and GRUB.  
How do I find their numbers? (This may be semantics, but is GRUB a boot 

Now for "--uefi-secure boot."  The man page says that this option can be 
used only if the "grub-efi-amd64-signed package" is installed."  I 
looked around for a package and it seems that it is only available at 
ubuntu or debian.  I think that ubuntu (debian) is the only distro who 
has currently, as one person put it, "paid the fine to microsoft" and 
can use secure boot.  If this is true, maybe this package is proprietary 
and I just can't download it.  I can try to tear the .deb package apart 
to see if I can to anything with it.

BTW. I currently have "secure boot" disabled.  I don't need it.  In 
fact, I think secure boot is *really* paranoid and is, more 
specifically, another "cash cow" for microsoft.  But I rant. Please forgive.

Anyway, GRUB is my current default boot loader.  Ubuntu is supposed to 
work "out of the box" in the UEFI environment, but it was not true in my 
case.  I had to get a package, at Ubuntu, called "boot fix" to get my 
boot process to the point at which I no longer needed to go into the 
boot manager menu at startup.  The problem is that I couldn't (can't) 
find any log that tells me what this application did.  But GRUB now is 
my default loader.

This leads me to my final point and question.  The warning in Section 
8.4 says of grub-install, "Do not run this command if not desired..."  
Since my laptop boots into a GRUB menu, can I just copy the appropriate 
files to a directory on the efi boot partition?  (I could do this from a 
terminal in ubuntu since I don't think that the chroot environment has 
the tools to translate ext4 to FAT32 yet.) And after copying, generate 
my grub config file.

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.


More information about the lfs-support mailing list