Kernel Config
How much of the kernel config actually needs to be done? On the UEFI wiki is states:
In order to support native (U)EFI, the kernel needs to be configured with EFI support.
Processor type and features --->
[*] EFI runtime service support (EFI=y)
[ ] EFI stub support (EFI_STUB=n)
[ ] EFI mixed-mode support (EFI_MIXED=n)
All of the above are configured in my kernel. Next, let me show you my fstab:
Code: Select all
# <fs> <mountpoint> <type> <opts> <dump> <pass>
UUID=C587-0998 /boot vfat defaults 0 2
UUID=d547a5df-0eab-4a07-8673-6314dbb98ee9 / xfs defaults 0 1
/dev/nvme0n1p2 none swap sw 0 0Code: Select all
Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 2099199 2097152 1G EFI System
/dev/nvme0n1p2 2099200 10487807 8388608 4G Linux swap
/dev/nvme0n1p3 10487808 512784673 502296866 239.5G Linux filesystem
/dev/nvme0n1p4 512786432 1953523711 1440737280 687G Linux filesystemCode: Select all
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
nvme0n1 259:0 0 931.5G 0 disk
├─nvme0n1p1 259:1 0 1G 0 part /boot
├─nvme0n1p2 259:2 0 4G 0 part [SWAP]
├─nvme0n1p3 259:3 0 239.5G 0 part /
└─nvme0n1p4 259:4 0 687G 0 part Code: Select all
/dev/nvme0n1p1: UUID="C587-0998" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="56601e36-84bb-2143-80b0-59fd70a82787"Nevertheless, I moved onto EFI Stub because the above didn't work. On the UEFI wiki, it states:
I am not sure what this means exactly but the more I read it, I felt like it wasn't needed for my purpose of booting UEFI. But alas, I followed the EFI Stub wiki because what I was trying wasn't working. My kernel config is proper for EFI stub support:The EFI stub support is only required to boot the kernel directly as an EFI executable, as is the EFI mixed-mode support in case a 64-bit kernel is to be booted directly from a 32-bit EFI implementation.
rocessor type and features --->
[*] EFI runtime service support
[*] EFI stub support
[ ] EFI mixed-mode support (OPTIONAL)
Then there is this note:
My kernel is:For Distribution kernels (except gentoo-kernel-bin) the kernel settings go to savedconfig or /etc/kernel/config.d.
I don't know what this means but it looks like my kernel is configured correctly. The next line says:6.1.57-gentoo-dist
So now I go to the ESP wiki and find that more kernel requirements:With the kernel configured with EFI Stub support (assuming that ESP is mounted at /efi).
-*- Enable the block layer --->
Partition Types --->
[*] Advanced partition selection
[*] EFI GUID Partition support
-*- File Systems --->
DOS/FAT/EXFAT/NT Filesystems --->
<*> VFAT (Windows-95) fs support
(437) Default codepage for FAT
(iso8859-1) Default iocharset for FAT
Native Language support --->
[*] NLS ISO 8859-1 (Latin 1; Western European Languages)
And I find the first discrepancy - my Default iocharset for FAT is
(UTF-8 ) Default iocharset for FAT
Does this mean I need to change the setting and recompile the kernel? So far, I haven't done anything like that so let's move on. Here is the output of parted /dev/nvme0n1 print:
This shows the boot and esp flags so it looks good. Now the ESP wiki tells me to:Number Start End Size File system Name Flags
1 1049kB 1075MB 1074MB fat32 boot, esp
I install the package and make changes to these file (and registered the service for autostart with openrc):For OpenRC, use AutoFS to mount on-demand
/etc/autofs/auto.master
added the line:
I made this file /etc/autofs/auto.boot and added these lines:/- /etc/autofs/auto.boot --timeout=600,sync,nodev
Finally, the wiki states:/boot -fstype=vfat,uid=0,gid=0,umask=0077 UUID=C587-0998
/efi -fstype=vfat,uid=0,gid=0,umask=0077 UUID=C587-0998
So I don't need efibootmgr as long as ESP is set up correctly. Now I reboot and still don't see the gentoo UEFI partition. So I move onto efibootmgr and add entries with these variations:Computers with UEFI usually provide a boot menu and a configuration tool for creating, sorting or deleting boot items. The content of the ESP is visible to these tools and creating a boot item is like choosing the medium from a given selection, then surfing through the ESP and selecting the item, e.g bzImage-4.9.76-r1-gentoo.efi.
Alternatively, efibootmgr can be used for generating the UEFI boot items.
So I reboot and the UEFI partition isn't seen. What am I doing wrong?efibootmgr --create --disk /dev/nvme0n1 --part 1 --label "Gentoo" --loader "\efi\\gentoo\bzImage.efi"
efibootmgr --create --disk /dev/nvme0n1 --label "Gentoo EFI Stub" --loader "\efi\gentoo\bzImage.efi" -u "root=PARTUUID=708279f1-337e-1746-b41b-eaca11d69d9c"
efibootmgr --create --disk /dev/nvme0n1 --label "Gentoo EFI Stub" --loader "\efi\gentoo\bzImage.efi" -u "root=/dev/nvme0n1p3"


