Introduction to efivar

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

This package is known to build and work properly using an LFS-10.1 platform.

Package Information

Additional Downloads

User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/efivar

Installation of efivar

First, apply a patch to fix an issue building with GCC 9 or later:

patch -Np1 -i ../efivar-37-gcc_9-1.patch

Build efivar with the following commands:

make CFLAGS="-O2 -Wno-stringop-truncation"

The test suite of this package is dangerous. Running it may trigger firmware bugs and make your system unusable without using some special hardware to reprogram the firmware.

Now, as the root user:

make install LIBDIR=/usr/lib BINDIR=/bin

Move the shared libraries to /lib, and recreate the symlinks in /usr/lib:

mv /usr/lib/libefi{boot,var}.so.* /lib &&
ln -sfv ../../lib/$(readlink /usr/lib/libefiboot.so) /usr/lib/libefiboot.so &&
ln -sfv ../../lib/$(readlink /usr/lib/libefivar.so) /usr/lib/libefivar.so

Command Explanations

CFLAGS="-O2 -Wno-stringop-truncation": This option overrides the default compiler flags to avoid a build failure.

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

BINDIR=/bin: Make efivar avaliable even if /usr is offline.


Installed Programs: efivar
Installed Libraries: libefiboot.so and libefivar.so
Installed Directories: /usr/include/efivar

Short Descriptions


is a tool to manipulate UEFI variables


is a library used by efibootmgr


is a library for the manipulation of EFI variables

Last updated on 2021-02-21 03:35:58 +0800