git.iko.soy/typeable/nixpkgs
on master help sign in
linuxPackages_custom: fix missing argument and add test

The required argument 'hostPlatform' was missing from linuxPackages_custom's call to linuxManualConfig. In order to prevent this in the future, this commit adds linuxPackages_custom_tinyconfig_kernel so linuxPackages_custom gets tested. This also adds linuxConfig, to derivate default linux configurations via make defconfig, make tinyconfig, etc. Closes #38034. Signed-off-by: Austin Seipp <aseipp@pobox.com>

commit7f25b26511aef36fdad4fb3999af8ce7c2dfea72 authorRobert Hensing <robert@roberthensing.nl> dateFri 23 Mar 2018, 10:08 (9 years ago) parente1dee4e
2 files changed+32−3
pkgs/os-specific/linux/kernel/manual-config.nix+2 pkgs/top-level/all-packages.nix+30−3
pkgs/os-specific/linux/kernel/manual-config.nix+2
@@ -35,6 +35,8 @@ in {
3535 extraMeta ? {},
3636 # Whether to utilize the controversial import-from-derivation feature to parse the config
3737 allowImportFromDerivation ? false,
38+ # ignored
39+ features ? null,
3840
3941 hostPlatform
4042}:
pkgs/top-level/all-packages.nix+30−3
@@ -13605,12 +13605,25 @@ with pkgs;
1360513605 # Intentionally lacks recurseIntoAttrs, as -rc kernels will quite likely break out-of-tree modules and cause failed Hydra builds.
1360613606 linuxPackages_testing = linuxPackagesFor pkgs.linux_testing;
1360713607
13608− linuxPackages_custom = { version, src, configfile }:
13608+ linuxPackages_custom = { version, src, configfile, allowImportFromDerivation ? true }:
1360913609 recurseIntoAttrs (linuxPackagesFor (pkgs.linuxManualConfig {
13610− inherit version src configfile stdenv;
13611− allowImportFromDerivation = true;
13610+ inherit version src configfile stdenv allowImportFromDerivation;
13611+ inherit (stdenv) hostPlatform;
1361213612 }));
1361313613
13614+ # This serves as a test for linuxPackages_custom
13615+ linuxPackages_custom_tinyconfig_kernel = let
13616+ base = pkgs.linuxPackages.kernel;
13617+ tinyLinuxPackages = pkgs.linuxPackages_custom {
13618+ inherit (base) version src;
13619+ allowImportFromDerivation = false;
13620+ configfile = pkgs.linuxConfig {
13621+ makeTarget = "tinyconfig";
13622+ src = base.src;
13623+ };
13624+ };
13625+ in tinyLinuxPackages.kernel;
13626+
1361413627 # Build a kernel with bcachefs module
1361513628 linuxPackages_testing_bcachefs = recurseIntoAttrs (linuxPackagesFor pkgs.linux_testing_bcachefs);
1361613629
@@ -13648,6 +13661,20 @@ with pkgs;
1364813661
1364913662 # A function to build a manually-configured kernel
1365013663 linuxManualConfig = makeOverridable (callPackage ../os-specific/linux/kernel/manual-config.nix {});
13664+
13665+ # Derive one of the default .config files
13666+ linuxConfig = { src, makeTarget ? "defconfig", name ? "kernel.config" }:
13667+ stdenv.mkDerivation {
13668+ inherit name src;
13669+ buildPhase = ''
13670+ set -x
13671+ make ${makeTarget}
13672+ '';
13673+ installPhase = ''
13674+ cp .config $out
13675+ '';
13676+ };
13677+
1365113678 buildLinux = attrs: callPackage ../os-specific/linux/kernel/generic.nix attrs;
1365213679
1365313680 keyutils = callPackage ../os-specific/linux/keyutils { };