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>
This commit is contained in:
parent
e1dee4efcb
commit
7f25b26511
2 changed files with 32 additions and 3 deletions
|
@ -35,6 +35,8 @@ in {
|
|||
extraMeta ? {},
|
||||
# Whether to utilize the controversial import-from-derivation feature to parse the config
|
||||
allowImportFromDerivation ? false,
|
||||
# ignored
|
||||
features ? null,
|
||||
|
||||
hostPlatform
|
||||
}:
|
||||
|
|
|
@ -13605,12 +13605,25 @@ with pkgs;
|
|||
# Intentionally lacks recurseIntoAttrs, as -rc kernels will quite likely break out-of-tree modules and cause failed Hydra builds.
|
||||
linuxPackages_testing = linuxPackagesFor pkgs.linux_testing;
|
||||
|
||||
linuxPackages_custom = { version, src, configfile }:
|
||||
linuxPackages_custom = { version, src, configfile, allowImportFromDerivation ? true }:
|
||||
recurseIntoAttrs (linuxPackagesFor (pkgs.linuxManualConfig {
|
||||
inherit version src configfile stdenv;
|
||||
allowImportFromDerivation = true;
|
||||
inherit version src configfile stdenv allowImportFromDerivation;
|
||||
inherit (stdenv) hostPlatform;
|
||||
}));
|
||||
|
||||
# This serves as a test for linuxPackages_custom
|
||||
linuxPackages_custom_tinyconfig_kernel = let
|
||||
base = pkgs.linuxPackages.kernel;
|
||||
tinyLinuxPackages = pkgs.linuxPackages_custom {
|
||||
inherit (base) version src;
|
||||
allowImportFromDerivation = false;
|
||||
configfile = pkgs.linuxConfig {
|
||||
makeTarget = "tinyconfig";
|
||||
src = base.src;
|
||||
};
|
||||
};
|
||||
in tinyLinuxPackages.kernel;
|
||||
|
||||
# Build a kernel with bcachefs module
|
||||
linuxPackages_testing_bcachefs = recurseIntoAttrs (linuxPackagesFor pkgs.linux_testing_bcachefs);
|
||||
|
||||
|
@ -13648,6 +13661,20 @@ with pkgs;
|
|||
|
||||
# A function to build a manually-configured kernel
|
||||
linuxManualConfig = makeOverridable (callPackage ../os-specific/linux/kernel/manual-config.nix {});
|
||||
|
||||
# Derive one of the default .config files
|
||||
linuxConfig = { src, makeTarget ? "defconfig", name ? "kernel.config" }:
|
||||
stdenv.mkDerivation {
|
||||
inherit name src;
|
||||
buildPhase = ''
|
||||
set -x
|
||||
make ${makeTarget}
|
||||
'';
|
||||
installPhase = ''
|
||||
cp .config $out
|
||||
'';
|
||||
};
|
||||
|
||||
buildLinux = attrs: callPackage ../os-specific/linux/kernel/generic.nix attrs;
|
||||
|
||||
keyutils = callPackage ../os-specific/linux/keyutils { };
|
||||
|
|
Loading…
Reference in a new issue