Expand description
Unified Kernel Image (UKI) parsing and metadata extraction.
This module provides functionality to parse PE (Portable Executable) format UKI files and extract embedded sections like .osrel and .cmdline. It implements the Boot Loader Specification Type 2 requirements for UKI boot entries, including extraction of boot labels from os-release information embedded in the UKI binary.
Enums§
- UkiError
- Errors that can occur when parsing UKI files.
Functions§
- get_
boot_ label - Gets an appropriate label for display in the boot menu for the given UKI image, according to the “Type #2 EFI Unified Kernel Images” section in the Boot Loader Specification. This will be based on the “PRETTY_NAME” and “VERSION_ID” fields found in the os-release file (falling back to “ID” and/or “VERSION” if they are not present).
- get_
boot_ label_ buffered - Buffered version of
get_boot_label. - get_
cmdline - Gets the contents of the .cmdline section of a UKI.
- get_
cmdline_ buffered - Buffered version of
get_cmdline. Seeget_cmdlinefor details. - get_
section - Extracts a raw section from a UKI PE file by name.
- get_
section_ buffered - Buffered version of
get_section. - get_
text_ section - Extracts a text section from a UKI PE file by name and validates it as UTF-8.
- get_
text_ section_ buffered - Buffered version of
get_text_section.