linuxPackages: properly propagate features
and extraConfig
`kernel.override { features = ... }` didn't work before, now it works as expected.
This commit is contained in:
parent
64bf283104
commit
8525b78d05
@ -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
|
||||
|
@ -8,11 +8,4 @@ import ./generic.nix (args // rec {
|
||||
url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
|
||||
sha256 = "18sxw7mw4fya7381mkah70s3di6b8xxfigjhrhb7zcczrffb4vl9";
|
||||
};
|
||||
|
||||
kernelPatches = args.kernelPatches;
|
||||
|
||||
features.iwlwifi = true;
|
||||
features.efiBootStub = true;
|
||||
features.needsCifsUtils = true;
|
||||
features.netfilterRPFilter = true;
|
||||
} // (args.argsOverride or {}))
|
||||
|
@ -8,11 +8,4 @@ import ./generic.nix (args // rec {
|
||||
url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
|
||||
sha256 = "1lgwgw9yp5ywbylnmahsmqzs98yfq53mvvqqdgp7ljiqg8bxqjh6";
|
||||
};
|
||||
|
||||
kernelPatches = args.kernelPatches;
|
||||
|
||||
features.iwlwifi = true;
|
||||
features.efiBootStub = true;
|
||||
features.needsCifsUtils = true;
|
||||
features.netfilterRPFilter = true;
|
||||
} // (args.argsOverride or {}))
|
||||
|
@ -8,11 +8,4 @@ import ./generic.nix (args // rec {
|
||||
url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
|
||||
sha256 = "0dhm5w7qa1hyqp254r41b4nhf10a8w7sv1mhd16f61inpb41829c";
|
||||
};
|
||||
|
||||
kernelPatches = args.kernelPatches;
|
||||
|
||||
features.iwlwifi = true;
|
||||
features.efiBootStub = true;
|
||||
features.needsCifsUtils = true;
|
||||
features.netfilterRPFilter = true;
|
||||
} // (args.argsOverride or {}))
|
||||
|
@ -27,11 +27,4 @@ import ./generic.nix (args // {
|
||||
repo = "linux-hardened";
|
||||
rev = "${version}.${revision}";
|
||||
};
|
||||
|
||||
kernelPatches = args.kernelPatches;
|
||||
|
||||
features.iwlwifi = true;
|
||||
features.efiBootStub = true;
|
||||
features.needsCifsUtils = true;
|
||||
features.netfilterRPFilter = true;
|
||||
} // (args.argsOverride or {}))
|
||||
|
@ -15,8 +15,6 @@ import ./generic.nix (args // rec {
|
||||
sha256 = "0vqjnkzcbbvyq24w3cryfmw7hhws1xqkkxqcv71szkbqqs6mcr14";
|
||||
};
|
||||
|
||||
kernelPatches = args.kernelPatches;
|
||||
|
||||
extraConfig = ''
|
||||
IPV6 y
|
||||
MPTCP y
|
||||
@ -41,10 +39,6 @@ import ./generic.nix (args // rec {
|
||||
TCP_CONG_OLIA m
|
||||
TCP_CONG_WVEGAS m
|
||||
TCP_CONG_BALIA m
|
||||
'';
|
||||
|
||||
features.iwlwifi = true;
|
||||
features.efiBootStub = true;
|
||||
features.needsCifsUtils = true;
|
||||
features.netfilterRPFilter = true;
|
||||
'' + (args.extraConfig or "");
|
||||
} // (args.argsOverride or {}))
|
||||
|
@ -15,9 +15,9 @@ stdenv.lib.overrideDerivation (import ./generic.nix (args // rec {
|
||||
sha256 = "1ly0x7a43zvig0fv7lc6rpq49pcdb7i9sdb78p4gi5485zap40kb";
|
||||
};
|
||||
|
||||
features.iwlwifi = true;
|
||||
features.needsCifsUtils = true;
|
||||
features.netfilterRPFilter = true;
|
||||
features = {
|
||||
efiBootStub = false;
|
||||
} // (args.features or {});
|
||||
|
||||
extraMeta.hydraPlatforms = [];
|
||||
})) (oldAttrs: {
|
||||
|
@ -14,10 +14,5 @@ import ./generic.nix (args // rec {
|
||||
sha256 = "1dr74i79p8r13522w2ppi8gnjd9bhngc9d2hsn91ji6f5a8fbxx9";
|
||||
}; in "${upstream}/build/linux";
|
||||
|
||||
features.iwlwifi = true;
|
||||
features.efiBootStub = true;
|
||||
features.needsCifsUtils = true;
|
||||
features.netfilterRPFilter = true;
|
||||
|
||||
extraMeta.hydraPlatforms = [];
|
||||
} // (args.argsOverride or {}))
|
||||
|
@ -16,11 +16,6 @@ import ./generic.nix (args // rec {
|
||||
BCACHEFS_FS m
|
||||
'';
|
||||
|
||||
features.iwlwifi = true;
|
||||
features.efiBootStub = true;
|
||||
features.needsCifsUtils = true;
|
||||
features.netfilterRPFilter = true;
|
||||
|
||||
# Should the testing kernels ever be built on Hydra?
|
||||
extraMeta.hydraPlatforms = [];
|
||||
|
||||
|
@ -10,11 +10,6 @@ import ./generic.nix (args // rec {
|
||||
sha256 = "0dhcsjgcy28pyyzwf2s0862p92bwb324kapli2y9n90bw0kl53gi";
|
||||
};
|
||||
|
||||
features.iwlwifi = true;
|
||||
features.efiBootStub = true;
|
||||
features.needsCifsUtils = true;
|
||||
features.netfilterRPFilter = true;
|
||||
|
||||
# Should the testing kernels ever be built on Hydra?
|
||||
extraMeta.hydraPlatforms = [];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user