Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

system.requiredKernelConfig: packages contraints #55755

Closed
wants to merge 5 commits into from

Conversation

teto
Copy link
Member

@teto teto commented Feb 14, 2019

This lets packages define meta.requiredKernelConfig that is added to system.requiredKernelConfig when the package belongs to environment.systemPackages.
This checks if the package can work with the booted kernel.
(hopefully the check could be run against an arbitrary kernel).

The hope is to then add a knob that builds a kernel configuration satisfying the installed package constraints.

Motivation for this change

Long term goal is #41103. The intent with the PR is just to start with a smaller scope and concrete code. This is not the definite proposition but the main idea is visible and I hope to trigger some feedback.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

teto added 5 commits March 8, 2019 16:55
This lets packages define a meta.requiredKernelConfig to check for some specific
kernel configurations.

Right now this does it only for the booted kernel (hopefully the required config
could be checked against an arbitrary kernel).

The hope is to then add a knob that builds a configuration (thanks to kernel
structured config) satisfying the constraints.
@GrahamcOfBorg GrahamcOfBorg added 6.topic: stdenv Standard environment 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 1-10 labels Mar 8, 2019
@teto
Copy link
Member Author

teto commented Mar 8, 2019

so I just wonder if the idea could make it into nixos (disabled by default as it's hard to automatically build a correct kernel config) ? then I can refine the implementation (which is a copy/paste hack right now).
In a nutshell, if you set boot.enforceRequiredConfig = true and add openvswitch to systemPackages, nix adds CONFIG_OPENVSWITCH to the config.

@teto teto mentioned this pull request Apr 14, 2019
7 tasks
@lheckemann lheckemann added the 6.topic: kernel The Linux kernel label Apr 14, 2019
@teto teto mentioned this pull request May 2, 2019
10 tasks
@teto
Copy link
Member Author

teto commented Sep 5, 2019

while trying to clean it, I found some flaws, the fix is non trivial else I will submit another proposal in a few weeks.

@teto teto closed this Sep 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: kernel The Linux kernel 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: stdenv Standard environment 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 10.rebuild-linux: 1-10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants