···2021let
22 version = "2.26";
23- patchSuffix = "-115";
24 sha256 = "1ggnj1hzjym7sn93rbwydcqd562q73lsb7g7kd199g6j9j9hlkp5";
25 cross = if buildPlatform != hostPlatform then hostPlatform else null;
26in
···48 */
49 ./2.26-75.patch.gz
50 ./2.26-75to115.diff.gz
0005152 /* Have rpcgen(1) look for cpp(1) in $PATH. */
53 ./rpcgen-path.patch
···73 and we lose early mismatch detection on 2.6.32.
7475 On major glibc updates we should check that the patched kernel supports
76- all the required features. ATM it's verified up to glibc-2.26-115.
77 # HOWTO: check glibc sources for changes in kernel requirements
78 git log -p glibc-2.25.. sysdeps/unix/sysv/linux/x86_64/kernel-features.h sysdeps/unix/sysv/linux/kernel-features.h
79 # get kernel sources (update the URL)
···2021let
22 version = "2.26";
23+ patchSuffix = "-131";
24 sha256 = "1ggnj1hzjym7sn93rbwydcqd562q73lsb7g7kd199g6j9j9hlkp5";
25 cross = if buildPlatform != hostPlatform then hostPlatform else null;
26in
···48 */
49 ./2.26-75.patch.gz
50 ./2.26-75to115.diff.gz
51+ # contains fix for CVE-2018-1000001 as the last commit:
52+ # https://sourceware.org/git/?p=glibc.git;a=commit;h=fabef2edbc
53+ ./2.26-115to131.diff.gz
5455 /* Have rpcgen(1) look for cpp(1) in $PATH. */
56 ./rpcgen-path.patch
···76 and we lose early mismatch detection on 2.6.32.
7778 On major glibc updates we should check that the patched kernel supports
79+ all the required features. ATM it's verified up to glibc-2.26-131.
80 # HOWTO: check glibc sources for changes in kernel requirements
81 git log -p glibc-2.25.. sysdeps/unix/sysv/linux/x86_64/kernel-features.h sysdeps/unix/sysv/linux/kernel-features.h
82 # get kernel sources (update the URL)
-2
pkgs/development/libraries/json-glib/default.nix
···2728 doCheck = true;
2930- checkPhase = "meson test";
31-32 meta = with stdenv.lib; {
33 homepage = http://live.gnome.org/JsonGlib;
34 description = "A library providing (de)serialization support for the JavaScript Object Notation (JSON) format";
···2728 doCheck = true;
290030 meta = with stdenv.lib; {
31 homepage = http://live.gnome.org/JsonGlib;
32 description = "A library providing (de)serialization support for the JavaScript Object Notation (JSON) format";
···43 # libraries are in a system path or in the same directory as the
44 # executable. This flag makes the shared library accessible from its
45 # nix/store directory.
46- cmakeFlags="-DCMAKE_INSTALL_NAME_DIR=$prefix/lib $cmakeFlags"
47 cmakeFlags="-DCMAKE_INSTALL_LIBDIR=${!outputLib}/lib $cmakeFlags"
48 cmakeFlags="-DCMAKE_INSTALL_INCLUDEDIR=${!outputDev}/include $cmakeFlags"
49
···43 # libraries are in a system path or in the same directory as the
44 # executable. This flag makes the shared library accessible from its
45 # nix/store directory.
46+ cmakeFlags="-DCMAKE_INSTALL_NAME_DIR=${!outputLib}/lib $cmakeFlags"
47 cmakeFlags="-DCMAKE_INSTALL_LIBDIR=${!outputLib}/lib $cmakeFlags"
48 cmakeFlags="-DCMAKE_INSTALL_INCLUDEDIR=${!outputDev}/include $cmakeFlags"
49
···5152 # Bump the maximum number of CPUs to support systems like EC2 x1.*
53 # instances and Xeon Phi.
54- ${optionalString (stdenv.system == "x86_64-linux" || stdenv.system == "aarch64-linux") ''
55 NR_CPUS 384
56 ''}
57···347 SECURITY_SELINUX_BOOTPARAM_VALUE 0 # Disable SELinux by default
348 SECURITY_YAMA? y # Prevent processes from ptracing non-children processes
349 DEVKMEM n # Disable /dev/kmem
350- ${if versionOlder version "3.14" then ''
351- CC_STACKPROTECTOR? y # Detect buffer overflows on the stack
352- '' else ''
353- CC_STACKPROTECTOR_REGULAR? y
354- ''}
0355 ${optionalString (versionAtLeast version "3.12") ''
356 USER_NS y # Support for user namespaces
357 ''}
···5152 # Bump the maximum number of CPUs to support systems like EC2 x1.*
53 # instances and Xeon Phi.
54+ ${optionalString (stdenv.hostPlatform.system == "x86_64-linux" || stdenv.hostPlatform.system == "aarch64-linux") ''
55 NR_CPUS 384
56 ''}
57···347 SECURITY_SELINUX_BOOTPARAM_VALUE 0 # Disable SELinux by default
348 SECURITY_YAMA? y # Prevent processes from ptracing non-children processes
349 DEVKMEM n # Disable /dev/kmem
350+ ${optionalString (! stdenv.hostPlatform.isArm)
351+ (if versionOlder version "3.14" then ''
352+ CC_STACKPROTECTOR? y # Detect buffer overflows on the stack
353+ '' else ''
354+ CC_STACKPROTECTOR_REGULAR? y
355+ '')}
356 ${optionalString (versionAtLeast version "3.12") ''
357 USER_NS y # Support for user namespaces
358 ''}
+16-47
pkgs/os-specific/linux/kernel/generic.nix
···1-{ stdenv, perl, buildLinux
23, # The kernel source tarball.
4 src
···23 # symbolic name and `patch' is the actual patch. The patch may
24 # optionally be compressed with gzip or bzip2.
25 kernelPatches ? []
26-, ignoreConfigErrors ? stdenv.platform.name != "pc"
027, extraMeta ? {}
28, hostPlatform
29, ...
···43 netfilterRPFilter = true;
44 } // features) kernelPatches;
4546- configWithPlatform = kernelPlatform: import ./common-config.nix {
47- inherit stdenv version kernelPlatform extraConfig;
048 features = kernelFeatures; # Ensure we know of all extra patches, etc.
49 };
50-51- config = configWithPlatform stdenv.platform;
52- configCross = configWithPlatform hostPlatform.platform;
5354 kernelConfigFun = baseConfig:
55 let
···6566 kernelConfig = kernelConfigFun config;
67068 nativeBuildInputs = [ perl ];
6970- platformName = stdenv.platform.name;
71- kernelBaseConfig = stdenv.platform.kernelBaseConfig;
72- kernelTarget = stdenv.platform.kernelTarget;
73- autoModules = stdenv.platform.kernelAutoModules;
74- preferBuiltin = stdenv.platform.kernelPreferBuiltin or false;
75- arch = stdenv.platform.kernelArch;
76-77- crossAttrs = let
78- cp = hostPlatform.platform;
79- in {
80- arch = cp.kernelArch;
81- platformName = cp.name;
82- kernelBaseConfig = cp.kernelBaseConfig;
83- kernelTarget = cp.kernelTarget;
84- autoModules = cp.kernelAutoModules;
85-86- # Just ignore all options that don't apply (We are lazy).
87- ignoreConfigErrors = true;
88-89- kernelConfig = kernelConfigFun configCross;
90-91- inherit (kernel.crossDrv) src patches preUnpack;
92- };
9394 prePatch = kernel.prePatch + ''
95 # Patch kconfig to print "###" after every question so that
···103 cd $buildRoot
104105 # Get a basic config file for later refinement with $generateConfig.
106- make -C ../$sourceRoot O=$PWD $kernelBaseConfig ARCH=$arch
107108 # Create the config file.
109 echo "generating kernel configuration..."
···118 };
119120 kernel = buildLinux {
121- inherit version modDirVersion src kernelPatches stdenv extraMeta;
122-123- configfile = configfile.nativeDrv or configfile;
124-125- crossConfigfile = configfile.crossDrv or configfile;
126127 config = { CONFIG_MODULES = "y"; CONFIG_FW_LOADER = "m"; };
128-129- crossConfig = { CONFIG_MODULES = "y"; CONFIG_FW_LOADER = "m"; };
130 };
131132 passthru = {
···134 passthru = kernel.passthru // (removeAttrs passthru [ "passthru" ]);
135 };
136137- addPassthru' = lib.extendDerivation true passthru;
138-139- nativeDrv = addPassthru' kernel.nativeDrv;
140-141- crossDrv = addPassthru' kernel.crossDrv;
142-143-in if kernel ? crossDrv
144- then nativeDrv // { inherit nativeDrv crossDrv; }
145- else addPassthru' kernel
···1+{ stdenv, buildPackages, perl, buildLinux
23, # The kernel source tarball.
4 src
···23 # symbolic name and `patch' is the actual patch. The patch may
24 # optionally be compressed with gzip or bzip2.
25 kernelPatches ? []
26+, ignoreConfigErrors ? hostPlatform.platform.name != "pc" ||
27+ hostPlatform != stdenv.buildPlatform
28, extraMeta ? {}
29, hostPlatform
30, ...
···44 netfilterRPFilter = true;
45 } // features) kernelPatches;
4647+ config = import ./common-config.nix {
48+ inherit stdenv version extraConfig;
49+ kernelPlatform = hostPlatform;
50 features = kernelFeatures; # Ensure we know of all extra patches, etc.
51 };
0005253 kernelConfigFun = baseConfig:
54 let
···6465 kernelConfig = kernelConfigFun config;
6667+ depsBuildBuild = [ buildPackages.stdenv.cc ];
68 nativeBuildInputs = [ perl ];
6970+ platformName = hostPlatform.platform.name;
71+ kernelBaseConfig = hostPlatform.platform.kernelBaseConfig;
72+ kernelTarget = hostPlatform.platform.kernelTarget;
73+ autoModules = hostPlatform.platform.kernelAutoModules;
74+ preferBuiltin = hostPlatform.platform.kernelPreferBuiltin or false;
75+ arch = hostPlatform.platform.kernelArch;
000000000000000007677 prePatch = kernel.prePatch + ''
78 # Patch kconfig to print "###" after every question so that
···86 cd $buildRoot
8788 # Get a basic config file for later refinement with $generateConfig.
89+ make HOSTCC=${buildPackages.stdenv.cc.targetPrefix}gcc -C ../$sourceRoot O=$PWD $kernelBaseConfig ARCH=$arch
9091 # Create the config file.
92 echo "generating kernel configuration..."
···101 };
102103 kernel = buildLinux {
104+ inherit version modDirVersion src kernelPatches stdenv extraMeta configfile;
0000105106 config = { CONFIG_MODULES = "y"; CONFIG_FW_LOADER = "m"; };
00107 };
108109 passthru = {
···111 passthru = kernel.passthru // (removeAttrs passthru [ "passthru" ]);
112 };
113114+in lib.extendDerivation true passthru kernel
00000000
···188 addToSearchPathWithCustomDelimiter "${PATH_DELIMITER}" "$@"
189}
190191-192-ensureDir() {
193- echo "warning: ‘ensureDir’ is deprecated; use ‘mkdir’ instead" >&2
194- local dir
195- for dir in "$@"; do
196- if ! [ -x "$dir" ]; then mkdir -p "$dir"; fi
197- done
198-}
199-200-201# Add $1/lib* into rpaths.
202# The function is used in multiple-outputs.sh hook,
203# so it is defined here but tried after the hook.
···188 addToSearchPathWithCustomDelimiter "${PATH_DELIMITER}" "$@"
189}
1900000000000191# Add $1/lib* into rpaths.
192# The function is used in multiple-outputs.sh hook,
193# so it is defined here but tried after the hook.
···21 # and the wonderful bazel BUILD file is already there (yay case-insensitivity?)
22 prePatch = "rm BUILD";
2324- preConfigure = stdenv.lib.optionalString stdenv.isDarwin ''
25- cmakeFlagsArray+=("-DCMAKE_INSTALL_NAME_DIR=$lib/lib")
26- '';
27-28 meta = with stdenv.lib; {
29 inherit (src.meta) homepage;
30
···21 # and the wonderful bazel BUILD file is already there (yay case-insensitivity?)
22 prePatch = "rm BUILD";
23000024 meta = with stdenv.lib; {
25 inherit (src.meta) homepage;
26