Merge master into staging-next

This commit is contained in:
github-actions[bot]
2021-01-18 01:16:03 +00:00
committed by GitHub
270 changed files with 1545 additions and 952 deletions
@@ -10,14 +10,14 @@
# hardware problems with a new one.
# Configuration
{ stdenv, version
{ lib, stdenv, version
, features ? { grsecurity = false; xen_dom0 = false; }
}:
with stdenv.lib;
with stdenv.lib.kernel;
with (stdenv.lib.kernel.whenHelpers version);
with lib;
with lib.kernel;
with (lib.kernel.whenHelpers version);
let
+4 -6
View File
@@ -6,6 +6,7 @@
, gmp ? null
, libmpc ? null
, mpfr ? null
, lib
, stdenv
, # The kernel source tarball.
@@ -66,9 +67,6 @@
assert stdenv.isLinux;
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;
@@ -81,7 +79,7 @@ let
} // features) kernelPatches;
commonStructuredConfig = import ./common-config.nix {
inherit stdenv version ;
inherit lib stdenv version;
features = kernelFeatures; # Ensure we know of all extra patches, etc.
};
@@ -113,7 +111,7 @@ let
depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [ perl gmp libmpc mpfr ]
++ lib.optionals (stdenv.lib.versionAtLeast version "4.16") [ bison flex ];
++ lib.optionals (lib.versionAtLeast version "4.16") [ bison flex ];
platformName = stdenv.hostPlatform.platform.name;
# e.g. "defconfig"
@@ -173,7 +171,7 @@ let
}; # end of configfile derivation
kernel = (callPackage ./manual-config.nix {}) {
inherit version modDirVersion src kernelPatches randstructSeed stdenv extraMeta configfile;
inherit version modDirVersion src kernelPatches randstructSeed lib stdenv extraMeta configfile;
config = { CONFIG_MODULES = "y"; CONFIG_FW_LOADER = "m"; };
};
@@ -8,11 +8,11 @@
#
# See also <nixos/modules/profiles/hardened.nix>
{ stdenv, version }:
{ lib, stdenv, version }:
with stdenv.lib;
with stdenv.lib.kernel;
with (stdenv.lib.kernel.whenHelpers version);
with lib;
with lib.kernel;
with (lib.kernel.whenHelpers version);
assert (versionAtLeast version "4.9");
+2 -2
View File
@@ -1,6 +1,6 @@
{ stdenv, buildPackages, fetchurl, perl, buildLinux, modDirVersionArg ? null, ... } @ args:
{ lib, stdenv, buildPackages, fetchurl, perl, buildLinux, modDirVersionArg ? null, ... } @ args:
with stdenv.lib;
with lib;
buildLinux (args // rec {
version = "4.14.215";
+2 -2
View File
@@ -1,6 +1,6 @@
{ stdenv, buildPackages, fetchurl, perl, buildLinux, modDirVersionArg ? null, ... } @ args:
{ lib, stdenv, buildPackages, fetchurl, perl, buildLinux, modDirVersionArg ? null, ... } @ args:
with stdenv.lib;
with lib;
buildLinux (args // rec {
version = "4.19.167";
+2 -2
View File
@@ -1,6 +1,6 @@
{ stdenv, buildPackages, fetchurl, perl, buildLinux, modDirVersionArg ? null, ... } @ args:
{ lib, stdenv, buildPackages, fetchurl, perl, buildLinux, modDirVersionArg ? null, ... } @ args:
with stdenv.lib;
with lib;
buildLinux (args // rec {
version = "5.10.7";
+2 -2
View File
@@ -1,6 +1,6 @@
{ stdenv, buildPackages, fetchurl, perl, buildLinux, modDirVersionArg ? null, ... } @ args:
{ lib, stdenv, buildPackages, fetchurl, perl, buildLinux, modDirVersionArg ? null, ... } @ args:
with stdenv.lib;
with lib;
buildLinux (args // rec {
version = "5.4.89";
+2 -2
View File
@@ -1,6 +1,6 @@
{ stdenv, buildPackages, fetchurl, perl, buildLinux, modDirVersionArg ? null, ... } @ args:
{ lib, stdenv, buildPackages, fetchurl, perl, buildLinux, modDirVersionArg ? null, ... } @ args:
with stdenv.lib;
with lib;
buildLinux (args // rec {
version = "5.9.16";
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, buildLinux, linux_zen, ... } @ args:
{ lib, stdenv, fetchFromGitHub, buildLinux, linux_zen, ... } @ args:
let
version = "5.10.6";
@@ -18,7 +18,7 @@ buildLinux (args // {
extraMeta = {
branch = "5.10/master";
maintainers = with stdenv.lib.maintainers; [ atemu ];
maintainers = with lib.maintainers; [ atemu ];
description = linux_zen.meta.description + " (Same as linux_zen but less aggressive release schedule)";
};
@@ -1,4 +1,4 @@
{ stdenv, buildPackages, fetchFromGitHub, perl, buildLinux, structuredExtraConfig ? {}, ... } @ args:
{ lib, stdenv, buildPackages, fetchFromGitHub, perl, buildLinux, structuredExtraConfig ? {}, ... } @ args:
let
mptcpVersion = "0.95";
modDirVersion = "4.19.55";
@@ -9,7 +9,7 @@ buildLinux ({
extraMeta = {
branch = "4.19";
maintainers = with stdenv.lib.maintainers; [ teto layus ];
maintainers = with lib.maintainers; [ teto layus ];
};
src = fetchFromGitHub {
@@ -19,8 +19,8 @@ buildLinux ({
sha256 = "04a66iq5vsiz8mkpszfxmqknz7y4w3lsckrcz6q1syjpk0pdyiyw";
};
structuredExtraConfig = stdenv.lib.mkMerge [
(import ./mptcp-config.nix { inherit stdenv; })
structuredExtraConfig = lib.mkMerge [
(import ./mptcp-config.nix { inherit lib; })
structuredExtraConfig
];
@@ -1,4 +1,4 @@
{ stdenv, buildPackages, fetchFromGitHub, fetchpatch, perl, buildLinux, ... } @ args:
{ lib, stdenv, buildPackages, fetchFromGitHub, fetchpatch, perl, buildLinux, ... } @ args:
buildLinux (args // {
version = "5.9.0-2020.11.20";
@@ -16,7 +16,7 @@ buildLinux (args // {
extraMeta = {
branch = "master";
hydraPlatforms = []; # Should the testing kernels ever be built on Hydra?
maintainers = with stdenv.lib.maintainers; [ davidak chiiruno ];
maintainers = with lib.maintainers; [ davidak chiiruno ];
platforms = [ "x86_64-linux" ];
};
@@ -1,6 +1,6 @@
{ stdenv, buildPackages, fetchurl, perl, buildLinux, modDirVersionArg ? null, ... } @ args:
{ lib, stdenv, buildPackages, fetchurl, perl, buildLinux, modDirVersionArg ? null, ... } @ args:
with stdenv.lib;
with lib;
buildLinux (args // rec {
version = "5.11-rc3";
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, buildLinux, ... } @ args:
{ lib, stdenv, fetchFromGitHub, buildLinux, ... } @ args:
let
version = "5.10.6";
@@ -18,7 +18,7 @@ buildLinux (args // {
extraMeta = {
branch = "5.10/master";
maintainers = with stdenv.lib.maintainers; [ atemu andresilva ];
maintainers = with lib.maintainers; [ atemu andresilva ];
description = "Built using the best configuration and kernel sources for desktop, multimedia, and gaming workloads.";
};
+20 -19
View File
@@ -1,4 +1,4 @@
{ buildPackages, runCommand, nettools, bc, bison, flex, perl, rsync, gmp, libmpc, mpfr, openssl
{ lib, buildPackages, runCommand, nettools, bc, bison, flex, perl, rsync, gmp, libmpc, mpfr, openssl
, libelf, cpio, elfutils, zstd, gawk
, writeTextFile
}:
@@ -14,6 +14,7 @@ let
echo "}" >> $out
'').outPath;
in {
lib,
# Allow overriding stdenv on each buildLinux call
stdenv,
# The kernel version
@@ -28,7 +29,7 @@ in {
configfile,
# Manually specified nixexpr representing the config
# If unspecified, this will be autodetected from the .config
config ? stdenv.lib.optionalAttrs allowImportFromDerivation (readConfig configfile),
config ? lib.optionalAttrs allowImportFromDerivation (readConfig configfile),
# Custom seed used for CONFIG_GCC_PLUGIN_RANDSTRUCT if enabled. This is
# automatically extended with extra per-version and per-config values.
randstructSeed ? "",
@@ -48,11 +49,11 @@ in {
}:
let
inherit (stdenv.lib)
inherit (lib)
hasAttr getAttr optional optionals optionalString optionalAttrs maintainers platforms;
# Dependencies that are required to build kernel modules
moduleBuildDependencies = optional (stdenv.lib.versionAtLeast version "4.14") libelf;
moduleBuildDependencies = optional (lib.versionAtLeast version "4.14") libelf;
installkernel = writeTextFile { name = "installkernel"; executable=true; text = ''
#!${stdenv.shell} -e
@@ -63,7 +64,7 @@ let
commonMakeFlags = [
"O=$(buildRoot)"
] ++ stdenv.lib.optionals (stdenv.hostPlatform.platform ? kernelMakeFlags)
] ++ lib.optionals (stdenv.hostPlatform.platform ? kernelMakeFlags)
stdenv.hostPlatform.platform.kernelMakeFlags;
drvAttrs = config_: platform: kernelPatches: configfile:
@@ -88,14 +89,14 @@ let
installsFirmware = (config.isEnabled "FW_LOADER") &&
(isModular || (config.isDisabled "FIRMWARE_IN_KERNEL")) &&
(stdenv.lib.versionOlder version "4.14");
(lib.versionOlder version "4.14");
in (optionalAttrs isModular { outputs = [ "out" "dev" ]; }) // {
passthru = {
inherit version modDirVersion config kernelPatches configfile
moduleBuildDependencies stdenv;
inherit isXen isZen isHardened isLibre;
kernelOlder = stdenv.lib.versionOlder version;
kernelAtLeast = stdenv.lib.versionAtLeast version;
kernelOlder = lib.versionOlder version;
kernelAtLeast = lib.versionAtLeast version;
};
inherit src;
@@ -103,9 +104,9 @@ let
patches =
map (p: p.patch) kernelPatches
# Required for deterministic builds along with some postPatch magic.
++ optional (stdenv.lib.versionAtLeast version "4.13") ./randstruct-provide-seed.patch
++ optional (lib.versionAtLeast version "4.13") ./randstruct-provide-seed.patch
# Fixes determinism by normalizing metadata for the archive of kheaders
++ optional (stdenv.lib.versionAtLeast version "5.2" && stdenv.lib.versionOlder version "5.4") ./gen-kheaders-metadata.patch;
++ optional (lib.versionAtLeast version "5.2" && lib.versionOlder version "5.4") ./gen-kheaders-metadata.patch;
prePatch = ''
for mf in $(find -name Makefile -o -name Makefile.include -o -name install.sh); do
@@ -282,9 +283,9 @@ let
"The Linux kernel" +
(if kernelPatches == [] then "" else
" (with patches: "
+ stdenv.lib.concatStringsSep ", " (map (x: x.name) kernelPatches)
+ lib.concatStringsSep ", " (map (x: x.name) kernelPatches)
+ ")");
license = stdenv.lib.licenses.gpl2;
license = lib.licenses.gpl2;
homepage = "https://www.kernel.org/";
repositories.git = "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git";
maintainers = [
@@ -296,8 +297,8 @@ let
};
in
assert (stdenv.lib.versionAtLeast version "4.14" && stdenv.lib.versionOlder version "5.8") -> libelf != null;
assert stdenv.lib.versionAtLeast version "5.8" -> elfutils != null;
assert (lib.versionAtLeast version "4.14" && lib.versionOlder version "5.8") -> libelf != null;
assert lib.versionAtLeast version "5.8" -> elfutils != null;
stdenv.mkDerivation ((drvAttrs config stdenv.hostPlatform.platform kernelPatches configfile) // {
pname = "linux";
@@ -308,11 +309,11 @@ stdenv.mkDerivation ((drvAttrs config stdenv.hostPlatform.platform kernelPatches
depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [ perl bc nettools openssl rsync gmp libmpc mpfr gawk zstd ]
++ optional (stdenv.hostPlatform.platform.kernelTarget == "uImage") buildPackages.ubootTools
++ optional (stdenv.lib.versionAtLeast version "4.14" && stdenv.lib.versionOlder version "5.8") libelf
++ optional (lib.versionAtLeast version "4.14" && lib.versionOlder version "5.8") libelf
# Removed util-linuxMinimal since it should not be a dependency.
++ optionals (stdenv.lib.versionAtLeast version "4.16") [ bison flex ]
++ optional (stdenv.lib.versionAtLeast version "5.2") cpio
++ optional (stdenv.lib.versionAtLeast version "5.8") elfutils
++ optionals (lib.versionAtLeast version "4.16") [ bison flex ]
++ optional (lib.versionAtLeast version "5.2") cpio
++ optional (lib.versionAtLeast version "5.8") elfutils
;
hardeningDisable = [ "bindnow" "format" "fortify" "stackprotector" "pic" "pie" ];
@@ -322,7 +323,7 @@ stdenv.mkDerivation ((drvAttrs config stdenv.hostPlatform.platform kernelPatches
"CC=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc"
"HOSTCC=${buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}cc"
"ARCH=${stdenv.hostPlatform.platform.kernelArch}"
] ++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) [
] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) [
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
];
@@ -1,5 +1,5 @@
{ stdenv }:
with stdenv.lib.kernel;
{ lib }:
with lib.kernel;
{
# DRM_AMDGPU = yes;
+3 -3
View File
@@ -41,7 +41,7 @@ stdenv.mkDerivation {
buildInputs = [
elfutils newt slang libunwind libbfd zlib openssl systemtap.stapBuild numactl
libopcodes python3 perl
] ++ stdenv.lib.optional withGtk gtk2
] ++ lib.optional withGtk gtk2
++ (if (versionAtLeast kernel.version "4.19") then [ python3 ] else [ python2 ]);
# Note: we don't add elfutils to buildInputs, since it provides a
@@ -72,7 +72,7 @@ stdenv.mkDerivation {
meta = {
homepage = "https://perf.wiki.kernel.org/";
description = "Linux tools to profile with performance counters";
maintainers = with stdenv.lib.maintainers; [viric];
platforms = with stdenv.lib.platforms; linux;
maintainers = with lib.maintainers; [viric];
platforms = with lib.platforms; linux;
};
}