summary refs log tree commit diff
path: root/pkgs/os-specific/linux
diff options
context:
space:
mode:
authorDmitriy <arch1tect0r@users.noreply.github.com>2018-08-22 10:32:01 +0300
committerGitHub <noreply@github.com>2018-08-22 10:32:01 +0300
commitb691bf4629e36651e2809f8afdad2b0f78a94c4d (patch)
treeb896e9d716a3a161140eae7c834bd0f5a0393990 /pkgs/os-specific/linux
parentbf453ad4e567836ec1030fd01ac588196f0b675f (diff)
parent61c0adfbc11da6cbc20ec7482ac1b96ae7d1d2a5 (diff)
downloadnixpkgs-b691bf4629e36651e2809f8afdad2b0f78a94c4d.tar
nixpkgs-b691bf4629e36651e2809f8afdad2b0f78a94c4d.tar.gz
nixpkgs-b691bf4629e36651e2809f8afdad2b0f78a94c4d.tar.bz2
nixpkgs-b691bf4629e36651e2809f8afdad2b0f78a94c4d.tar.lz
nixpkgs-b691bf4629e36651e2809f8afdad2b0f78a94c4d.tar.xz
nixpkgs-b691bf4629e36651e2809f8afdad2b0f78a94c4d.tar.zst
nixpkgs-b691bf4629e36651e2809f8afdad2b0f78a94c4d.zip
Merge branch 'master' into update-cryptsetup
Diffstat (limited to 'pkgs/os-specific/linux')
-rw-r--r--pkgs/os-specific/linux/cryptsetup/default.nix4
-rw-r--r--pkgs/os-specific/linux/fuse/common.nix9
-rw-r--r--pkgs/os-specific/linux/kernel/hardened-config.nix2
-rw-r--r--pkgs/os-specific/linux/libaio/default.nix10
-rw-r--r--pkgs/os-specific/linux/numactl/default.nix9
-rw-r--r--pkgs/os-specific/linux/pmount/default.nix2
-rw-r--r--pkgs/os-specific/linux/rtl8723bs/default.nix2
-rw-r--r--pkgs/os-specific/linux/syslinux/default.nix20
-rw-r--r--pkgs/os-specific/linux/util-linux/default.nix4
9 files changed, 53 insertions, 9 deletions
diff --git a/pkgs/os-specific/linux/cryptsetup/default.nix b/pkgs/os-specific/linux/cryptsetup/default.nix
index 7a38c41bc34..178fc7d9140 100644
--- a/pkgs/os-specific/linux/cryptsetup/default.nix
+++ b/pkgs/os-specific/linux/cryptsetup/default.nix
@@ -14,6 +14,10 @@ stdenv.mkDerivation rec {
     sha256 = "0d2p9g2wqcv6l3671gvw96p16jadbgyh21ddy2bhqgi96dq3qflx";
   };
 
+  postPatch = ''
+    patchShebangs tests
+  '';
+
   NIX_LDFLAGS = "-lgcc_s";
 
   configureFlags = [
diff --git a/pkgs/os-specific/linux/fuse/common.nix b/pkgs/os-specific/linux/fuse/common.nix
index d23ae7594be..15470479a3a 100644
--- a/pkgs/os-specific/linux/fuse/common.nix
+++ b/pkgs/os-specific/linux/fuse/common.nix
@@ -4,6 +4,7 @@
 , fusePackages, utillinux, gettext
 , meson, ninja, pkgconfig
 , autoreconfHook
+, python3Packages, which
 }:
 
 let
@@ -58,6 +59,14 @@ in stdenv.mkDerivation rec {
       ./makeconf.sh
     '');
 
+  checkInputs = [ which ] ++ (with python3Packages; [ python pytest ]);
+
+  checkPhase = ''
+    python3 -m pytest test/
+  '';
+
+  doCheck = false; # v2: no tests, v3: all tests get skipped in a sandbox
+
   postFixup = "cd $out\n" + (if isFuse3 then ''
     install -D -m444 etc/fuse.conf $common/etc/fuse.conf
     install -D -m444 etc/udev/rules.d/99-fuse3.rules $common/etc/udev/rules.d/99-fuse.rules
diff --git a/pkgs/os-specific/linux/kernel/hardened-config.nix b/pkgs/os-specific/linux/kernel/hardened-config.nix
index 309b5f6c74e..84d1dd8a378 100644
--- a/pkgs/os-specific/linux/kernel/hardened-config.nix
+++ b/pkgs/os-specific/linux/kernel/hardened-config.nix
@@ -22,7 +22,7 @@ ${optionalString (versionAtLeast version "4.10") ''
   BUG_ON_DATA_CORRUPTION y
 ''}
 
-${optionalString (stdenv.platform.kernelArch == "x86_64") ''
+${optionalString (stdenv.hostPlatform.platform.kernelArch == "x86_64") ''
   DEFAULT_MMAP_MIN_ADDR 65536 # Prevent allocation of first 64K of memory
 
   # Reduce attack surface by disabling various emulations
diff --git a/pkgs/os-specific/linux/libaio/default.nix b/pkgs/os-specific/linux/libaio/default.nix
index e2be136adee..949c8135df7 100644
--- a/pkgs/os-specific/linux/libaio/default.nix
+++ b/pkgs/os-specific/linux/libaio/default.nix
@@ -14,10 +14,20 @@ stdenv.mkDerivation rec {
     sha256 = "1kqpiswjn549s3w3m89bw5qkl7bw5pvq6gp5cdzd926ymlgivj5c";
   }) ];
 
+  postPatch = ''
+    patchShebangs harness
+
+    # Makefile is too optimistic, gcc is too smart
+    substituteInPlace harness/Makefile \
+      --replace "-Werror" ""
+  '';
+
   makeFlags = "prefix=$(out)";
 
   hardeningDisable = stdenv.lib.optional (stdenv.isi686) "stackprotector";
 
+  checkTarget = "partcheck"; # "check" needs root
+
   meta = {
     description = "Library for asynchronous I/O in Linux";
     homepage = http://lse.sourceforge.net/io/aio.html;
diff --git a/pkgs/os-specific/linux/numactl/default.nix b/pkgs/os-specific/linux/numactl/default.nix
index 9928897ae4d..4506945ffba 100644
--- a/pkgs/os-specific/linux/numactl/default.nix
+++ b/pkgs/os-specific/linux/numactl/default.nix
@@ -23,6 +23,15 @@ stdenv.mkDerivation rec {
       sha256 = "080b0sygmg7104qbbh1amh3b322yyiajwi2d3d0vayffgva0720v";
     });
 
+  postPatch = ''
+    patchShebangs test
+  '';
+
+  # You probably shouldn't ever run these! They will reconfigure Linux
+  # NUMA settings, which on my build machine makes the rest of package
+  # building ~5% slower until reboot. Ugh!
+  doCheck = false; # never ever!
+
   meta = with stdenv.lib; {
     description = "Library and tools for non-uniform memory access (NUMA) machines";
     homepage = http://oss.sgi.com/projects/libnuma/;
diff --git a/pkgs/os-specific/linux/pmount/default.nix b/pkgs/os-specific/linux/pmount/default.nix
index ea34075210d..f0f706157ed 100644
--- a/pkgs/os-specific/linux/pmount/default.nix
+++ b/pkgs/os-specific/linux/pmount/default.nix
@@ -34,6 +34,8 @@ stdenv.mkDerivation rec {
     substituteInPlace ./src/Makefile --replace '-o root -g root -m 4755 ' '-m 755 '
   '';
 
+  doCheck = false; # fails 1 out of 1 tests with "Error: could not open fstab-type file: No such file or directory"
+
   meta = {
     homepage = http://pmount.alioth.debian.org/;
     description = "Mount removable devices as normal user";
diff --git a/pkgs/os-specific/linux/rtl8723bs/default.nix b/pkgs/os-specific/linux/rtl8723bs/default.nix
index 0263d17ead0..b1e01f705dc 100644
--- a/pkgs/os-specific/linux/rtl8723bs/default.nix
+++ b/pkgs/os-specific/linux/rtl8723bs/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ nukeReferences ];
 
   makeFlags = concatStringsSep " " [
-    "ARCH=${stdenv.platform.kernelArch}" # Normally not needed, but the Makefile sets ARCH in a broken way.
+    "ARCH=${stdenv.hostPlatform.platform.kernelArch}" # Normally not needed, but the Makefile sets ARCH in a broken way.
     "KSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" # Makefile uses $(uname -r); breaks us.
   ];
 
diff --git a/pkgs/os-specific/linux/syslinux/default.nix b/pkgs/os-specific/linux/syslinux/default.nix
index 8a87d3fce58..f02f1baafe6 100644
--- a/pkgs/os-specific/linux/syslinux/default.nix
+++ b/pkgs/os-specific/linux/syslinux/default.nix
@@ -21,19 +21,23 @@ stdenv.mkDerivation rec {
     })
   ];
 
-  nativeBuildInputs = [ nasm perl python ];
-  buildInputs = [ libuuid makeWrapper ];
-
-  enableParallelBuilding = false; # Fails very rarely with 'No rule to make target: ...'
-  hardeningDisable = [ "pic" "stackprotector" "fortify" ];
-
-  preBuild = ''
+  postPatch = ''
     substituteInPlace Makefile --replace /bin/pwd $(type -P pwd)
     substituteInPlace gpxe/src/Makefile.housekeeping --replace /bin/echo $(type -P echo)
     substituteInPlace utils/ppmtolss16 --replace /usr/bin/perl $(type -P perl)
     substituteInPlace gpxe/src/Makefile --replace /usr/bin/perl $(type -P perl)
+
+    # fix tests
+    substituteInPlace tests/unittest/include/unittest/unittest.h \
+      --replace /usr/include/ ""
   '';
 
+  nativeBuildInputs = [ nasm perl python ];
+  buildInputs = [ libuuid makeWrapper ];
+
+  enableParallelBuilding = false; # Fails very rarely with 'No rule to make target: ...'
+  hardeningDisable = [ "pic" "stackprotector" "fortify" ];
+
   stripDebugList = "bin sbin share/syslinux/com32";
 
   makeFlags = [
@@ -47,6 +51,8 @@ stdenv.mkDerivation rec {
     "bios"
   ];
 
+  doCheck = false; # fails. some fail in a sandbox, others require qemu
+
   postInstall = ''
     wrapProgram $out/bin/syslinux \
       --prefix PATH : "${mtools}/bin"
diff --git a/pkgs/os-specific/linux/util-linux/default.nix b/pkgs/os-specific/linux/util-linux/default.nix
index 39fae463207..55758190efd 100644
--- a/pkgs/os-specific/linux/util-linux/default.nix
+++ b/pkgs/os-specific/linux/util-linux/default.nix
@@ -22,6 +22,8 @@ in stdenv.mkDerivation rec {
   outputs = [ "bin" "dev" "out" "man" ];
 
   postPatch = ''
+    patchShebangs tests/run.sh
+
     substituteInPlace include/pathnames.h \
       --replace "/bin/login" "${shadow}/bin/login"
     substituteInPlace sys-utils/eject.c \
@@ -54,6 +56,8 @@ in stdenv.mkDerivation rec {
     [ zlib pam ]
     ++ lib.filter (p: p != null) [ ncurses systemd perl ];
 
+  doCheck = false; # "For development purpose only. Don't execute on production system!"
+
   postInstall = ''
     rm "$bin/bin/su" # su should be supplied by the su package (shadow)
   '' + lib.optionalString minimal ''