Skip to content

Use conditionals for all architecture dependent initrd modules #109280

@primeos

Description

@primeos

This is a meta issue to track the changes that are required since we've merged #78430 (resulted in some channel blockers: #109252).

This is important for everything that is part of modulesClosure (allowMissing is now false):

  # Determine the set of modules that we need to mount the root FS.
  modulesClosure = pkgs.makeModulesClosure {
    rootModules = config.boot.initrd.availableKernelModules ++ config.boot.initrd.kernelModules;
    kernel = modulesTree;
    firmware = firmware;
    allowMissing = false;
  };

But for missing firmware we only print a warning: 49130f9

Relevant commits:

Open/unresolved issues to consider:

  • This breaking change can be problematic for users
    • E.g. nixos/stage-1: Do not allow missing kernel modules in initrd #78430 (comment): "This makes it really annoying to use NixOS with a custom built kernel. There is a whole bunch of modules that get added to the initrd "by default" in nixos/modules/system/boot/kernel.nix and can't easily be removed:"
    • Can break on uncommon architectures (AFAIK we only test AMD64 and AArch64 on Hydra)
    • Can break with a custom kernel configuration
    • Can break with existing configs (that include typos or modules that aren't available on $arch)

Potential improvements:

  • Should we add a NixOS option for allowMissing that defaults to false?
    • Reasoning for this idea: We can fix regressions on Hydra and users could contribute fixes for other architectures but we cannot consider all custom kernel configurations (and minimal kernel configs will miss a lot of modules!)
  • The error message is not great
    • Why does it suddenly fail and not before -> maybe we could/should add an explanation and instructions (or link to this issue)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    6.topic: nixosIssues or PRs affecting NixOS modules, or package usability issues specific to NixOS
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions