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
- UAPI Boot Loader Specification (Type #1 entries)
- Fedora: Boot Loader Spec by default (GRUB-specific keys)
Features
- std (default): use the standard library
- no_std: build without
std(requiresalloc). Use--no-default-features.
Usage
Add to your Cargo.toml:
[]
= "0.1"
Parse a BLS snippet, modify it, and render back:
use ;
let text = "title Fedora\nlinux /vmlinuz\noptions root=/dev/sda1 quiet";
let mut entry = parse.unwrap;
entry.set;
let output = entry.render;
Build and test
License
MPL-2.0