ironic_python_agent.efi_utils module

ironic_python_agent.efi_utils.add_boot_record(device, efi_partition, loader, label)[source]

Add an EFI boot record with efibootmgr.

  • device – the device to be used

  • efi_partition – the number of the EFI partition on the device

  • loader – path to the EFI boot loader

  • label – the record label


Executes efibootmgr and returns boot records.


An iterator yielding tuples (boot number, boot record, root device type, device path).

ironic_python_agent.efi_utils.get_partition_path_by_number(device, part_num)[source]

Get partition path (/dev/something) by a partition number on device.

Only works for GPT partition table.

ironic_python_agent.efi_utils.manage_uefi(device, efi_system_part_uuid=None)[source]

Manage the device looking for valid efi bootloaders to update the nvram.

This method checks for valid efi bootloaders in the device, if they exist it updates the nvram using the efibootmgr.

  • device – the device to be checked.

  • efi_system_part_uuid – efi partition uuid.


DeviceNotFound if the efi partition cannot be found.


True - if it founds any efi bootloader and the nvram was updated using the efibootmgr. False - if no efi bootloader is found.


Remove an EFI boot record with efibootmgr.


boot_num – the number of the boot record