Debian Jessie GRUB2 on a multi-boot EFI laptop cannot start a Gentoo kernel-initramfs

debiandual-bootgentoouefi

I have an HP Pavillion Touch 14-N009LA laptop running on an AMD A8-4555M CPU, 8 GB of RAM, and a 750 GB HD, currently running on dual boot Windows 8.1 accessible via the system's EFI boot manager, and Debian Jessie accessible via a special option on my startup menu to start an OS installed under legacy BIOS mode. I am trying to install Gentoo on a dm-crypt partition and I have already set up an encrypted partition for the system's root, and a plaintext partition for the Gentoo kernel, initramfs and GRUB configuration. I have already installed the stage 3 files, Portage, compiled the kernel and generated a LUKS-capable initramfs using genkernel --luks all.

After unsuccessfully getting the system to boot from Gentoo's GRUB2, I figured I could also boot Gentoo by adding an entry to Debian's GRUB configuration, so I edited /etc/grub.d/40_custom with the following:

menuentry "Gentoo Linux" {
set root=(hd0,9)
linux /kernel-genkernel-x86_64-3.12.21-gentoo-r1 cryptdevice=/dev/sda11:dm-root root=/dev/mapper/dm-root
initrd /initramfs-genkernel-x86_64-3.12.21-gentoo-r1
}

After running update-grub2 the entry shows up just fine on the GRUB configuration. However, when I try to boot said entry, GRUB claims that it can't find the specified kernel image, even though I'm absolutely sure I'm specifying it fine.

Debian GRUB2 error message


More details about my system's configuration:

Output of lsblk:

NAME    MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda       8:0    0 698.7G  0 disk 
├─sda1    8:1    0   400M  0 part 
├─sda2    8:2    0   260M  0 part /boot/efi
├─sda3    8:3    0   128M  0 part 
├─sda4    8:4    0 183.1G  0 part /media/C <Windows 8.1>
├─sda5    8:5    0   350M  0 part 
├─sda6    8:6    0  25.2G  0 part 
├─sda7    8:7    0   1.6G  0 part /boot <Debian boot>
├─sda8    8:8    0   8.2G  0 part [SWAP]
├─sda9    8:9    0    40G  0 part / <Debian system root>
├─sda10   8:10   0   4.4G  0 part <Gentoo boot>
├─sda11   8:11   0 426.4G  0 part <Gentoo encrypted system root>
└─sda12   8:12   0   8.7G  0 part 
sr0      11:0    1  1024M  0 rom  

Output of parted -l:

Model: ATA WDC WD7500BPVX-6 (scsi)
Disk /dev/sda: 750GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start   End    Size    File system     Name                          Flags
 1      1049kB  420MB  419MB   ntfs            Basic data partition          hidden, diag
 2      420MB   693MB  273MB   fat32           EFI system partition          boot
 3      693MB   827MB  134MB                   Microsoft reserved partition  msftres
 4      827MB   197GB  197GB   ntfs            Basic data partition          msftdata
10      197GB   202GB  4719MB  ext2                                          msftdata
11      202GB   660GB  458GB                                                 msftdata
12      660GB   669GB  9343MB  linux-swap(v1)
 7      669GB   671GB  1709MB  ext2                                          msftdata
 8      671GB   680GB  8791MB  linux-swap(v1)
 9      680GB   723GB  42.9GB  ext4                                          msftdata
 5      723GB   723GB  367MB   ntfs                                          hidden, diag
 6      723GB   750GB  27.1GB  ntfs            Basic data partition          hidden, msftdata

Contents of /dev/sda10, my Gentoo boot partition:

total 9436
drwxr-xr-x 4 root root    4096 Jul  1  2014 grub
-rw-r--r-- 1 root root 3916272 Jul  1  2014 initramfs-genkernel-x86_64-3.12.21-gentoo-r1
-rw-r--r-- 1 root root 3603216 Jul  1 17:16 kernel-genkernel-x86_64-3.12.21-gentoo-r1
drwx------ 2 root root   16384 Jun 30 17:09 lost+found
-rw-r--r-- 1 root root 2103510 Jul  1 17:16 System.map-genkernel-x86_64-3.12.21-gentoo-r1

Best Answer

I don't remember if EFI GRUB2 uses LoadImage() (most likely it does by now as the RestrictedBoot story has basically boiled down to "your last-mile bootloader has to or shim will blow it up") -- it will take EFI drivers (like those available with refind) if that's the case; GRUB-specific filesystem drivers are not available to EFI firmware.

Your kernel/initrd partition is not FAT32 so it's not accessible without those drivers. So try with sda2 first. See also the excellent Rod Smith's series.

Related Question