linuxPackages: properly propagate features and extraConfig
`kernel.override { features = ... }` didn't work before, now it works as
expected.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user