Skip to content

org.nixos.bootspec.v1 without kernel entry fails to parse #229

Description

@wucke13

I'm currently trying to bootstrap a minimal NixOS system, as small as possible. For that, I try to eliminate the kernel out of the squashfs that supplies the wider nix-store contents after the actual initrd ran through stage 1 of the boot. By the time that this happens, the kernel has already been loaded; the actual kernel image is by definition redundant for the boot process that occurs after the kernel was already booted.

Unfortunately, nixos_init::init fails the to parse the boot.json with this very crate when config.boot.kernel.enable == false, as in that case the kernel key in org.nixos.bootspec.v1 will not be present (see https://github.com/NixOS/nixpkgs/blob/a0374025a863d007d98e3297f6aa46cc3141c2f0/nixos/modules/system/activation/bootspec.nix#L32 ). Thus my question: can the kernel field (see below) become optional?

bootspec/bootspec/src/v1.rs

Lines 106 to 107 in d762893

/// Path to kernel (bzImage) -- $toplevel/kernel
pub kernel: PathBuf,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions