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?
|
/// Path to kernel (bzImage) -- $toplevel/kernel |
|
pub kernel: PathBuf, |
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::initfails the to parse theboot.jsonwith this very crate whenconfig.boot.kernel.enable == false, as in that case thekernelkey inorg.nixos.bootspec.v1will not be present (see https://github.com/NixOS/nixpkgs/blob/a0374025a863d007d98e3297f6aa46cc3141c2f0/nixos/modules/system/activation/bootspec.nix#L32 ). Thus my question: can thekernelfield (see below) become optional?bootspec/bootspec/src/v1.rs
Lines 106 to 107 in d762893