morpheus_bootloader/tui/distro_launcher/
entry.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use alloc::string::String;

#[derive(Clone)]
pub struct BootEntry {
    pub name: String,
    pub kernel_path: String,
    pub initrd_path: Option<String>,
    pub cmdline: String,
    pub root_device: Option<String>,
}

impl BootEntry {
    pub fn new(
        name: String,
        kernel_path: String,
        initrd_path: Option<String>,
        cmdline: String,
    ) -> Self {
        Self {
            name,
            kernel_path,
            initrd_path,
            cmdline,
            root_device: None,
        }
    }

    pub fn with_root(mut self, root: String) -> Self {
        self.root_device = Some(root);
        self
    }
}