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.
Structs§
- Coff
File 🔒Header - DosStub 🔒
- PeHeader 🔒
- Section
Header 🔒
Enums§
- UkiError
- Errors that can occur when parsing UKI files.
Constants§
- PE_
MAGIC 🔒
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_
cmdline - Gets the contents of the .cmdline section of a UKI.
- get_
section - Extracts a raw section from a UKI PE file by name.
- get_
text_ section - Extracts a text section from a UKI PE file by name and validates it as UTF-8.