linuxPackages: properly propagate `features` and `extraConfig`

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

authored by Jan Malakhovski and committed by Joachim Fasting 8525b78d 64bf2831

+25 -64
+21 -11
pkgs/os-specific/linux/kernel/generic.nix
··· 36 36 37 37 lib = stdenv.lib; 38 38 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 + 39 55 kernelConfigFun = baseConfig: 40 56 let 41 57 configFromPatches = ··· 115 131 }; 116 132 117 133 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; 120 135 121 136 meta = kernel.meta // extraMeta; 122 137 123 138 passthru = kernel.passthru // (removeAttrs passthru [ "passthru" "meta" ]); 124 139 }; 125 140 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 - 134 141 nativeDrv = lib.addPassthru kernel.nativeDrv passthru; 135 142 136 143 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
-7
pkgs/os-specific/linux/kernel/linux-4.12.nix
··· 8 8 url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz"; 9 9 sha256 = "18sxw7mw4fya7381mkah70s3di6b8xxfigjhrhb7zcczrffb4vl9"; 10 10 }; 11 - 12 - kernelPatches = args.kernelPatches; 13 - 14 - features.iwlwifi = true; 15 - features.efiBootStub = true; 16 - features.needsCifsUtils = true; 17 - features.netfilterRPFilter = true; 18 11 } // (args.argsOverride or {}))
-7
pkgs/os-specific/linux/kernel/linux-4.13.nix
··· 8 8 url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz"; 9 9 sha256 = "1lgwgw9yp5ywbylnmahsmqzs98yfq53mvvqqdgp7ljiqg8bxqjh6"; 10 10 }; 11 - 12 - kernelPatches = args.kernelPatches; 13 - 14 - features.iwlwifi = true; 15 - features.efiBootStub = true; 16 - features.needsCifsUtils = true; 17 - features.netfilterRPFilter = true; 18 11 } // (args.argsOverride or {}))
-7
pkgs/os-specific/linux/kernel/linux-4.9.nix
··· 8 8 url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz"; 9 9 sha256 = "0dhm5w7qa1hyqp254r41b4nhf10a8w7sv1mhd16f61inpb41829c"; 10 10 }; 11 - 12 - kernelPatches = args.kernelPatches; 13 - 14 - features.iwlwifi = true; 15 - features.efiBootStub = true; 16 - features.needsCifsUtils = true; 17 - features.netfilterRPFilter = true; 18 11 } // (args.argsOverride or {}))
-7
pkgs/os-specific/linux/kernel/linux-hardened-copperhead.nix
··· 27 27 repo = "linux-hardened"; 28 28 rev = "${version}.${revision}"; 29 29 }; 30 - 31 - kernelPatches = args.kernelPatches; 32 - 33 - features.iwlwifi = true; 34 - features.efiBootStub = true; 35 - features.needsCifsUtils = true; 36 - features.netfilterRPFilter = true; 37 30 } // (args.argsOverride or {}))
+1 -7
pkgs/os-specific/linux/kernel/linux-mptcp.nix
··· 15 15 sha256 = "0vqjnkzcbbvyq24w3cryfmw7hhws1xqkkxqcv71szkbqqs6mcr14"; 16 16 }; 17 17 18 - kernelPatches = args.kernelPatches; 19 - 20 18 extraConfig = '' 21 19 IPV6 y 22 20 MPTCP y ··· 41 39 TCP_CONG_OLIA m 42 40 TCP_CONG_WVEGAS m 43 41 TCP_CONG_BALIA m 44 - ''; 45 42 46 - features.iwlwifi = true; 47 - features.efiBootStub = true; 48 - features.needsCifsUtils = true; 49 - features.netfilterRPFilter = true; 43 + '' + (args.extraConfig or ""); 50 44 } // (args.argsOverride or {}))
+3 -3
pkgs/os-specific/linux/kernel/linux-rpi.nix
··· 15 15 sha256 = "1ly0x7a43zvig0fv7lc6rpq49pcdb7i9sdb78p4gi5485zap40kb"; 16 16 }; 17 17 18 - features.iwlwifi = true; 19 - features.needsCifsUtils = true; 20 - features.netfilterRPFilter = true; 18 + features = { 19 + efiBootStub = false; 20 + } // (args.features or {}); 21 21 22 22 extraMeta.hydraPlatforms = []; 23 23 })) (oldAttrs: {
-5
pkgs/os-specific/linux/kernel/linux-samus-4.12.nix
··· 14 14 sha256 = "1dr74i79p8r13522w2ppi8gnjd9bhngc9d2hsn91ji6f5a8fbxx9"; 15 15 }; in "${upstream}/build/linux"; 16 16 17 - features.iwlwifi = true; 18 - features.efiBootStub = true; 19 - features.needsCifsUtils = true; 20 - features.netfilterRPFilter = true; 21 - 22 17 extraMeta.hydraPlatforms = []; 23 18 } // (args.argsOverride or {}))
-5
pkgs/os-specific/linux/kernel/linux-testing-bcachefs.nix
··· 16 16 BCACHEFS_FS m 17 17 ''; 18 18 19 - features.iwlwifi = true; 20 - features.efiBootStub = true; 21 - features.needsCifsUtils = true; 22 - features.netfilterRPFilter = true; 23 - 24 19 # Should the testing kernels ever be built on Hydra? 25 20 extraMeta.hydraPlatforms = []; 26 21
-5
pkgs/os-specific/linux/kernel/linux-testing.nix
··· 10 10 sha256 = "0dhcsjgcy28pyyzwf2s0862p92bwb324kapli2y9n90bw0kl53gi"; 11 11 }; 12 12 13 - features.iwlwifi = true; 14 - features.efiBootStub = true; 15 - features.needsCifsUtils = true; 16 - features.netfilterRPFilter = true; 17 - 18 13 # Should the testing kernels ever be built on Hydra? 19 14 extraMeta.hydraPlatforms = []; 20 15