bootc_kernel_cmdline/
lib.rs

1//! Kernel command line parsing utilities.
2//!
3//! This module provides functionality for parsing and working with kernel command line
4//! arguments, supporting both key-only switches and key-value pairs with proper quote handling.
5//!
6//! The kernel command line is not required to be UTF-8.  The `bytes`
7//! module works on arbitrary byte data and attempts to parse the
8//! command line in the same manner as the kernel itself.
9//!
10//! The `utf8` module performs the same functionality, but requires
11//! all data to be valid UTF-8.
12
13pub mod bytes;
14pub mod utf8;
15
16/// This is used by dracut.
17pub const INITRD_ARG_PREFIX: &str = "rd.";
18/// The kernel argument for configuring the rootfs flags.
19pub const ROOTFLAGS: &str = "rootflags";
20
21#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
22/// Possible outcomes for `add_or_modify` operations.
23pub enum Action {
24    /// The parameter did not exist before and was added
25    Added,
26    /// The parameter existed before, but contained a different value.
27    /// The value was updated to the newly-requested value.
28    Modified,
29    /// The parameter existed before, and contained the same value as
30    /// the newly-requested value.  No modification was made.
31    Existed,
32}