The main application of is to change the UEFI boot manager configuration.
It can as wel just list the EFI vars exposed by the efivarfs.
The parameter in some examples below is rarely necessary, but it makes the output
more legible.
list all boot entries, boot order and currently booted entry
set boot order for boot entries
with , , being the four-digit boot number listed
with
adding a new boot entry
To add a new boot option, you need to the following information:
disk and partition number of the ESP (EFI System Partition) – you can check the
for this or use .
path to the UEFI image or UKI (Unified kernel Image), relative to the root of the ESP.
Example: on my machine, the ESP is on /dev/nvme0n1p, partition 1, mounted on .
To add a boot option for where /boot/efi is the mount point
of the ESP, I run:
where is a four digit hexadecimal number with leading zeros (0). The hexadecimal number
can contain the digits 0-9 and the upper case characters A-F, so the theoretical range is 0000-FFFF. The usual prefix
is omitted.
efivar EFI variables viewer
EFI vars exposed to userspace can be listed with . Shortened example output:
Tools for building UKIs (Unified Kernel Images) include and .
The dracut man page describes dracut as a “low-level tool for generating an initramfs/initrd image”", but with
in dracut’s config, dracut builds an UEFI image that is executable be an UEFI firmware.
There also exist projects with shell scripts that promise to make the build process easier, like the
Stubby UEFI bootloader and the EFI Unified Kernel Image Maker.
obtaining an UEFI boot stub
To build an UKI you need at least a Linux kernel and an UEFI boot stub. Below are some projects that provide
an UEFI boot stub:
gummiboot boot manager – On Void Linux, the package gummiboot-efistub provides an UEFI boot stub.