This is an old revision of the document!
Table of Contents
Linux kernel options for UEFI and ELILO
The purpose of this article is to inform the user about necessary kernel options for booting from UEFI, and some info about how ELILO and perhaps other EFI bootloaders work, as this is currently difficult to find and understand online.
Required kernel options for UEFI support
The following options are required for booting a kernel from UEFI. These are already set in the stock Slackware kernels.
Enable the block layerPartition TypesAdvanced partition selectionEFI GUID Partition support (CONFIG_EFI_PARTITION)
Processor type and featuresEFI runtime service support (CONFIG_EFI)
EFI stub support (CONFIG_EFI_STUB)
Build a relocatable kernel (CONFIG_RELOCATABLE)
Device DriversGraphics supportSupport for frame buffer devices (CONFIG_FB)EFI-based Framebuffer Support (CONFIG_FB_EFI)
File systemsMiscellaneous filesystemsEFI Variable filesystem (CONFIG_EFIVAR_FS)
Firmware DriversEFI (Extensible Firmware Interface) SupportEFI Variable Support via sysfs (CONFIG_EFI_VARS)
as it is deprecated in favor of CONFIG_EFIVAR_FS, because it has a 1024-byte variable size limit, and because it can cause data inconsistency issues.
However, if you do disable this, you will need a fork of the efibootmgr
program that supports the new EFI Variable filesystem found at:
https://github.com/vathpela/efibootmgr/tree/libefivars
UEFI and ELILO
During the install procedure of Slackware 14.1 for ELILO (the eliloconfig
script), the following happens and is required for booting from UEFI using ELILO.
- The EFI System Partition (ESP) is located and mounted. On a running system it is usually found already mounted at
/boot/efi
. This is a special FAT partition that is basically the UEFI firmware replacement of what the MBR was for BIOS. However, it can not only hold a bootloader (all the MBR was capable of), but also config files, the kernel, and other things you might want to access using the UEFI firmware. - The three items required by ELILO (and other bootloaders) are copied onto the ESP to
/boot/efi/EFI/Slackware
. These include:- The bootloader. In the case of ELILO it is
elilo.efi
- The config file. In the case of ELILO it is
elilo.conf
- The kernel, usually titled
vmlinuz
- A boot entry variable is registered in the UEFI firmware using
efibootmgr
. The exact command that is run isEFI_DEVICE=$(mount | grep vfat | grep -w /boot/efi | cut -b 1-8) EFI_PARTITION=$(mount | grep vfat | grep -w /boot/efi | cut -f 1 -d ' ' | cut -b 9-) efibootmgr -q -c -d $EFI_DEVICE -p $EFI_PARTITION -l "\\EFI\\Slackware\\elilo.efi" -L "Slackware"
so if
mount
outputs/dev/sda1 on /boot/efi type vfat (rw)
EFI_DEVICE would be
/dev/sda
and EFI_PARTITION would be1
, each components of/dev/sda1
, which is the ESP.
/EFI/boot/bootx64.efi
. This special location allows the UEFI firmware to run the bootloader without any boot entry.
Upgrading your kernel
This task is now much easier than it used to be. All you really need to do is copy vmlinuz
onto the ESP on top of the old kernel. No need to edit any configs or add any boot entries, unless you want to. Note that you can edit the config in place and ELILO will pick up the changes on next boot, no need to run any commands like with the old lilo.