[lfs-support] Configuring GRUB2--Request for a Logic Check

Dan McGhee beesnees at grm.net
Fri Nov 8 16:17:44 PST 2013

I have everything in place to boot LFS in EFI-mode.  The problem is that 
something is failing and the messages go by so fast that I can't see 
what it is.  Just like I have it set up, the laptop boots to Ubuntu if 
the LFS boot failed.  My problem is that I'm stymied in my troubleshooting.

I've reasoned that the problem is probably in my grub.cfg.

The grub image--grub.efi--, grub.cfg and all the grub modules reside in 
my EFI partition--/dev/sda2.  I cheated and used <grub-mkconfig> to 
generate grub.cfg, and this is the entry for LFS
> menuentry 'LFS-7.4' --class gnu-linux --class gnu --class os 
> $menuentry_id_optio
> n 'gnulinux-simple-d52e1640-9ac4-4c5d-aad1-9c79ff1f0bbd' {
>         load_video
>         insmod gzio
>         insmod part_gpt
>         insmod ext2
>         set root='hd0,gpt6'
>         if [ x$feature_platform_search_hint = xy ]; then
>           search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt6 
> --hint-efi=hd0,gpt6 --hint-baremetal=ahci0,gpt6  
> d52e1640-9ac4-4c5d-aad1-9c79ff1f0bbd
>         else
>           search --no-floppy --fs-uuid --set=root 
> d52e1640-9ac4-4c5d-aad1-9c79ff1f0bbd
>         fi
>         echo    'Loading Linux 3.10.10-lfs-7.4 ...'
>         linux   /boot/vmlinuz-3.10.10-lfs-7.4 root=/dev/sda6 ro
> }
That long UUID stands for /dev/sda6 or hd0,gpt6 and is my LFS 
partition.  All of a sudden it occurred to me that 'root' is the place 
where GRUB2 looks for its files and since they're not on /dev/sda6 it's 
looking in the wrong place.  My logic check consists of this question.  
Should I change every reference to gpt6 to gpt2 (this is sda2)?  If 
that's the case then I'm confused on the 'linux' line.  Should that 
remain the same or does it need to say:

linux (hd0,gpt6)/boot/vmlinuz-3.10*7.4 root=/dev/sda2 ro

I think I could put /dev/sda6 in the path to the image.

I'm trying to do this like Fedora does and put all the grub stuff on the 
EFI partition.  I don't know if Fedora puts the kernel image there or not.

I could also do it like Ubuntu does, which is a little closer to the way 
LFS does it.  In Ubuntu there is /boot/grub which contains the grub.cfg 
and the directory x86_64-efi that holds all the modules. But in this 
case there's a grub.cfg that exists on the EFI partition with the grub 
image.  It's contents are:

> search.fs_uuid 0ef1c9a3-59ad-4637-be37-72ebcc07d660 root hd0,gpt10
> set prefix=($root)/boot/grub
> configfile $prefix/grub.cfg
That UUID is for /dev/sda10, or (hd0,gpt10).  In this case the grub.cfg 
that holds the commands for booting is in the place we're used to and 
there would be no changes to the generated grub.cfg.

Since I want to share all of this with the LFS world, I'd like to get 
both methods to boot, so I'd still be grateful for thoughts on my LFS 
menuentry and the root stuff.


More information about the lfs-support mailing list