linuxPackages: properly propagate features and extraConfig

`kernel.override { features = ... }` didn't work before, now it works as
expected.
This commit is contained in:
Jan Malakhovski
2017-09-17 16:33:47 +02:00
committed by Joachim Fasting
parent 64bf283104
commit 8525b78d05
10 changed files with 25 additions and 64 deletions
+21 -11
View File
@@ -36,6 +36,22 @@ let
lib = stdenv.lib;
# Combine the `features' attribute sets of all the kernel patches.
kernelFeatures = lib.fold (x: y: (x.features or {}) // y) ({
iwlwifi = true;
efiBootStub = true;
needsCifsUtils = true;
netfilterRPFilter = true;
} // features) kernelPatches;
configWithPlatform = kernelPlatform: import ./common-config.nix {
inherit stdenv version kernelPlatform extraConfig;
features = kernelFeatures; # Ensure we know of all extra patches, etc.
};
config = configWithPlatform stdenv.platform;
configCross = configWithPlatform hostPlatform.platform;
kernelConfigFun = baseConfig:
let
configFromPatches =
@@ -115,23 +131,17 @@ let
};
passthru = {
# Combine the `features' attribute sets of all the kernel patches.
features = lib.fold (x: y: (x.features or {}) // y) features kernelPatches;
features = kernelFeatures;
meta = kernel.meta // extraMeta;
passthru = kernel.passthru // (removeAttrs passthru [ "passthru" "meta" ]);
};
configWithPlatform = kernelPlatform: import ./common-config.nix
{ inherit stdenv version kernelPlatform extraConfig;
features = passthru.features; # Ensure we know of all extra patches, etc.
};
config = configWithPlatform stdenv.platform;
configCross = configWithPlatform hostPlatform.platform;
nativeDrv = lib.addPassthru kernel.nativeDrv passthru;
crossDrv = lib.addPassthru kernel.crossDrv passthru;
in if kernel ? crossDrv then nativeDrv // { inherit nativeDrv crossDrv; } else lib.addPassthru kernel passthru
in if kernel ? crossDrv
then nativeDrv // { inherit nativeDrv crossDrv; }
else lib.addPassthru kernel passthru