git.iko.soy/typeable/nixpkgs
on master help sign in
linuxPackages: properly propagate `features` and `extraConfig`

`kernel.override { features = ... }` didn't work before, now it works as expected.

commit8525b78d054ac7ef2c43057d54403846b2d07ccc authorJan Malakhovski <oxij@oxij.org> dateFri 15 Sep 2017, 21:07 (9 years ago) parent64bf283
10 files changed+25−64
pkgs/os-specific/linux/kernel/generic.nix+21−11 pkgs/os-specific/linux/kernel/linux-4.12.nix−7 pkgs/os-specific/linux/kernel/linux-4.13.nix−7 pkgs/os-specific/linux/kernel/linux-4.9.nix−7 pkgs/os-specific/linux/kernel/linux-hardened-copperhead.nix−7 pkgs/os-specific/linux/kernel/linux-mptcp.nix+1−7 pkgs/os-specific/linux/kernel/linux-rpi.nix+3−3 pkgs/os-specific/linux/kernel/linux-samus-4.12.nix−5 pkgs/os-specific/linux/kernel/linux-testing-bcachefs.nix−5 pkgs/os-specific/linux/kernel/linux-testing.nix−5
pkgs/os-specific/linux/kernel/generic.nix+21−11
@@ -36,6 +36,22 @@ let
3636
3737 lib = stdenv.lib;
3838
39+ # Combine the `features' attribute sets of all the kernel patches.
40+ kernelFeatures = lib.fold (x: y: (x.features or {}) // y) ({
41+ iwlwifi = true;
42+ efiBootStub = true;
43+ needsCifsUtils = true;
44+ netfilterRPFilter = true;
45+ } // features) kernelPatches;
46+
47+ configWithPlatform = kernelPlatform: import ./common-config.nix {
48+ inherit stdenv version kernelPlatform extraConfig;
49+ features = kernelFeatures; # Ensure we know of all extra patches, etc.
50+ };
51+
52+ config = configWithPlatform stdenv.platform;
53+ configCross = configWithPlatform hostPlatform.platform;
54+
3955 kernelConfigFun = baseConfig:
4056 let
4157 configFromPatches =
@@ -115,23 +131,17 @@ let
115131 };
116132
117133 passthru = {
118− # Combine the `features' attribute sets of all the kernel patches.
119− features = lib.fold (x: y: (x.features or {}) // y) features kernelPatches;
134+ features = kernelFeatures;
120135
121136 meta = kernel.meta // extraMeta;
122137
123138 passthru = kernel.passthru // (removeAttrs passthru [ "passthru" "meta" ]);
124139 };
125140
126− configWithPlatform = kernelPlatform: import ./common-config.nix
127− { inherit stdenv version kernelPlatform extraConfig;
128− features = passthru.features; # Ensure we know of all extra patches, etc.
129− };
130−
131− config = configWithPlatform stdenv.platform;
132− configCross = configWithPlatform hostPlatform.platform;
133−
134141 nativeDrv = lib.addPassthru kernel.nativeDrv passthru;
135142
136143 crossDrv = lib.addPassthru kernel.crossDrv passthru;
137−in if kernel ? crossDrv then nativeDrv // { inherit nativeDrv crossDrv; } else lib.addPassthru kernel passthru
144+
145+in if kernel ? crossDrv
146+ then nativeDrv // { inherit nativeDrv crossDrv; }
147+ else lib.addPassthru kernel passthru
pkgs/os-specific/linux/kernel/linux-4.12.nix−7
@@ -8,11 +8,4 @@ import ./generic.nix (args // rec {
88 url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
99 sha256 = "18sxw7mw4fya7381mkah70s3di6b8xxfigjhrhb7zcczrffb4vl9";
1010 };
11−
12− kernelPatches = args.kernelPatches;
13−
14− features.iwlwifi = true;
15− features.efiBootStub = true;
16− features.needsCifsUtils = true;
17− features.netfilterRPFilter = true;
1811} // (args.argsOverride or {}))
pkgs/os-specific/linux/kernel/linux-4.13.nix−7
@@ -8,11 +8,4 @@ import ./generic.nix (args // rec {
88 url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
99 sha256 = "1lgwgw9yp5ywbylnmahsmqzs98yfq53mvvqqdgp7ljiqg8bxqjh6";
1010 };
11−
12− kernelPatches = args.kernelPatches;
13−
14− features.iwlwifi = true;
15− features.efiBootStub = true;
16− features.needsCifsUtils = true;
17− features.netfilterRPFilter = true;
1811} // (args.argsOverride or {}))
pkgs/os-specific/linux/kernel/linux-4.9.nix−7
@@ -8,11 +8,4 @@ import ./generic.nix (args // rec {
88 url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
99 sha256 = "0dhm5w7qa1hyqp254r41b4nhf10a8w7sv1mhd16f61inpb41829c";
1010 };
11−
12− kernelPatches = args.kernelPatches;
13−
14− features.iwlwifi = true;
15− features.efiBootStub = true;
16− features.needsCifsUtils = true;
17− features.netfilterRPFilter = true;
1811} // (args.argsOverride or {}))
pkgs/os-specific/linux/kernel/linux-hardened-copperhead.nix−7
@@ -27,11 +27,4 @@ import ./generic.nix (args // {
2727 repo = "linux-hardened";
2828 rev = "${version}.${revision}";
2929 };
30−
31− kernelPatches = args.kernelPatches;
32−
33− features.iwlwifi = true;
34− features.efiBootStub = true;
35− features.needsCifsUtils = true;
36− features.netfilterRPFilter = true;
3730} // (args.argsOverride or {}))
pkgs/os-specific/linux/kernel/linux-mptcp.nix+1−7
@@ -15,8 +15,6 @@ import ./generic.nix (args // rec {
1515 sha256 = "0vqjnkzcbbvyq24w3cryfmw7hhws1xqkkxqcv71szkbqqs6mcr14";
1616 };
1717
18− kernelPatches = args.kernelPatches;
19−
2018 extraConfig = ''
2119 IPV6 y
2220 MPTCP y
@@ -41,10 +39,6 @@ import ./generic.nix (args // rec {
4139 TCP_CONG_OLIA m
4240 TCP_CONG_WVEGAS m
4341 TCP_CONG_BALIA m
44− '';
4542
46− features.iwlwifi = true;
47− features.efiBootStub = true;
48− features.needsCifsUtils = true;
49− features.netfilterRPFilter = true;
43+ '' + (args.extraConfig or "");
5044} // (args.argsOverride or {}))
pkgs/os-specific/linux/kernel/linux-rpi.nix+3−3
@@ -15,9 +15,9 @@ stdenv.lib.overrideDerivation (import ./generic.nix (args // rec {
1515 sha256 = "1ly0x7a43zvig0fv7lc6rpq49pcdb7i9sdb78p4gi5485zap40kb";
1616 };
1717
18− features.iwlwifi = true;
19− features.needsCifsUtils = true;
20− features.netfilterRPFilter = true;
18+ features = {
19+ efiBootStub = false;
20+ } // (args.features or {});
2121
2222 extraMeta.hydraPlatforms = [];
2323})) (oldAttrs: {
pkgs/os-specific/linux/kernel/linux-samus-4.12.nix−5
@@ -14,10 +14,5 @@ import ./generic.nix (args // rec {
1414 sha256 = "1dr74i79p8r13522w2ppi8gnjd9bhngc9d2hsn91ji6f5a8fbxx9";
1515 }; in "${upstream}/build/linux";
1616
17− features.iwlwifi = true;
18− features.efiBootStub = true;
19− features.needsCifsUtils = true;
20− features.netfilterRPFilter = true;
21−
2217 extraMeta.hydraPlatforms = [];
2318} // (args.argsOverride or {}))
pkgs/os-specific/linux/kernel/linux-testing-bcachefs.nix−5
@@ -16,11 +16,6 @@ import ./generic.nix (args // rec {
1616 BCACHEFS_FS m
1717 '';
1818
19− features.iwlwifi = true;
20− features.efiBootStub = true;
21− features.needsCifsUtils = true;
22− features.netfilterRPFilter = true;
23−
2419 # Should the testing kernels ever be built on Hydra?
2520 extraMeta.hydraPlatforms = [];
2621
pkgs/os-specific/linux/kernel/linux-testing.nix−5
@@ -10,11 +10,6 @@ import ./generic.nix (args // rec {
1010 sha256 = "0dhcsjgcy28pyyzwf2s0862p92bwb324kapli2y9n90bw0kl53gi";
1111 };
1212
13− features.iwlwifi = true;
14− features.efiBootStub = true;
15− features.needsCifsUtils = true;
16− features.netfilterRPFilter = true;
17−
1813 # Should the testing kernels ever be built on Hydra?
1914 extraMeta.hydraPlatforms = [];
2015