efiboot.backends#

The efiboot backend system.

Backends provide concrete implementations of the EfiController interface, along with other metadata to help efiboot identify when a particular backend should be used.

The backend can be specified in efiboot.toml or at the command line. When no backend is specified, the default backend us used. This backend is special: when used, it searches through all other backends and delegates to the one that is most appropriate for the host system.

Custom Backends#

A backend is described by a BackendMetadata object.

Any Python package may provide a backend. To register a new backend with efiboot, a package provides an entry point in the efiboot_backends namespace pointing to a BackendMetadata object.

Example

A minimal backend contains only a global BackendMetadata:

# Module: examplepkg.example_backend

from efiboot.backends import BackendMetadata

EFIBOOT_BACKEND = BackendMetadata(name='example')

The backend must be registered in the efiboot_backends entry point:

# File: pyproject.toml

[project.entry-points.efiboot_backends]
example = 'examplepkg.example_backend:EFIBOOT_BACKEND'

The backend can then be used in efiboot.toml.

# File: /boot/efiboot.toml

backend = 'example'

[[BootEntry]]
name = 'Linux'
loader = '/vmlinuz'

Reference#

Builtin Backends

default

The default backend.

efibootmgr

The efibootmgr backend.

Backend Utilities

BackendMetadata

The efiboot backend metadata class.

get_backend

Get a backend by name.

all_backends

Get the set of all backends, indexed by name.