-
-
Notifications
You must be signed in to change notification settings - Fork 15k
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
Meta issue about kernel features dependencies #41103
Comments
Does nixpkgs/nixos/modules/system/boot/kernel.nix Lines 152 to 170 in 9f7eabc
|
@symphorien Your system wouldn't work outside of NixOS for example. He wants to have it as part of the responsibility of the packager, not as part of the person who creates a module. I agree that the packager is the best person to specify required kernel modules. There should also be flags to ignore this feature. |
It is as @coretemp says. Basically I want the kernel config to depend on programs requirement rather than having to specify For instance, if I add the As nixpkgs is crossplatform, I am not sure what the best API would be but the idea fits with nixos mindset imo. |
Interestingly enough, at least for services/programs one can use boot.kernelPatches to achieve this it seems: |
I've started playing with the idea and it makes things easier but the kernel configuration system in nix is too brittle to use this to build the kernel config automatically,
I wanted to do nixos/modules/virtualisation/openvswitch.nix
but that caused some problems so I still manually specify the kernel config, just a bit better via With the current system we might have several contradicting values for CONFIG_OPENVSWITCH, it seems like the current generate-config.pl will just use the last value. It may be good to display a warning if
Also I alternate between building builtin modules (to use with qemu -kernel , this way I don't have to build the initramfs) and typical kernels. But the current system seems to
so one should write in extraConfig sthg akin to "OPENVSWITCH ${if preferBuiltin then "y" else "m"}", there is an opportunity for an alias there. |
Not sure where to post this trick, I just want to write down some experience I've had into merging 2 configs. It turns out that I've had some problems with merging the config from my (development) test kernel and the one from my host. I've tried concating nix's I tried to merge the 2 full configs (from my VM with the experimental settings and the other being my host config with the correct drivers enabled). At first I got surprised that the merge was removing the drivers I desperately wanted but the output explains a bit the results. Comments such as I mention this because with the lack of automated dependency resolution, it can be hard to build the desired .config file and I believe scripts/kconfig/merge_config.sh could prove to be a helpful (interactive) way to fix/help build new kernel configs. |
Now that structured kernel config is available upstream, we can decide on an API. Some random thoughts: Current mechanisms are just checks but I propose to add an option that proactively enforces kernel options.
system.requiredKernelConfig is used in
I would like to update these configs with structured kernel configs (see a bit later on how to use it). I would like packages to be able to communicate their configuration/needs, for instance installing openvswitch should turn on CONFIG_OPENVSWITCH. This should be done independently of the nixos modules as some packages can be installed without modules/overriden etc. Like mininet requires the kernel to support namespaces.
|
closed in favor of #69014 |
Issue description
I develop on a custom kernel so I like to keep its configuration tight to speed up compilation time.
I've recently been dealing with packages that wouldn't work without specific kernel features.
I would like to add to packages a field
kernelFeatures
orrequiredLinuxFeatures
.When this package is added to configuration.nix it should check that the kernel config has "NETNS" enabled. I don't believe it's possible to enable it automatically yet since we don't know the dependencies between the different kernel features (setting CONFIG_NETNS should enable CONFIG_NET but we can't do that yet).
Checking is easier though since one can grep the config and look for NETNS value.
Hopefully someone can build the kernel dependency into the structured linux config #12158
Examples:
The text was updated successfully, but these errors were encountered: