8.74. efivar-39

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

Approximate build time: 0.1 SBU
Required disk space: 21 MB

8.74.1. Installation of efivar

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

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

pkgname="efivar"
pkgver="39"
pkgrel="1"
pkgdesc="The efivar package provides tools and libraries to manipulate EFI variables."
arch=('x86'
      'x86_64')
url="https://github.com/rhboot/efivar/"
license=('LGPLv2.1')
groups=('core')
depends=('glibc'
         'rootfs')
makedepends=('bash'
             'binutils'
             'coreutils'
             'gcc'
             'make')
optdepends=('mandoc')
source=('https://github.com/rhboot/efivar/archive/39/efivar-39.tar.gz')
md5sums=('a8fc3e79336cd6e738ab44f9bc96a5aa')
 
build(){
  cd "${pkgname}-${pkgver}"
  # Set to 1 if mandoc is installed
  make ENABLE_DOCS=0
}

package(){
  cd "${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" install ENABLE_DOCS=0 LIBDIR=/usr/lib

  # Install shipped man pages if mandoc is not installed
  install -vDm644 docs/efivar.1 "${pkgdir}/usr/share/man/man1"
  install -vDm644 docs/*.3      "${pkgdir}/usr/share/man/man3"
}
REALEOF

The meaning of the make options:

ENABLE_DOCS=0

Disable the generation of man pages, in order to allow building this package without mandoc installed.

LIBDIR=/usr/lib

This option overrides the default library directory of the package (/usr/lib64, which is not used by LFS).

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 efivar-39-1-$(uname -m).pkg.tar.xz \
   /srv/pacman/repos/LFS/
repo-add /srv/pacman/repos/LFS/LFS.db.tar.xz \
         /srv/pacman/repos/LFS/efivar-39-1-$(uname -m).pkg.tar.xz

Update the local cache and install the efivar package:

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

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

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

8.74.2. Contents of efivar

Installed programs: efisecdb and efivar
Installed libraries: libefiboot.so, libefisec.so, and libefivar.so

Short Descriptions

efisecdb

is a utility for managing UEFI signature lists

efivar

is a tool to manipulate UEFI variables

libefiboot

is a library used by efibootmgr

libefisec

is a library for managing UEFI signature lists

libefivar

is a library for the manipulation of EFI variables