The efibootmgr package provides tools and libraries to manipulate EFI variables.
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.
Download (HTTP): https://github.com/rhboot/efibootmgr/archive/18/efibootmgr-18.tar.gz
Download MD5 sum: e170147da25e1d5f72721ffc46fe4e06
Download size: 48 KB
Estimated disk space required: 1.1 MB
Estimated build time: less than 0.1 SBU
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
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.
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