Skip to content

system.boot.kernel: warn about requiredKernelConfig limitations#228000

Closed
ghost wants to merge 1 commit intomasterfrom
unknown repository
Closed

system.boot.kernel: warn about requiredKernelConfig limitations#228000
ghost wants to merge 1 commit intomasterfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Apr 24, 2023

Description of changes

I struggled a lot before realizing that system.boot.kernel.requiredKernelConfig was not only being ignored (due to kernel?features) but wasn't even really checking my requirements against the true kernel configuration.

This commit updates the option documentation to warn others of the limitations I discovered.

Long-term we should probably either remove this option or else have it check the requirements against the true, final .config that was used to build the kernel.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.05 Release Notes (or backporting 22.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

I struggled a lot before realizing that
system.boot.kernel.requiredKernelConfig was not only being ignored
(due to kernel?features) but wasn't even really checking my
requirements against the true kernel configuration.

This commit updates the option documentation to warn others of the
limitations I discovered.

Long-term we should probably either remove this option or else have
it check the requirements against the true, final `.config` that was
used to build the kernel.
@ghost ghost requested a review from dasJ as a code owner April 24, 2023 19:21
@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Apr 24, 2023
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Apr 24, 2023
@teto
Copy link
Copy Markdown
Member

teto commented Apr 24, 2023

I dreamt at some point of being able to check the kernel config against requiredKernelConfig and requiredKernelConfig being loaded from analyzing the installed derivations but options change names between kernel releases (sometimes) and this is hard to check anyway between programs requiring an option as module etc. It would still be valuable IMO in the "meta" attribute of derivations.

@ghost
Copy link
Copy Markdown
Author

ghost commented May 5, 2023

options change names between kernel releases (sometimes)

That's okay! You want a failure when that happens in order to let you know that you need to update the requiredKernelConfig to follow the kernel's name change.

@ghost ghost closed this Oct 22, 2023
@ghost ghost deleted the pr/kernel/warn-about-requiredKernelConfig branch January 23, 2024 06:48
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant