Module uki

Module uki 

Source
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§

CoffFileHeader 🔒
DosStub 🔒
PeHeader 🔒
SectionHeader 🔒

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.