# boot-loader-spec
Rust library for parsing and modifying [Boot Loader Specification](https://uapi-group.org/specifications/specs/boot_loader_specification/) (BLS) entry files. Supports standard Type #1 entries and [Fedora/GRUB extensions](https://fedoraproject.org/wiki/Changes/BootLoaderSpecByDefault) (`grub_class`, `grub_users`, `grub_hotkey`, `grub_arg`).
## Specifications
- [UAPI Boot Loader Specification](https://uapi-group.org/specifications/specs/boot_loader_specification/) (Type #1 entries)
- [Fedora: Boot Loader Spec by default](https://fedoraproject.org/wiki/Changes/BootLoaderSpecByDefault) (GRUB-specific keys)
## Features
- **std** (default): use the standard library
- **no_std**: build without `std` (requires `alloc`). Use `--no-default-features`.
## Usage
Add to your `Cargo.toml`:
```toml
[dependencies]
boot-loader-spec = "0.1"
```
Parse a BLS snippet, modify it, and render back:
```rust
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
```bash
cargo build
cargo test
cargo doc --open
```
## License
MPL-2.0