Skip to main content

Crate boot_loader_spec

Crate boot_loader_spec 

Source
Expand description

Parse and modify Boot Loader Specification (BLS) entry files.

This library implements the UAPI Boot Loader Specification (Type #1 entries) and Fedora/GRUB extensions (grub_class, grub_users, grub_hotkey, grub_arg). Keys uki, uki-url, and profile from the spec are not yet supported.

§Usage

Parse a BLS snippet, optionally modify it with BLSEntry::set or BLSEntry::clear, then serialize with BLSEntry::render.

§Compatibility

Both hyphenated (machine-id, sort-key, devicetree-overlay) and underscore forms are accepted when parsing. Output uses the spec’s hyphenated form for those keys. An entry must contain at least one of linux or efi.

§no_std

Disable the default “std” feature with --no-default-features for a no_std build (requires alloc).

Note: Full-line comments are moved to the header when re-rendering; order of commands and comments is not preserved.

Structs§

BLSEntry
A parsed Boot Loader Spec (Type #1) entry. Holds all standard and Fedora/GRUB keys.

Enums§

BLSKey
BLS and Fedora/GRUB entry keys. Parse from key strings via FromStr (e.g. "linux", "machine-id").
BLSValue
A BLS key value, optionally with an inline comment (text after # on the same line).
ValueSetPolicy
Policy for BLSEntry::set when the key allows multiple values (e.g. initrd, options, grub_class).