efibootmgr-18

Introduction to efibootmgr

The efibootmgr package provides tools and libraries to manipulate EFI variables.

[Note]

Note

Development versions of BLFS may not build or run some packages properly if LFS or dependencies have been updated since the most recent stable versions of the books.

Package Information

efibootmgr Dependencies

Required

efivar-39 and popt-1.19

Installation of efibootmgr

Build efibootmgr with the following commands:

make EFIDIR=LFS EFI_LOADER=grubx64.efi

This package does not have a test suite.

Now, as the root user:

make install EFIDIR=LFS

Command Explanations

EFIDIR=LFS: This option specifies the distro's subdirectory name under /boot/efi/EFI. The building system of this package needs it to be set explicitly.

EFI_LOADER=grubx64.efi: This option specifies the name of the default EFI boot loader. It is set to match the EFI boot loader provided by GRUB.

Using efibootmgr

In LFS, the instructions go over how to install GRUB for UEFI. The process installs the EFI in a hardcoded location searched by most UEFI firmware implementations. If you reinstall GRUB however, GRUB will use this package to install the EFI in a place GRUB prefers, which allows greater control over EFI management. The --removable option will no longer be necessary when running grub-install. This package may be necessary in scenarios where the UEFI firmware doesn't look for the hardcoded EFI location. The LFS book addresses this situation.

In order for efibootmgr to work, the EFI variable file system must be mounted beforehand. If you're still in a chroot and haven't rebooted, mount it as the root user:

mountpoint /sys/firmware/efi/efivars ||
  mount -v -t efivarfs efivarfs /sys/firmware/efi/efivars

The EFI variable file system isn't mounted automatically at boot for SysVinit systems, meaning that whenever grub-install or efibootmgr are executed, they will fail. To ensure the file system gets mounted at boot, add the following to /etc/fstab as the root user:

cat >> /etc/fstab << "EOF"
efivarfs /sys/firmware/efi/efivars efivarfs defaults 0 0
EOF

Contents

Installed Programs: efibootdump and efibootmgr

Short Descriptions

efibootdump

is a tool to display individual UEFI boot options, from a file or an UEFI variable

efibootmgr

is a tool to manipulate the UEFI Boot Manager