The efivar package provides tools and libraries to manipulate EFI variables.
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