Config#

class efiboot.Config(path, timeout, backend, options, entries)#

The efiboot configuration format.

Efiboot configuration typically lives in a TOML file. This class provides several classmethods to load a Config object from such a file:

See also

The Configuration Format document contains additional details and examples.

Parameters
  • path (Optional[Path]) – The path to the config file. This may be None if the config was not parsed from a file.

  • timeout (Optional[int]) – The boot timeout in seconds. If this is not set, efiboot will not modify the boot timeout. If this is -1, efiboot will clear the boot timeout on the EFI, reverting to the motherboard’s default value.

  • backend (Optional[str]) – The backend to use. This must be a dotted import path to a Python module providing an efiboot backend. See efiboot.backends.

  • options (Dict[str, Any]) – A dictionary of additional backend-specific options.

  • entries (List[BootEntry]) – The boot entries.

Methods

__init__

empty

Create an empty config object.

from_dict

Create a config object from a dictionary.

from_file

Read a config object from a file.

from_path

Read a config object from a path.

from_toml

Parse a config object from a TOML string.

validate

Validate the config.

Attributes

name

A string name for this config.

path

Path to the config file, if any.

timeout

The boot timeout in seconds.

backend

The backend to use.

options

Additional options.

entries

The boot entries.