8.76. efibootmgr-18

The efibootmgr package contains a Linux user-space application to modify the EFI Boot Manager.

Approximate build time: less than 0.1 SBU
Required disk space: 1.1 MB

8.76.1. Installation of efibootmgr

Create the PKGBUILD for the efibootmgr package with the following commands:

mkdir /sources/efibootmgr
cd /sources/efibootmgr
cat > PKGBUILD << "REALEOF"
# Maintainer: Linux From Scratch <lfs-dev@lists.linuxfromscratch.org>

pkgname="efibootmgr"
pkgver="18"
pkgrel="1"
pkgdesc="A Linux user-space application to modify the EFI Boot Manager."
arch=('x86'
      'x86_64')
url="https://github.com/rhboot/efibootmgr/"
license=('GPLv2')
groups=('core')
depends=('efivar'
         'glibc'
         'popt'
         'rootfs')
makedepends=('bash'
             'binutils'
             'coreutils'
             'gcc'
             'make')
source=('https://github.com/rhboot/efibootmgr/archive/18/efibootmgr-18.tar.gz')
md5sums=('e170147da25e1d5f72721ffc46fe4e06')
 
build(){
  cd "${pkgname}-${pkgver}"
  make EFIDIR=LFS EFI_LOADER=grubx64.efi
}

package(){
  cd "${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" install EFIDIR=LFS
}
REALEOF

The meaning of the make options:

EFIDIR=LFS

This option specifies the distro's subdirectory name under /boot/efi/EFI. The build 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.

Prepare the build directory for the pacman user and build the package:

chown -R root:pacman .
chmod 2775 .
chmod 664 PKGBUILD
su pacman -c 'makepkg -L --nodeps'

Add the newly created package to the central package repository:

cp efibootmgr-18-1-$(uname -m).pkg.tar.xz \
   /srv/pacman/repos/LFS/
repo-add /srv/pacman/repos/LFS/LFS.db.tar.xz \
         /srv/pacman/repos/LFS/efibootmgr-18-1-$(uname -m).pkg.tar.xz

Update the local cache and install the efibootmgr package:

pacman -Syu
pacman -S efibootmgr --overwrite \* -dd --noconfirm

Finally, copy the source files into the source repository and clean up the build directory:

mkdir /srv/pacman/source/LFS/efibootmgr
cp PKGBUILD /srv/pacman/source/LFS/efibootmgr
cd /sources
rm -rf efibootmgr

8.76.2. Contents of efibootmgr

Installed program: 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