diff options
author | Bernardo Meurer <bernardo@meurer.org> | 2021-07-11 21:58:16 -0700 |
---|---|---|
committer | Bernardo Meurer <bernardo@meurer.org> | 2021-07-12 10:39:52 -0700 |
commit | ea167e8ccbcae6a3378e622255d9705d26f33058 (patch) | |
tree | 78a30854a96fadb0bfda768739c1b1a37158dc66 /pkgs/os-specific/linux/kernel/generic.nix | |
parent | 89deec56234511babe7478a44f684afcec83b394 (diff) |
buildLinux: take and propagate extraMakeFlags
This is just for practicity, as it allows users of buildLinux to pass along extra flags they need in the kernel's make invocation. This makes, for example, supporting LLVM _much_ easier, and could enable us in the future to provide clang-built kernels.
Diffstat (limited to 'pkgs/os-specific/linux/kernel/generic.nix')
-rw-r--r-- | pkgs/os-specific/linux/kernel/generic.nix | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/pkgs/os-specific/linux/kernel/generic.nix b/pkgs/os-specific/linux/kernel/generic.nix index f208da7f30ec7..29557b8d9e2ee 100644 --- a/pkgs/os-specific/linux/kernel/generic.nix +++ b/pkgs/os-specific/linux/kernel/generic.nix @@ -21,6 +21,9 @@ , # Legacy overrides to the intermediate kernel config, as string extraConfig ? "" + # Additional make flags passed to kbuild +, extraMakeFlags ? [] + , # kernel intermediate config overrides, as a set structuredExtraConfig ? {} @@ -97,7 +100,7 @@ let in lib.concatStringsSep "\n" ([baseConfigStr] ++ configFromPatches); configfile = stdenv.mkDerivation { - inherit ignoreConfigErrors autoModules preferBuiltin kernelArch; + inherit ignoreConfigErrors autoModules preferBuiltin kernelArch extraMakeFlags; pname = "linux-config"; inherit version; @@ -116,7 +119,8 @@ let # e.g. "bzImage" kernelTarget = stdenv.hostPlatform.linux-kernel.target; - makeFlags = lib.optionals (stdenv.hostPlatform.linux-kernel ? makeFlags) stdenv.hostPlatform.linux-kernel.makeFlags; + makeFlags = lib.optionals (stdenv.hostPlatform.linux-kernel ? makeFlags) stdenv.hostPlatform.linux-kernel.makeFlags + ++ extraMakeFlags; prePatch = kernel.prePatch + '' # Patch kconfig to print "###" after every question so that @@ -136,7 +140,8 @@ let export HOSTLD=$LD_FOR_BUILD # Get a basic config file for later refinement with $generateConfig. - make -C . O="$buildRoot" $kernelBaseConfig \ + make $makeFlags \ + -C . O="$buildRoot" $kernelBaseConfig \ ARCH=$kernelArch \ HOSTCC=$HOSTCC HOSTCXX=$HOSTCXX HOSTAR=$HOSTAR HOSTLD=$HOSTLD \ CC=$CC OBJCOPY=$OBJCOPY OBJDUMP=$OBJDUMP READELF=$READELF \ @@ -176,7 +181,7 @@ let }; # end of configfile derivation kernel = (callPackage ./manual-config.nix {}) { - inherit version modDirVersion src kernelPatches randstructSeed lib stdenv extraMeta configfile; + inherit version modDirVersion src kernelPatches randstructSeed lib stdenv extraMakeFlags extraMeta configfile; config = { CONFIG_MODULES = "y"; CONFIG_FW_LOADER = "m"; }; }; |