Skip to content

nixos-init: requires a modular kernel #445803

@MatthewCroughan

Description

@MatthewCroughan

If a Linux kernel does not have /proc/sys/kernel/modprobe due to having CONFIG_MODULES=n or unset in their Kconfig, then nixos-init will crash, where the traditional activation will not

const MODPROBE_PATH: &str = "/proc/sys/kernel/modprobe";
fs::write(
MODPROBE_PATH,
modprobe_binary.as_ref().as_os_str().as_encoded_bytes(),
)
.with_context(|| {
format!(
"Failed to populate modprobe path with {}",
modprobe_binary.as_ref().display()
)
})?;
Ok(())

The error you can observe if you built a non-modular kernel is as follows:

[  OK  ] Reached target Switch Root.
         Starting Switch Root...
initrd-init[224]: Failed to populate modprobe path with /nix/store/sivh663fa3pjz7mh8v8g5ilhl7kwvxr4-kmod-aarch64-unknown-linux-musl-31/bin/modprobe: No such file or directory (os error 2).
[FAILED] Failed to start Switch Root.
systemd[1]: Failed to start Switch Root..service' for details.

This is relevant to #428908

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions