summary refs log tree commit diff
path: root/lib/kernel.nix
AgeCommit message (Collapse)AuthorFilesLines
2023-05-01lib.kernel.unset: initAlyssa Ross1-3/+4
Previously, there was no way to unset an option when overriding a kernel, apart from writing out the attrset yourself. Now it's possible with lib.mkForce lib.kernel.unset. It's important to be able to do this, because setting an option in the override may cause other options to become unused, which would fail the config build unless they were overridden too.
2020-05-22Merge pull request #84032 from teto/fix_kernel_mergeFlorian Klink1-4/+4
Fix kernel configuration merge
2020-05-08linux/hardened: move files into directoryEmily1-1/+1
2020-04-01kernel: fix config generationMatthieu Coudron1-4/+4
Addresses https://github.com/NixOS/nixpkgs/issues/71803: Kernel options are not merged as described, especially the "optional" aspects. The error silences legitimate warnings.
2019-10-01lib.kernel: scoped whenXXX helpersMatthieu Coudron1-0/+10
whenAtLeast/whenBetween are made available in lib/kernel.nix but are now scoped under whenXXX.
2019-10-01lib.kernel: make publicMatthieu Coudron1-6/+1
Remove the "version" parameter in order to make it more widely available. Starts making some kernel configuration helpers available. The intent is to be able to better build and check the linux kernel configuration.
2019-08-28treewide: remove redundant recvolth1-1/+1
2019-01-28linux: convert hardened-config to a structured oneMatthieu Coudron1-1/+6
2019-01-28linux: ability to merge structured configsMatthieu Coudron1-49/+8
This should make the composability of kernel configurations more straigthforward. - now distinguish freeform options from tristate ones - will look for a structured config in kernelPatches too one can now access the structuredConfig from a kernel via linux_test.configfile.structuredConfig in order to reinject it into another kernel, no need to rewrite the config from scratch The following merge strategies are used in case of conflict: -- freeform items must be equal or they conflict (mergeEqualOption) -- for tristate (y/m/n) entries, I use the mergeAnswer strategy which takes the best available value, "best" being defined by the user (by default "y" > "m" > "n", e.g. if one entry is both marked "y" and "n", "y" wins) -- if one item is both marked optional/mandatory, mandatory wins (mergeFalseByDefault)
2018-06-30linux: translate config to structured configDan Peebles1-0/+57
Instead of using a string to describe kernel config, use a nix attribute set, then converted to a string. - allows to override the config, aka convert 'yes' into 'modules' or vice-versa - while for now merging different configs is still crude (last spec wins), at least there should be only one CONFIG_XYZ value compared to the current string config where the first defined would be used and others ignored. [initial idea by copumpkin in 2016, a major rebase to 2018 by teto]