- 
                Notifications
    You must be signed in to change notification settings 
- Fork 62
Open
Description
Per @andreeaflorescu's idea, instead of:
let mut kernel_cmdline = "reboot=k panic=1 pci=off nomodules 8250.nr_uarts=0 \
    i8042.noaux i8042.nomux i8042.nopnp i8042.dumbkbd";
if blocks.has_root_block_device() && !blocks.has_partuuid_root() {
    kernel_cmdline.insert_str("root=/dev/vda")?;
    let flags = if blocks.has_read_only_root() {
        "ro"
    } else {
        "rw"
    };
   kernel_cmdline.insert_str(flags)?;
}(source: firecracker, default cmdline)
we could build the kernel command line using a Rustacean builder:
let kernel_cmdline = Cmdline::default()
    .pci(None)
    .serial(None)
    .root_device(Some(Block { root: true, ro: true, partuuid: partuuid_config }))
    .extra_args("nomodules")?;(Not its final form, merely demonstrative purposes).
This would make cmdline building simpler and more elegant.
Metadata
Metadata
Assignees
Labels
No labels