boot-loader-spec 0.1.5

Parses and manipulates Boot Loader Spec entries
Documentation

boot-loader-spec

Rust library for parsing and modifying Boot Loader Specification (BLS) entry files. Supports standard Type #1 entries and Fedora/GRUB extensions (grub_class, grub_users, grub_hotkey, grub_arg).

Specifications

Features

  • std (default): use the standard library
  • no_std: build without std (requires alloc). Use --no-default-features.

Usage

Add to your Cargo.toml:

[dependencies]
boot-loader-spec = "0.1"

Parse a BLS snippet, modify it, and render back:

use boot_loader_spec::{BLSEntry, BLSKey, ValueSetPolicy};

let text = "title Fedora\nlinux /vmlinuz\noptions root=/dev/sda1 quiet";
let mut entry = BLSEntry::parse(text).unwrap();

entry.set(BLSKey::Options, "splash".into(), None, ValueSetPolicy::Append);
let output = entry.render();

Build and test

cargo build
cargo test
cargo doc --open

License

MPL-2.0