Skip to main content

Tools for ovmf / armvirt firmware volumes

This is a small collection of tools for edk2 firmware images. They support decoding and printing the content of firmware volumes. Variable stores (OVMF_VARS.fd) can be modified, for example to enroll secure boot certificates.

virt-fw-dump

Decodes and prints the content of firmware volumes.

Usage: virt-fw-dump -i <file>.

Try virt-fw-dump --help for more info, there are some options to filter output.

virt-fw-vars

Print and edit variable store volumes. Currently focused on enrolling certificates and enabling secure boot.

Print variables: virt-fw-vars -i <file> --print.

Enroll certificates:

virt-fw-vars \
    --input <template> \
    --output <vars> \
    --enroll-redhat \
    --secure-boot

Try virt-fw-vars --help for more usage information.

virt-fw-vars can handle edk2 variable stores (which are flash firmware volumes) and AWS uefi variable stores. The input format is detected automatically and the same format is used for output.

Working with edk2 variable stores requires a firmware volume as input. Typically the OVMF_VARS.fd file created when building OVMF is used for that (it is an empty variable store).

aws variable stores can also be created from scratch and written to a file with using the --output-aws option.

virt-fw-sigdb

Print and edit efi signature database files, example:

virt-fw-sigdb -i /etc/pki/ca-trust/extracted/edk2/cacerts.bin --print

Try virt-fw-sigdb --help for more usage information.

host-efi-vars

Read efi variables from linux efivarfs and decode/print them.

kernel-bootcfg

Manage efi boot configuration for UKIs (unified kernel images) when using direkt boot (without boot loader like grub or systemd-boot).

pe-dumpinfo

Information dump for pe (the format used by efi) binaries.

pe-listsigs

List signatures and certificate chain for pe binaries. Can also extract certificates & signatures.

using the python modules

There isn't much documentation yet, sorry. Best code reads to get started are probably the test cases (see tests/tests.py) and the code for the virt-fw-vars utility (see virt/firmware/vars.py).

install

Release: pip3 install virt-firmware

Snapshot: pip3 install git+https://gitlab.com/kraxel/virt-firmware.git

TODO list

  • Add more documentation.

contributing

I take MRs.

There is an AI review bot active on the repo which will comment on MRs. It is good at spell checking. Sometimes it offers useful suggestions or catches inconsistencies in the patches. Sometimes it asks for stupid stuff like careful error checking in test cases. Sometimes it suggests to check for error conditions which can not happen, but the bot is apparently not clever enough to see that. Sometimes it suggests code reorganizations where it is more a matter of taste or personal preference whenever you take the one or the other way.

So, don't take the bot too serious.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

virt_firmware-26.8.tar.gz (163.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

virt_firmware-26.8-py3-none-any.whl (160.3 kB view details)

Uploaded Python 3

File details

Details for the file virt_firmware-26.8.tar.gz.

File metadata

  • Download URL: virt_firmware-26.8.tar.gz
  • Upload date:
  • Size: 163.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for virt_firmware-26.8.tar.gz
Algorithm Hash digest
SHA256 3a2bd9ffc58ee98a3ca2d4d1e682b53615142449ee2d883384d0555afb61a01e
MD5 7d65aa4677dba257f4514e0d12034e20
BLAKE2b-256 f0ebc62cf4b5fe53db4994fbecf1aa962c41d9548bb055e0071d26ae9f14fc56

See more details on using hashes here.

File details

Details for the file virt_firmware-26.8-py3-none-any.whl.

File metadata

  • Download URL: virt_firmware-26.8-py3-none-any.whl
  • Upload date:
  • Size: 160.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for virt_firmware-26.8-py3-none-any.whl
Algorithm Hash digest
SHA256 b657615c1e51da4c390e48dd158acb2f02855034fefb92ed4ff8b48fa6d798e4
MD5 b98e356e89c97a0fad01850ac0a7f9ae
BLAKE2b-256 6ad862ff0fbc42e570f05e4e1d6f6d22f76d26e56d1b67dbe0154b234d9cbf12

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page