summary refs log tree commit diff
path: root/pkgs/os-specific/linux
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/os-specific/linux')
-rw-r--r--pkgs/os-specific/linux/alsa-lib/default.nix6
-rw-r--r--pkgs/os-specific/linux/alsa-plugins/default.nix10
-rw-r--r--pkgs/os-specific/linux/alsa-utils/default.nix9
-rw-r--r--pkgs/os-specific/linux/apparmor/2.9/default.nix4
-rw-r--r--pkgs/os-specific/linux/bluez/bluez5.nix4
-rw-r--r--pkgs/os-specific/linux/checksec/default.nix10
-rw-r--r--pkgs/os-specific/linux/drbd/default.nix2
-rw-r--r--pkgs/os-specific/linux/ffado/build-fix.patch61
-rw-r--r--pkgs/os-specific/linux/ffado/default.nix93
-rw-r--r--pkgs/os-specific/linux/ffado/enable-mixer-and-dbus.patch26
-rw-r--r--pkgs/os-specific/linux/firmware/b43-firmware/6.30.163.46.nix31
-rw-r--r--pkgs/os-specific/linux/fusionio/srcs.nix22
-rw-r--r--pkgs/os-specific/linux/fusionio/util.nix45
-rw-r--r--pkgs/os-specific/linux/fusionio/vsl-fix-file-inode.patch13
-rw-r--r--pkgs/os-specific/linux/fusionio/vsl.nix37
-rw-r--r--pkgs/os-specific/linux/hal-flash/default.nix28
-rw-r--r--pkgs/os-specific/linux/hostapd/default.nix49
-rw-r--r--pkgs/os-specific/linux/jfbview/default.nix40
-rw-r--r--pkgs/os-specific/linux/kernel/grsec-path.patch13
-rw-r--r--pkgs/os-specific/linux/kernel/linux-3.10.nix4
-rw-r--r--pkgs/os-specific/linux/kernel/linux-3.12.nix4
-rw-r--r--pkgs/os-specific/linux/kernel/linux-3.14.nix11
-rw-r--r--pkgs/os-specific/linux/kernel/linux-3.18.nix4
-rw-r--r--pkgs/os-specific/linux/kernel/linux-3.19.nix11
-rw-r--r--pkgs/os-specific/linux/kernel/linux-3.4.nix4
-rw-r--r--pkgs/os-specific/linux/kernel/linux-4.0.nix18
-rw-r--r--pkgs/os-specific/linux/kernel/manual-config.nix4
-rw-r--r--pkgs/os-specific/linux/kernel/patches.nix12
-rw-r--r--pkgs/os-specific/linux/kexectools/default.nix9
-rw-r--r--pkgs/os-specific/linux/kmod-blacklist-ubuntu/default.nix2
-rw-r--r--pkgs/os-specific/linux/libcgroup/default.nix18
-rw-r--r--pkgs/os-specific/linux/mcelog/default.nix47
-rw-r--r--pkgs/os-specific/linux/numactl/default.nix24
-rw-r--r--pkgs/os-specific/linux/schedtool/default.nix20
-rw-r--r--pkgs/os-specific/linux/systemd/default.nix4
-rw-r--r--pkgs/os-specific/linux/trace-cmd/default.nix25
-rw-r--r--pkgs/os-specific/linux/trinity/default.nix31
-rw-r--r--pkgs/os-specific/linux/v86d/default.nix32
-rw-r--r--pkgs/os-specific/linux/wpa_supplicant/0001-P2P-Validate-SSID-element-length-before-copying-it-C.patch42
-rw-r--r--pkgs/os-specific/linux/wpa_supplicant/build-fix.patch12
-rw-r--r--pkgs/os-specific/linux/wpa_supplicant/default.nix93
-rw-r--r--pkgs/os-specific/linux/xf86-input-wacom/default.nix4
-rw-r--r--pkgs/os-specific/linux/zfs/generic.nix3
43 files changed, 701 insertions, 240 deletions
diff --git a/pkgs/os-specific/linux/alsa-lib/default.nix b/pkgs/os-specific/linux/alsa-lib/default.nix
index 41abf488673..ed72e701166 100644
--- a/pkgs/os-specific/linux/alsa-lib/default.nix
+++ b/pkgs/os-specific/linux/alsa-lib/default.nix
@@ -1,14 +1,14 @@
-{stdenv, fetchurl}:
+{ stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "alsa-lib-1.0.28";
+  name = "alsa-lib-1.0.29";
 
   src = fetchurl {
     urls = [
      "ftp://ftp.alsa-project.org/pub/lib/${name}.tar.bz2"
      "http://alsa.cybermirror.org/lib/${name}.tar.bz2"
     ];
-    sha256 = "0vaafg5q1q1mqcsgin5v7xlmngl3cnbmg5a9xxw0xcz1vn2ln1rw";
+    sha256 = "1l5xzhq7xjy8xap087zbbyi14gr1bhil18pn987vwdlnxcskq13k";
   };
 
   patches = [
diff --git a/pkgs/os-specific/linux/alsa-plugins/default.nix b/pkgs/os-specific/linux/alsa-plugins/default.nix
index 0bb96c343df..0450a44dae7 100644
--- a/pkgs/os-specific/linux/alsa-plugins/default.nix
+++ b/pkgs/os-specific/linux/alsa-plugins/default.nix
@@ -1,21 +1,21 @@
-{ stdenv, fetchurl, lib, pkgconfig, alsaLib, libogg, pulseaudio ? null, jack2 ? null }:
+{ stdenv, fetchurl, lib, pkgconfig, alsaLib, libogg, libpulseaudio ? null, libjack2 ? null }:
 
 stdenv.mkDerivation rec {
-  name = "alsa-plugins-1.0.28";
+  name = "alsa-plugins-1.0.29";
 
   src = fetchurl {
     urls = [
       "ftp://ftp.alsa-project.org/pub/plugins/${name}.tar.bz2"
       "http://alsa.cybermirror.org/plugins/${name}.tar.bz2"
     ];
-    sha256 = "081is33afhykb4ysll8s6gh0d6nm1cglslj9ck0disbyl3qqlvs2";
+    sha256 = "0ck5xa0vnjhn5w23gf87y30h7bcb6hzsx4817sw35xl5qb58ap9j";
   };
 
   # ToDo: a52, etc.?
   buildInputs =
     [ pkgconfig alsaLib libogg ]
-    ++ lib.optional (pulseaudio != null) pulseaudio
-    ++ lib.optional (jack2 != null) jack2;
+    ++ lib.optional (libpulseaudio != null) libpulseaudio
+    ++ lib.optional (libjack2 != null) libjack2;
 
   meta = with lib; {
     description = "Various plugins for ALSA";
diff --git a/pkgs/os-specific/linux/alsa-utils/default.nix b/pkgs/os-specific/linux/alsa-utils/default.nix
index 7ab4a919786..9f6fc98b5cf 100644
--- a/pkgs/os-specific/linux/alsa-utils/default.nix
+++ b/pkgs/os-specific/linux/alsa-utils/default.nix
@@ -1,18 +1,18 @@
 {stdenv, fetchurl, alsaLib, gettext, ncurses, libsamplerate}:
 
 stdenv.mkDerivation rec {
-  name = "alsa-utils-1.0.28";
+  name = "alsa-utils-${version}";
+  version = "1.0.29";
 
   src = fetchurl {
     urls = [
       "ftp://ftp.alsa-project.org/pub/utils/${name}.tar.bz2"
       "http://alsa.cybermirror.org/utils/${name}.tar.bz2"
     ];
-    sha256 = "1k1ach1jv0bf71klj9sqaijnw9wjrjad0g5in6bpfnhjn24lrzzk";
+    sha256 = "16ryhgbapp4pxyvsjc258mcj14wk7x3xs6g9bpnkqj0l7s7haq2i";
   };
 
-  buildInputs = [ alsaLib ncurses libsamplerate ];
-  nativeBuildInputs = [ gettext ];
+  buildInputs = [ gettext alsaLib ncurses libsamplerate ];
 
   configureFlags = "--disable-xmlto --with-udev-rules-dir=$(out)/lib/udev/rules.d";
 
@@ -28,5 +28,6 @@ stdenv.mkDerivation rec {
     '';
 
     platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.AndersonTorres ];
   };
 }
diff --git a/pkgs/os-specific/linux/apparmor/2.9/default.nix b/pkgs/os-specific/linux/apparmor/2.9/default.nix
index 0243c2aa456..1b1d9a3d1ca 100644
--- a/pkgs/os-specific/linux/apparmor/2.9/default.nix
+++ b/pkgs/os-specific/linux/apparmor/2.9/default.nix
@@ -4,7 +4,7 @@
 
 let
   apparmor-series = "2.9";
-  apparmor-patchver = "1";
+  apparmor-patchver = "2";
   apparmor-version = "${apparmor-series}.${apparmor-patchver}";
 
   apparmor-meta = component: with stdenv.lib; {
@@ -17,7 +17,7 @@ let
 
   apparmor-sources = fetchurl {
     url = "https://launchpad.net/apparmor/${apparmor-series}/${apparmor-version}/+download/apparmor-${apparmor-version}.tar.gz";
-    sha256 = "08ha7aigl40vm80f742rljcckdpfpw1s8g4yii1ysabcqcj8ffx6";
+    sha256 = "1mayly7d7w959fya7z8q6kab2x3jcwhqhkpx36jsvpjhxkhmc4fh";
   };
 
   prePatchCommon = ''
diff --git a/pkgs/os-specific/linux/bluez/bluez5.nix b/pkgs/os-specific/linux/bluez/bluez5.nix
index 61d3667f165..6e8fbdacf84 100644
--- a/pkgs/os-specific/linux/bluez/bluez5.nix
+++ b/pkgs/os-specific/linux/bluez/bluez5.nix
@@ -5,11 +5,11 @@
 assert stdenv.isLinux;
 
 stdenv.mkDerivation rec {
-  name = "bluez-5.29";
+  name = "bluez-5.30";
    
   src = fetchurl {
     url = "mirror://kernel/linux/bluetooth/${name}.tar.xz";
-    sha256 = "1r7h8qr52n372r73fdyk804r92hqg9g6pvflwmak64y6brnnl8fz";
+    sha256 = "0b1qbnq1xzcdw5rajg9yyg31bf21jnff0n6gnf1snz89bbdllfhy";
   };
 
   pythonPath = with pythonPackages;
diff --git a/pkgs/os-specific/linux/checksec/default.nix b/pkgs/os-specific/linux/checksec/default.nix
index 4701d774dfd..b423dc3a086 100644
--- a/pkgs/os-specific/linux/checksec/default.nix
+++ b/pkgs/os-specific/linux/checksec/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, file, findutils, elfutils, glibc }:
+{ stdenv, fetchurl, file, findutils, binutils, glibc, procps, coreutils }:
 
 stdenv.mkDerivation rec {
   name = "checksec-${version}";
@@ -25,9 +25,11 @@ stdenv.mkDerivation rec {
     substituteInPlace $out/bin/checksec --replace find ${findutils}/bin/find
     substituteInPlace $out/bin/checksec --replace "file $" "${file}/bin/file $"
     substituteInPlace $out/bin/checksec --replace "xargs file" "xargs ${file}/bin/file"
-    substituteInPlace $out/bin/checksec --replace " readelf -" " ${elfutils}/bin/readelf -"
-    substituteInPlace $out/bin/checksec --replace "(readelf -" "(${elfutils}/bin/readelf -"
-    substituteInPlace $out/bin/checksec --replace "command_exists readelf" "command_exists ${elfutils}/bin/readelf"
+    substituteInPlace $out/bin/checksec --replace " readelf -" " ${binutils}/bin/readelf -"
+    substituteInPlace $out/bin/checksec --replace "(readelf -" "(${binutils}/bin/readelf -"
+    substituteInPlace $out/bin/checksec --replace "command_exists readelf" "command_exists ${binutils}/bin/readelf"
+    substituteInPlace $out/bin/checksec --replace "/sbin/sysctl -" "${procps}/sbin/sysctl -"
+    substituteInPlace $out/bin/checksec --replace "/usr/bin/id -" "${coreutils}/bin/id -"
   '';
 
   phases = "unpackPhase patchPhase installPhase";
diff --git a/pkgs/os-specific/linux/drbd/default.nix b/pkgs/os-specific/linux/drbd/default.nix
index 068e49d0190..4c945a7fbac 100644
--- a/pkgs/os-specific/linux/drbd/default.nix
+++ b/pkgs/os-specific/linux/drbd/default.nix
@@ -7,7 +7,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "http://oss.linbit.com/drbd/8.4/${name}.tar.gz";
-    sha256 = "0hm1cnd7vsccyc22sg85f9aj48nijl2f1kgbvl5crv414ihv5giq";
+    sha256 = "1w4889h1ak7gy9w33kd4fgjlfpgmp6hzfya16p1pkc13bjf22mm0";
   };
 
   patches = [ ./pass-force.patch ];
diff --git a/pkgs/os-specific/linux/ffado/build-fix.patch b/pkgs/os-specific/linux/ffado/build-fix.patch
new file mode 100644
index 00000000000..b63fd65184a
--- /dev/null
+++ b/pkgs/os-specific/linux/ffado/build-fix.patch
@@ -0,0 +1,61 @@
+diff --git a/SConstruct b/SConstruct
+index ca5d5cf..76738e3 100644
+--- a/SConstruct
++++ b/SConstruct
+@@ -354,7 +354,7 @@ if conf.CheckForApp( 'which pyuic4' ) and conf.CheckForPyModule( 'dbus' ) and co
+     env['PYUIC4'] = True
+     build_mixer = True
+ 
+-if conf.CheckForApp( 'xdg-desktop-menu --help' ):
++if conf.CheckForApp( 'which xdg-desktop-menu' ):
+     env['XDG_TOOLS'] = True
+ else:
+     print """
+diff --git a/support/dbus/SConscript b/support/dbus/SConscript
+index 2b0f0c6..23069d8 100644
+--- a/support/dbus/SConscript
++++ b/support/dbus/SConscript
+@@ -44,6 +44,7 @@ if not env.GetOption( "clean" ):
+         env.MergeFlags( env['LIBXML26_FLAGS'] )
+     else:
+         env.PrependUnique( LIBS=["expat"] )
++        env.MergeFlags( "-DSERIALIZE_USE_EXPAT" )
+ 
+ env.Xml2Cpp_Proxy('controlclient-glue.h', 'control-interface.xml')
+ env.Xml2Cpp_Adaptor('controlserver-glue.h', 'control-interface.xml')
+diff --git a/support/firmware/SConscript b/support/firmware/SConscript
+index 2939cb0..307b295 100644
+--- a/support/firmware/SConscript
++++ b/support/firmware/SConscript
+@@ -36,6 +36,7 @@ if not env.GetOption( "clean" ):
+         env.MergeFlags( env['LIBXML26_FLAGS'] )
+     else:
+         env.PrependUnique( LIBS=["expat"] )
++        env.MergeFlags( "-DSERIALIZE_USE_EXPAT" )
+ 
+ static_env = env.Clone()
+ 
+diff --git a/support/tools/SConscript b/support/tools/SConscript
+index 651621d..01b11f4 100644
+--- a/support/tools/SConscript
++++ b/support/tools/SConscript
+@@ -36,6 +36,7 @@ if not e.GetOption( "clean" ):
+                 e.MergeFlags( env['LIBXML26_FLAGS'] )
+         else:
+                 e.PrependUnique( LIBS=["expat"] )
++                e.MergeFlags( "-DSERIALIZE_USE_EXPAT" )
+ 
+ #
+ # For the the ffado-diag tools
+diff --git a/tests/SConscript b/tests/SConscript
+index 307341f..4800b93 100644
+--- a/tests/SConscript
++++ b/tests/SConscript
+@@ -35,6 +35,7 @@ if not env.GetOption( "clean" ):
+ 		env.MergeFlags( env['LIBXML26_FLAGS'] )
+ 	else:
+ 		env.PrependUnique( LIBS=["expat"] )
++        env.MergeFlags( "-DSERIALIZE_USE_EXPAT" )
+ 
+ static_env = env.Clone()
+ 
diff --git a/pkgs/os-specific/linux/ffado/default.nix b/pkgs/os-specific/linux/ffado/default.nix
index 70c13be9ab4..dcbf0e567ad 100644
--- a/pkgs/os-specific/linux/ffado/default.nix
+++ b/pkgs/os-specific/linux/ffado/default.nix
@@ -1,60 +1,93 @@
-{ stdenv, fetchurl, dbus, dbus_cplusplus, expat, glibmm, libconfig
-, libavc1394, libiec61883, libraw1394, libxmlxx, makeWrapper, pkgconfig
-, pyqt4, python, pythonDBus, qt4, scons }:
+{ stdenv, fetchurl, scons, pkgconfig, which, makeWrapper, python
+, expat, libraw1394, libconfig, libavc1394, libiec61883
 
+# Optional dependencies
+, libjack2 ? null, dbus ? null, dbus_cplusplus ? null, alsaLib ? null
+, pyqt4 ? null, xdg_utils ? null
+
+, glibmm
+, pythonDBus, qt4
+
+# Other Flags
+, prefix ? ""
+}:
+
+let
+
+  shouldUsePkg = pkg: if pkg != null && stdenv.lib.any (x: x == stdenv.system) pkg.meta.platforms then pkg else null;
+
+  libOnly = prefix == "lib";
+
+  optLibjack2 = shouldUsePkg libjack2;
+  optDbus = shouldUsePkg dbus;
+  optDbus_cplusplus = shouldUsePkg dbus_cplusplus;
+  optAlsaLib = shouldUsePkg alsaLib;
+  optPyqt4 = shouldUsePkg pyqt4;
+  optXdg_utils = shouldUsePkg xdg_utils;
+in
 stdenv.mkDerivation rec {
-  name = "libffado-${version}";
+  name = "${prefix}ffado-${version}";
   version = "2.2.1";
 
   src = fetchurl {
-    url = "http://www.ffado.org/files/${name}.tgz";
+    url = "http://www.ffado.org/files/libffado-${version}.tgz";
     sha256 = "1ximic90l0av91njb123ra2zp6mg23yg5iz8xa5371cqrn79nacz";
   };
 
-  buildInputs =
-    [ dbus dbus_cplusplus expat glibmm libavc1394 libconfig
-      libiec61883 libraw1394 libxmlxx makeWrapper pkgconfig pyqt4
-      python pythonDBus qt4 scons
-    ];
+  nativeBuildInputs = [ scons pkgconfig which makeWrapper python ];
 
-  patches = [ ./enable-mixer-and-dbus.patch ];
+  buildInputs = [
+    expat libraw1394 libconfig libavc1394 libiec61883
+  ] ++ stdenv.lib.optionals (!libOnly) [
+    optLibjack2 optDbus optDbus_cplusplus optAlsaLib optPyqt4
+    optXdg_utils
+    # dbus dbus_cplusplus glibmm
+    # pyqt4
+    # python pythonDBus qt4
+  ];
 
-  # SConstruct checks cpuinfo and an objdump of /bin/mount to determine the appropriate arch
-  # Let's just skip this and tell it which to build
-  postPatch = if stdenv.isi686 then ''
-    sed '/def is_userspace_32bit(cpuinfo):/a\
-        return True' -i SConstruct
-  ''
-  else ''
+  patches = [ ./build-fix.patch ];
+
+  postPatch = ''
+    # SConstruct checks cpuinfo and an objdump of /bin/mount to determine the appropriate arch
+    # Let's just skip this and tell it which to build
     sed '/def is_userspace_32bit(cpuinfo):/a\
-        return False' -i SConstruct
+        return ${if stdenv.is64bit then "False" else "True"}' -i SConstruct
+
+    # Lots of code is missing random headers to exist
+    sed -i '1i #include <memory>' \
+      src/ffadodevice.h src/bebob/bebob_dl_mgr.cpp tests/scan-devreg.cpp
+    sed -i -e '1i #include <stdlib.h>' \
+      -e '1i #include "version.h"' \
+      src/libutil/serialize_expat.cpp
   '';
 
   # TODO fix ffado-diag, it doesn't seem to use PYPKGDIR
   buildPhase = ''
-    export PYLIBSUFFIX=lib/${python.libPrefix}/site-packages
-    scons PYPKGDIR=$out/$PYLIBSUFFIX DEBUG=False
-    sed -e "s#/usr/local#$out#" -i support/mixer-qt4/ffado/config.py
-    '';
+    export PYDIR=$out/lib/${python.libPrefix}/site-packages
 
-  installPhase = ''
-    scons PREFIX=$out LIBDIR=$out/lib SHAREDIR=$out/share/libffado \
-      PYPKGDIR=$out/$PYLIBSUFFIX UDEVDIR=$out/lib/udev/rules.d install
+    scons PYPKGDIR=$PYDIR DEBUG=False \
+      ENABLE_ALL=True \
+      SERIALIZE_USE_EXPAT=True \
+  '';
 
-    sed -e "s#/usr/local#$out#g" -i $out/bin/ffado-diag
+  installPhase = if libOnly then ''
+    scons PREFIX=$TMPDIR UDEVDIR=$TMPDIR \
+      LIBDIR=$out/lib INCLUDEDIR=$out/include install
+  '' else ''
+    scons PREFIX=$out PYPKGDIR=$PYDIR UDEVDIR=$out/lib/udev/rules.d install
 
-    PYDIR=$out/$PYLIBSUFFIX
     wrapProgram $out/bin/ffado-mixer --prefix PYTHONPATH : \
       $PYTHONPATH:$PYDIR:${pyqt4}/$LIBSUFFIX:${pythonDBus}/$LIBSUFFIX:
     wrapProgram $out/bin/ffado-diag --prefix PYTHONPATH : \
       $PYTHONPATH:$PYDIR:$out/share/libffado/python:${pyqt4}/$LIBSUFFIX:${pythonDBus}/$LIBSUFFIX:
-    '';
+  '';
 
   meta = with stdenv.lib; {
     homepage = http://www.ffado.org;
     description = "FireWire audio drivers";
     license = licenses.gpl3;
-    maintainers = [ maintainers.goibhniu ];
+    maintainers = with maintainers; [ goibhniu wkennington ];
     platforms = platforms.linux;
   };
 }
diff --git a/pkgs/os-specific/linux/ffado/enable-mixer-and-dbus.patch b/pkgs/os-specific/linux/ffado/enable-mixer-and-dbus.patch
deleted file mode 100644
index 480e0f45a92..00000000000
--- a/pkgs/os-specific/linux/ffado/enable-mixer-and-dbus.patch
+++ /dev/null
@@ -1,26 +0,0 @@
---- libffado-2.1.0/SConstruct	1970-01-01 01:00:01.000000000 +0100
-+++ libffado-2.1.0/SConstruct	2012-09-30 16:50:23.603283095 +0000
-@@ -349,11 +349,9 @@
- # Optional checks follow:
- #
- 
--# PyQT checks
--build_mixer = False
--if conf.CheckForApp( 'which pyuic4' ) and conf.CheckForPyModule( 'dbus' ) and conf.CheckForPyModule( 'PyQt4' ) and conf.CheckForPyModule( 'dbus.mainloop.qt' ):
--    env['PYUIC4'] = True
--    build_mixer = True
-+env['PYUIC4'] = True
-+build_mixer = True
-+
- 
- if conf.CheckForApp( 'xdg-desktop-menu --help' ):
-     env['XDG_TOOLS'] = True
-@@ -384,7 +382,7 @@
-     name2 = pkg.replace("+","").replace(".","").replace("-","").upper()
-     env['%s_FLAGS' % name2] = conf.GetPKGFlags( pkg, pkgs[pkg] )
- 
--if not env['DBUS1_FLAGS'] or not env['DBUSC1_FLAGS'] or not conf.CheckForApp('which dbusxx-xml2cpp'):
-+if False:
-     env['DBUS1_FLAGS'] = ""
-     env['DBUSC1_FLAGS'] = ""
-     print """
diff --git a/pkgs/os-specific/linux/firmware/b43-firmware/6.30.163.46.nix b/pkgs/os-specific/linux/firmware/b43-firmware/6.30.163.46.nix
new file mode 100644
index 00000000000..7afd464620d
--- /dev/null
+++ b/pkgs/os-specific/linux/firmware/b43-firmware/6.30.163.46.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchurl, b43FirmwareCutter }:
+
+let version = "6.30.163.46"; in
+
+stdenv.mkDerivation {
+  name = "b43-firmware-${version}";
+
+  src = fetchurl {
+    url = "http://www.lwfinger.com/b43-firmware/broadcom-wl-${version}.tar.bz2";
+    sha256 = "0baw6gcnrhxbb447msv34xg6rmlcj0gm3ahxwvdwfcvq4xmknz50";
+  };
+
+  buildInputs = [ b43FirmwareCutter ];
+
+  phases = [ "unpackPhase" "installPhase" ];
+
+  sourceRoot = ".";
+
+  installPhase = ''
+    mkdir $out
+    b43-fwcutter -w $out *.wl_apsta.o
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Firmware for cards supported by the b43 kernel module";
+    homepage = http://wireless.kernel.org/en/users/Drivers/b43;
+    downloadPage = http://www.lwfinger.com/b43-firmware;
+    license = licenses.unfree;
+    maintainers = with maintainers; [ nckx ];
+  };
+}
diff --git a/pkgs/os-specific/linux/fusionio/srcs.nix b/pkgs/os-specific/linux/fusionio/srcs.nix
new file mode 100644
index 00000000000..fb632a6e9fb
--- /dev/null
+++ b/pkgs/os-specific/linux/fusionio/srcs.nix
@@ -0,0 +1,22 @@
+{ fetchurl }:
+rec {
+  version = "3.2.10";
+
+  libvsl = fetchurl {
+    name = "fusionio-libvsl-${version}.deb";
+    url = "https://drive.google.com/uc?export=download&id=0B7U0_ZBLoB2Wc01uNk1nVURMVFk";
+    sha256 = "1i8ii9dlyskj2dvad7nfvlm1wz2s4gy5llbl29hfa13w6nhcl5wk";
+  };
+
+  util = fetchurl {
+    name = "fusionio-util-${version}.deb";
+    url = "https://drive.google.com/uc?export=download&id=0B7U0_ZBLoB2WbDVuQkwzWjZONGs";
+    sha256 = "0aw64kk5cwchjhqh5n1lpqrrh5gn4qdalnmasd25z7sijy2flxgq";
+  };
+
+  vsl = fetchurl {
+    name = "fusionio-iomemory-vsl-${version}.tar.gz";
+    url = "https://drive.google.com/uc?export=download&id=0B7U0_ZBLoB2WbXFMbExEMUFCcWM";
+    sha256 = "1zm20aa1jmmqcqkb4p9r4jsgbg371zr1abdz32rw02i9687fsgcc";
+  };
+}
diff --git a/pkgs/os-specific/linux/fusionio/util.nix b/pkgs/os-specific/linux/fusionio/util.nix
new file mode 100644
index 00000000000..16f1ef73dba
--- /dev/null
+++ b/pkgs/os-specific/linux/fusionio/util.nix
@@ -0,0 +1,45 @@
+{ stdenv, fetchurl, dpkg, glibc, gcc, libuuid }:
+
+let
+  srcs = import ./srcs.nix { inherit fetchurl; };
+in
+stdenv.mkDerivation {
+  name = "fusionio-util-${srcs.version}";
+
+  nativeBuildInputs = [ dpkg ];
+
+  buildCommand = ''
+    dpkg-deb -R ${srcs.libvsl} $TMPDIR
+    dpkg-deb -R ${srcs.util} $TMPDIR
+
+    rm $TMPDIR/usr/bin/fio-{bugreport,sanitize}
+
+    mkdir -p $out
+    cp -r $TMPDIR/{etc,usr/{bin,lib,share}} $out
+    for BIN in $(find $out/bin -type f); do
+      echo Patching $BIN
+      patchelf --set-interpreter "${glibc}/lib/ld-linux-x86-64.so.2" --set-rpath "${glibc}/lib:${gcc.cc}/lib:${libuuid}/lib:$out/lib" $BIN
+
+      # Test our binary to see if it was correctly patched
+      set +e
+      $BIN --help >/dev/null 2>&1
+      ST="$?"
+      set -e
+      if [ "$ST" -ge "10" ]; then
+        echo "Failed testing $BIN"
+        exit 1;
+      fi
+    done
+  '';
+
+  dontStrip = true;
+
+  meta = with stdenv.lib; {
+    homepage = http://fusionio.com;
+    description = "Fusionio command line utilities.";
+    license = licenses.unfree;
+    platforms = [ "x86_64-linux" ];
+    broken = stdenv.system != "x86_64-linux";
+    maintainers = with maintainers; [ wkennington ];
+  };
+}
diff --git a/pkgs/os-specific/linux/fusionio/vsl-fix-file-inode.patch b/pkgs/os-specific/linux/fusionio/vsl-fix-file-inode.patch
new file mode 100644
index 00000000000..25887ceee0f
--- /dev/null
+++ b/pkgs/os-specific/linux/fusionio/vsl-fix-file-inode.patch
@@ -0,0 +1,13 @@
+diff --git a/kfile.c b/kfile.c
+index 5014e77..a65d921 100644
+--- a/kfile.c
++++ b/kfile.c
+@@ -51,7 +51,7 @@ fusion_inode * noinline kfio_fs_inode(fusion_file *fp)
+ #if KFIOC_STRUCT_FILE_HAS_PATH
+     return (fusion_inode *) ((struct file *)fp)->f_path.dentry->d_inode;
+ #else
+-    return (fusion_inode *) ((struct file *)fp)->f_dentry->d_inode;
++    return (fusion_inode *) file_inode((struct file *)fp);
+ #endif
+ }
+ 
diff --git a/pkgs/os-specific/linux/fusionio/vsl.nix b/pkgs/os-specific/linux/fusionio/vsl.nix
new file mode 100644
index 00000000000..f3909950cb9
--- /dev/null
+++ b/pkgs/os-specific/linux/fusionio/vsl.nix
@@ -0,0 +1,37 @@
+{ stdenv, fetchurl, kernel }:
+
+let
+  srcs = import ./srcs.nix { inherit fetchurl; };
+in
+stdenv.mkDerivation rec {
+  name = "fusionio-iomemory-vsl-${srcs.version}";
+
+  src = srcs.vsl;
+
+  prePatch = ''
+    cd root/usr/src/iomemory-vsl-*
+  '';
+
+  patches = stdenv.lib.optional (stdenv.lib.versionAtLeast kernel.version "3.19") ./vsl-fix-file-inode.patch;
+
+  preBuild = ''
+    sed -i Makefile kfio_config.sh \
+      -e "s,\(KERNELDIR=\"\|KERNEL_SRC =\)[^\"]*,\1${kernel.dev}/lib/modules/${kernel.modDirVersion}/build,g"
+    export DKMS_KERNEL_VERSION=${kernel.modDirVersion}
+    export TARGET="x86_64_cc48"
+  '';
+
+  installPhase = ''
+    export INSTALL_ROOT=$out
+    make modules_install
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = http://fusionio.com;
+    description = "kernel driver for accessing fusion-io cards";
+    license = licenses.unfree;
+    platforms = [ "x86_64-linux" ];
+    broken = stdenv.system != "x86_64-linux";
+    maintainers = with maintainers; [ wkennington ];
+  };
+}
diff --git a/pkgs/os-specific/linux/hal-flash/default.nix b/pkgs/os-specific/linux/hal-flash/default.nix
new file mode 100644
index 00000000000..1ac67f19917
--- /dev/null
+++ b/pkgs/os-specific/linux/hal-flash/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchurl, autoconf, automake, dbus, glib, libtool, pkgconfig, udisks2 }:
+
+stdenv.mkDerivation {
+  name = "hal-flash-0.3.0";
+
+  src = fetchurl {
+    url = "https://github.com/cshorler/hal-flash/archive/v0.3.0.tar.gz";
+    sha256 = "163pqy39cca8cnf8rm8zr63ndsnr7rki9pf9j7dl9gyxmi7sx88s";
+  };
+
+  buildInputs = [ autoconf automake dbus glib libtool pkgconfig udisks2 ];
+
+  preConfigure = "libtoolize && aclocal && autoconf && automake --add-missing";
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/cshorler/hal-flash;
+    description = "libhal stub library to satisfy the Flash Player DRM requirements.";
+    longDescription =
+      ''
+        Stub library based loosely upon libhal.[ch] from the hal-0.5.14
+        package.  Provides the minimum necessary functionality to enable
+        libflashplayer.so/libadobecp.so to play back DRM content.
+      '';
+    license = "afl21 gpl2";
+    maintainers = with maintainers; [ malyn ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/os-specific/linux/hostapd/default.nix b/pkgs/os-specific/linux/hostapd/default.nix
index 84535e8d25e..39982859712 100644
--- a/pkgs/os-specific/linux/hostapd/default.nix
+++ b/pkgs/os-specific/linux/hostapd/default.nix
@@ -1,5 +1,6 @@
-{ stdenv, fetchurl, libnl, openssl, pkgconfig }:
+{ stdenv, fetchurl, pkgconfig, libnl, openssl, sqlite ? null }:
 
+with stdenv.lib;
 stdenv.mkDerivation rec {
   name = "hostapd-${version}";
   version = "2.4";
@@ -9,25 +10,57 @@ stdenv.mkDerivation rec {
     sha256 = "0zv5pnfrp6z7jjbskzgdb2rlmlbvdxmmis7ca94x5jy9s5mypq3g";
   };
 
-  buildInputs = [ libnl openssl pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ libnl openssl sqlite ];
+
+  extraConfig = ''
+    CONFIG_DRIVER_WIRED=y
+    CONFIG_LIBNL32=y
+    CONFIG_EAP_SIM=y
+    CONFIG_EAP_AKA=y
+    CONFIG_EAP_AKA_PRIME=y
+    CONFIG_EAP_PAX=y
+    CONFIG_EAP_PWD=y
+    CONFIG_EAP_SAKE=y
+    CONFIG_EAP_GPSK=y
+    CONFIG_EAP_GPSK_SHA256=y
+    CONFIG_EAP_FAST=y
+    CONFIG_EAP_IKEV2=y
+    CONFIG_EAP_TNC=y
+    CONFIG_EAP_EKE=y
+    CONFIG_RADIUS_SERVER=y
+    CONFIG_IEEE80211R=y
+    CONFIG_IEEE80211N=y
+    CONFIG_IEEE80211AC=y
+    CONFIG_FULL_DYNAMIC_VLAN=y
+    CONFIG_VLAN_NETLINK=y
+    CONFIG_TLS=openssl
+    CONFIG_TLSV11=y
+    CONFIG_TLSV12=y
+    CONFIG_INTERNETWORKING=y
+    CONFIG_HS20=y
+    CONFIG_ACS=y
+  '' + optionalString (sqlite != null) ''
+    CONFIG_SQLITE=y
+  '';
 
   configurePhase = ''
     cd hostapd
-    substituteInPlace Makefile --replace "/usr/local/bin" "$out/bin"
-    mv defconfig .config
-    echo CONFIG_LIBNL32=y | tee -a .config
-    echo CONFIG_IEEE80211N=y | tee -a .config
+    cp -v defconfig .config
+    echo "$extraConfig" >> .config
+    cat -n .config
+    substituteInPlace Makefile --replace /usr/local $out
     export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE $(pkg-config --cflags libnl-3.0)"
   '';
 
   preInstall = "mkdir -p $out/bin";
 
-  meta = with stdenv.lib; {
+  meta = {
     homepage = http://hostap.epitest.fi;
     repositories.git = git://w1.fi/hostap.git;
     description = "A user space daemon for access point and authentication servers";
     license = licenses.gpl2;
-    maintainers = [ maintainers.phreedom ];
+    maintainers = with maintainers; [ phreedom wkennington ];
     platforms = platforms.linux;
   };
 }
diff --git a/pkgs/os-specific/linux/jfbview/default.nix b/pkgs/os-specific/linux/jfbview/default.nix
index b497784861f..7672318392f 100644
--- a/pkgs/os-specific/linux/jfbview/default.nix
+++ b/pkgs/os-specific/linux/jfbview/default.nix
@@ -1,40 +1,44 @@
-{ stdenv, fetchFromGitHub, freetype, imlib2, jbig2dec, libjpeg, libX11, mujs
-, mupdf, ncurses, openjpeg, openssl }:
+# FIXME: remove gcc49 when the default gcc supports C++1y
+{ stdenv, fetchFromGitHub, freetype, gcc49, imlib2, jbig2dec, libjpeg, libX11
+, mujs, mupdf, ncurses, openjpeg, openssl }:
 
+let
+  version = "0.5.1";
+  binaries = [ "jfbpdf" "jfbview" "jpdfcat" "jpdfgrep" ];
+in
 stdenv.mkDerivation rec {
-  version = "0.4.2"; # TODO: update to 0.5 or later when nixpkgs has caught up
   name = "jfbview-${version}";
 
   src = fetchFromGitHub {
+    sha256 = "113bkf49q04k9rjps5l28ychmzsfjajp9cjhr433s9ld0972z01m";
+    rev = version;
     repo = "JFBView";
     owner = "jichu4n";
-    rev = version;
-    sha256 = "1hhlzvs0jhygd3mqpzg5zymrbay9c8ilc4wjnwg00lvxhv3rwswr";
   };
 
-  buildInputs = [ freetype imlib2 jbig2dec libjpeg libX11 mujs mupdf ncurses
-    openjpeg openssl ];
+  buildInputs = [ freetype gcc49 imlib2 jbig2dec libjpeg libX11 mujs mupdf
+    ncurses openjpeg openssl ];
 
+  buildFlags = binaries;
   enableParallelBuilding = true;
 
-  makeFlags = "jfbpdf jfbview";
-
   installPhase = ''
     mkdir -p $out/bin
-    install jfbpdf jfbview $out/bin
+    install ${toString binaries} $out/bin
   '';
 
   meta = with stdenv.lib; {
+    inherit version;
     description = "PDF and image viewer for the Linux framebuffer";
     longDescription = ''
-      PDF and image viewer for the Linux framebuffer. Very fast with a number
-      of advanced and unique features including:
-      - Reads PDFs (MuPDF) and common image formats (Imlib2).
-      - Supports arbitrary zoom (10% - 1000%) and rotation.
-      - Table of Contents (TOC) viewer for PDF documents.
-      - Multi-threaded rendering on multi-core machines.
-      - Asynchronous background rendering of the next page.
-      - Customizable multi-threaded caching.
+      A very fast PDF and image viewer for the Linux framebuffer with some
+      advanced and unique features, including:
+      - Reads PDFs (MuPDF) and common image formats (Imlib2)
+      - Supports arbitrary zoom (10% - 1000%) and rotation
+      - Table of Contents (TOC) viewer for PDF documents
+      - Multi-threaded rendering on multi-core machines
+      - Asynchronous background rendering of the next page
+      - Customizable multi-threaded caching
     '';
     homepage = http://seasonofcode.com/pages/jfbview.html;
     license = with licenses; asl20;
diff --git a/pkgs/os-specific/linux/kernel/grsec-path.patch b/pkgs/os-specific/linux/kernel/grsec-path.patch
index aaf7d80dc91..6f477c22b5e 100644
--- a/pkgs/os-specific/linux/kernel/grsec-path.patch
+++ b/pkgs/os-specific/linux/kernel/grsec-path.patch
@@ -1,18 +1,17 @@
 diff --git a/kernel/kmod.c b/kernel/kmod.c
-index a26e825..29baec1 100644
+index a689506..30747b4 100644
 --- a/kernel/kmod.c
 +++ b/kernel/kmod.c
-@@ -294,10 +294,9 @@ static int ____call_usermodehelper(void *data)
+@@ -294,10 +294,8 @@ static int ____call_usermodehelper(void *data)
  	   out the path to be used prior to this point and are now operating
  	   on that copy
  	*/
 -	if ((strncmp(sub_info->path, "/sbin/", 6) && strncmp(sub_info->path, "/usr/lib/", 9) &&
 -	     strncmp(sub_info->path, "/lib/", 5) && strncmp(sub_info->path, "/lib64/", 7) &&
--	     strncmp(sub_info->path, "/usr/libexec/", 13) &&
+-	     strncmp(sub_info->path, "/usr/libexec/", 13) && strncmp(sub_info->path, "/usr/bin/", 9) &&
 -	     strcmp(sub_info->path, "/usr/share/apport/apport")) || strstr(sub_info->path, "..")) {
-+        if ((strncmp(sub_info->path, "/sbin/", 6) && strncmp(sub_info->path, "/nix/store/", 11) &&
-+             strncmp(sub_info->path, "/run/current-system/systemd/lib/", 32)) ||
-+             strstr(sub_info->path, "..")) {
- 		printk(KERN_ALERT "grsec: denied exec of usermode helper binary %.950s located outside of /sbin and system library paths\n", sub_info->path);
++	if ((strncmp(sub_info->path, "/sbin/", 6) && strncmp(sub_info->path, "/nix/store/", 11) &&
++	     strncmp(sub_info->path, "/run/current-system/systemd/lib/", 32)) || strstr(sub_info->path, "..")) {
+ 		printk(KERN_ALERT "grsec: denied exec of usermode helper binary %.950s located outside of permitted system paths\n", sub_info->path);
  		retval = -EPERM;
  		goto out;
diff --git a/pkgs/os-specific/linux/kernel/linux-3.10.nix b/pkgs/os-specific/linux/kernel/linux-3.10.nix
index 853b784a335..ff9f2f38243 100644
--- a/pkgs/os-specific/linux/kernel/linux-3.10.nix
+++ b/pkgs/os-specific/linux/kernel/linux-3.10.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, ... } @ args:
 
 import ./generic.nix (args // rec {
-  version = "3.10.73";
+  version = "3.10.75";
   extraMeta.branch = "3.10";
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.xz";
-    sha256 = "0xy8738sdbw7lbqwkmbhr2zghva5nyfqq163r6jmjr6cfw116kin";
+    sha256 = "00wqcmya2ky9f1djlq99mcq8fyvpabnjnp5cn61japlgk8p7r60q";
   };
 
   features.iwlwifi = true;
diff --git a/pkgs/os-specific/linux/kernel/linux-3.12.nix b/pkgs/os-specific/linux/kernel/linux-3.12.nix
index 951b55c2f35..bd8c7d99daa 100644
--- a/pkgs/os-specific/linux/kernel/linux-3.12.nix
+++ b/pkgs/os-specific/linux/kernel/linux-3.12.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, ... } @ args:
 
 import ./generic.nix (args // rec {
-  version = "3.12.39";
+  version = "3.12.40";
   extraMeta.branch = "3.12";
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.xz";
-    sha256 = "0svd2rnkrzpmnrv5qd5vfz4wkff6973s68zg5a1blmjs4p5asvl6";
+    sha256 = "1cdivv1n0r057y2wq38ci00im8z24jrnvyz5vwhmnzv0l4qzbhw5";
   };
 
   features.iwlwifi = true;
diff --git a/pkgs/os-specific/linux/kernel/linux-3.14.nix b/pkgs/os-specific/linux/kernel/linux-3.14.nix
index 8289235cd6e..188eb6f699c 100644
--- a/pkgs/os-specific/linux/kernel/linux-3.14.nix
+++ b/pkgs/os-specific/linux/kernel/linux-3.14.nix
@@ -1,22 +1,15 @@
 { stdenv, fetchurl, ... } @ args:
 
 import ./generic.nix (args // rec {
-  version = "3.14.37";
+  version = "3.14.39";
   # Remember to update grsecurity!
   extraMeta.branch = "3.14";
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.xz";
-    sha256 = "1pq4i97vys38rl8ylx4s08qgh9yz3cl840j1f70yzakmc2017byc";
+    sha256 = "0zgfiqlvmprbn55k9ijf6db027mxlcww76y47g4g7vcj5qrpq6rd";
   };
 
-  # FIXME: remove with the next point release.
-  kernelPatches = args.kernelPatches ++
-    [ { name = "btrfs-fix-deadlock";
-        patch = ./btrfs-fix-deadlock.patch;
-      }
-    ];
-
   features.iwlwifi = true;
   features.efiBootStub = true;
   features.needsCifsUtils = true;
diff --git a/pkgs/os-specific/linux/kernel/linux-3.18.nix b/pkgs/os-specific/linux/kernel/linux-3.18.nix
index 8f1d9bd2765..aabeee6302f 100644
--- a/pkgs/os-specific/linux/kernel/linux-3.18.nix
+++ b/pkgs/os-specific/linux/kernel/linux-3.18.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, ... } @ args:
 
 import ./generic.nix (args // rec {
-  version = "3.18.11";
+  version = "3.18.12";
   extraMeta.branch = "3.18";
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.xz";
-    sha256 = "19di7k38adnwimxddd1v6flgdsvxhgf8iswjwfyqi2p2bdcb0p5d";
+    sha256 = "06wfgg00vc5a2vvmg158ipbmigx803hdp3lhf4kv25p4sdmvbsl2";
   };
 
   # FIXME: remove with the next point release.
diff --git a/pkgs/os-specific/linux/kernel/linux-3.19.nix b/pkgs/os-specific/linux/kernel/linux-3.19.nix
index e42775f0356..79302819d7c 100644
--- a/pkgs/os-specific/linux/kernel/linux-3.19.nix
+++ b/pkgs/os-specific/linux/kernel/linux-3.19.nix
@@ -1,22 +1,15 @@
 { stdenv, fetchurl, ... } @ args:
 
 import ./generic.nix (args // rec {
-  version = "3.19.3";
+  version = "3.19.5";
   # Remember to update grsecurity!
   extraMeta.branch = "3.19";
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.xz";
-    sha256 = "0nis1r9fg562ysirzlyvfxvirpcfhxhhpfv3s13ccz20qiqiy46f";
+    sha256 = "0s2yiyk1ks0z2fj8a8g56hkp6mfyvh9c34m1jpixhg9zck9xjdix";
   };
 
-  # FIXME: remove with the next point release.
-  kernelPatches = args.kernelPatches ++
-    [ { name = "btrfs-fix-deadlock";
-        patch = ./btrfs-fix-deadlock.patch;
-      }
-    ];
-
   features.iwlwifi = true;
   features.efiBootStub = true;
   features.needsCifsUtils = true;
diff --git a/pkgs/os-specific/linux/kernel/linux-3.4.nix b/pkgs/os-specific/linux/kernel/linux-3.4.nix
index 2d053023721..eaf5bfad6d8 100644
--- a/pkgs/os-specific/linux/kernel/linux-3.4.nix
+++ b/pkgs/os-specific/linux/kernel/linux-3.4.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, ... } @ args:
 
 import ./generic.nix (args // rec {
-  version = "3.4.106";
+  version = "3.4.107";
   extraMeta.branch = "3.4";
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.xz";
-    sha256 = "1l1k2kmlz0j12ly63w3mhvdzp5fpc22ajda4kw66fyjx96npm8sc";
+    sha256 = "1y3mxisdcnz3kj416bpnnn9cn3wqqjqvcjadhylc1wypqkpcvphq";
   };
 
   kernelPatches = args.kernelPatches ++
diff --git a/pkgs/os-specific/linux/kernel/linux-4.0.nix b/pkgs/os-specific/linux/kernel/linux-4.0.nix
new file mode 100644
index 00000000000..b63aa7e9932
--- /dev/null
+++ b/pkgs/os-specific/linux/kernel/linux-4.0.nix
@@ -0,0 +1,18 @@
+{ stdenv, fetchurl, ... } @ args:
+
+import ./generic.nix (args // rec {
+  version = "4.0";
+  modDirVersion = "4.0.0";
+  extraMeta.branch = "4.0";
+
+  src = fetchurl {
+    url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
+    sha256 = "14argl6ywkggdvgiycfx4jl2d7290f631ly59wfggj4vjx27sbqg";
+  };
+
+  features.iwlwifi = true;
+  features.efiBootStub = true;
+  features.needsCifsUtils = true;
+  features.canDisableNetfilterConntrackHelpers = true;
+  features.netfilterRPFilter = true;
+} // (args.argsOverride or {}))
diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix
index ea29c7f9e0c..620df6dd6cf 100644
--- a/pkgs/os-specific/linux/kernel/manual-config.nix
+++ b/pkgs/os-specific/linux/kernel/manual-config.nix
@@ -116,7 +116,9 @@ let
       ++ optional installsFirmware "INSTALL_FW_PATH=$(out)/lib/firmware";
 
       # Some image types need special install targets (e.g. uImage is installed with make uinstall)
-      installTargets = [ (if platform.kernelTarget == "uImage" then "uinstall" else "install") ];
+      installTargets = [ (if platform.kernelTarget == "uImage" then "uinstall" else
+                          if platform.kernelTarget == "zImage" then "zinstall" else
+                          "install") ];
 
       postInstall = (optionalString installsFirmware ''
         mkdir -p $out/lib/firmware
diff --git a/pkgs/os-specific/linux/kernel/patches.nix b/pkgs/os-specific/linux/kernel/patches.nix
index 0b17c44be98..998717b1f5d 100644
--- a/pkgs/os-specific/linux/kernel/patches.nix
+++ b/pkgs/os-specific/linux/kernel/patches.nix
@@ -65,17 +65,17 @@ rec {
   };
 
   grsecurity_stable = grsecPatch
-    { kversion  = "3.14.37";
-      revision  = "201504051405";
+    { kversion  = "3.14.39";
+      revision  = "201504190814";
       branch    = "stable";
-      sha256    = "0w1rz5g4wwd22ivii7m7qjgakdynzjwpqxiydx51kiw5j0avkzs3";
+      sha256    = "0pjq0ggifh6hp5y62dl0ydskpmsmzj1cxxjaaqs6fpwn5ndsdji7";
     };
 
   grsecurity_unstable = grsecPatch
-    { kversion  = "3.19.3";
-      revision  = "201504021826";
+    { kversion  = "3.19.5";
+      revision  = "201504190814";
       branch    = "test";
-      sha256    = "0r3gsha4x9bkzg9n4rcwzi9f3hkbqrf8yga1dd83kyd10fns4lzm";
+      sha256    = "0wj9bximhs41b11hh113mishmc1ya8bncc0v91cbrivx5y5hjpz0";
     };
 
   grsec_fix_path =
diff --git a/pkgs/os-specific/linux/kexectools/default.nix b/pkgs/os-specific/linux/kexectools/default.nix
index 09594a5c59e..f26c72bd6e5 100644
--- a/pkgs/os-specific/linux/kexectools/default.nix
+++ b/pkgs/os-specific/linux/kexectools/default.nix
@@ -1,18 +1,19 @@
 { stdenv, fetchurl, zlib }:
 
 stdenv.mkDerivation rec {
-  name = "kexec-tools-2.0.4";
+  name = "kexec-tools-2.0.9";
 
   src = fetchurl {
     url = "http://horms.net/projects/kexec/kexec-tools/${name}.tar.xz";
-    sha256 = "1ikqm4w125h060dsvg9brri6ma51qn76mjjff6s1bss6sw0apxg5";
+    sha256 = "0wag8pxn13i0j91x2bszpmi5i88xnndcmqz1w5a0jdbnxff4mqwa";
   };
 
   buildInputs = [ zlib ];
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = http://horms.net/projects/kexec/kexec-tools;
     description = "Tools related to the kexec Linux feature";
-    platforms = stdenv.lib.platforms.linux;
+    platforms = with platforms; linux;
+    maintainers = with maintainers; [ nckx ];
   };
 }
diff --git a/pkgs/os-specific/linux/kmod-blacklist-ubuntu/default.nix b/pkgs/os-specific/linux/kmod-blacklist-ubuntu/default.nix
index 686f63720fc..c750006fcd2 100644
--- a/pkgs/os-specific/linux/kmod-blacklist-ubuntu/default.nix
+++ b/pkgs/os-specific/linux/kmod-blacklist-ubuntu/default.nix
@@ -6,7 +6,7 @@ stdenv.mkDerivation {
   name = "kmod-blacklist-${version}";
 
   src = fetchurl {
-    url = "http://archive.ubuntu.com/ubuntu/pool/main/k/kmod/kmod_9-${version}.debian.tar.gz";
+    url = "https://launchpad.net/ubuntu/+archive/primary/+files/kmod_9-${version}.debian.tar.gz";
     sha256 = "0h6h0zw2490iqj9xa2sz4309jyfmcc50jdvkhxa1nw90npxglp67";
   };
 
diff --git a/pkgs/os-specific/linux/libcgroup/default.nix b/pkgs/os-specific/linux/libcgroup/default.nix
index 6323d8c4f23..b51211e9aaf 100644
--- a/pkgs/os-specific/linux/libcgroup/default.nix
+++ b/pkgs/os-specific/linux/libcgroup/default.nix
@@ -1,21 +1,21 @@
 { stdenv, fetchurl, pam, yacc, flex }:
 
 stdenv.mkDerivation rec {
-  name = "libcgroup-0.38";
+  name    = "libcgroup-${version}";
+  version = "0.41";
 
   src = fetchurl {
     url = "mirror://sourceforge/libcg/${name}.tar.bz2";
-    sha256 = "0zw6144jlvzx0hasl4b07vjfa4lm12jaax6zzkljzxlmifjd2djx";
+    sha256 = "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4";
   };
 
-  buildInputs = [ pam ];
-
-  nativeBuildInputs = [ yacc flex ];
+  buildInputs = [ pam yacc flex ];
 
   meta = {
-    description = "Library and tools to manage Linux's cgroup resource management system";
-    homepage = http://libcg.sourceforge.net/;
-    license = "LGPL";
-    platforms = stdenv.lib.platforms.linux;
+    description = "Library and tools to manage Linux cgroups";
+    homepage    = "http://libcg.sourceforge.net/";
+    license     = stdenv.lib.licenses.lgpl2;
+    platforms   = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
   };
 }
diff --git a/pkgs/os-specific/linux/mcelog/default.nix b/pkgs/os-specific/linux/mcelog/default.nix
index 463722d2c96..342e29a6d2e 100644
--- a/pkgs/os-specific/linux/mcelog/default.nix
+++ b/pkgs/os-specific/linux/mcelog/default.nix
@@ -1,37 +1,30 @@
-{ stdenv, fetchgit }:
-
-# Shows the machine check exceptions logged by the kernel.
-# E.g. a log is generated when intel processors cpu-throttle.
-
-# The releases of this package are no longer on kernel.org
-# hence we fetch them from github. Apparently, these
-# are also more recent.
-
-let
-
-  rev = "7fa99818367a6d17014b36d6f918ad848cbe7ce2";
-  version = "1.0pre-${stdenv.lib.strings.substring 0 7 rev}"; 
-  sha256 = "15eea3acd76190c7922c71028b31963221a2eefd8afa713879e191a26bc22ae7";
-
-in stdenv.mkDerivation {
+{ stdenv, fetchFromGitHub }:
 
+let version = "116"; in
+stdenv.mkDerivation {
   name = "mcelog-${version}";
 
-  src = fetchgit {
-    url = "https://github.com/andikleen/mcelog";
-    inherit sha256;
-    inherit rev;
+  src = fetchFromGitHub {
+    sha256 = "0nr3b924ardz9c1skna8finrjq22ac2vihp3zck9jixc9d5mvrmf";
+    rev = "v${version}";
+    repo = "mcelog";
+    owner = "andikleen";
   };
 
-  makeFlags = "prefix=$(out) etcprefix=$(out) DOCDIR=$(out)/share/doc";
-
-  preInstall = ''
-    mkdir -p $out/share/doc
+  postPatch = ''
+    for i in mcelog.conf paths.h; do
+      substituteInPlace $i --replace /etc $out/etc
+    done
+    touch mcelog.conf.5 # avoid regeneration requiring Python
   '';
 
-  meta = {
-    description = "Tool to display logged machine check exceptions";
+  installFlags = "DESTDIR=$(out) prefix= DOCDIR=/share/doc";
+
+  meta = with stdenv.lib; {
+    inherit version;
+    description = "Log machine checks (memory, IO, and CPU hardware errors)";
     homepage = http://mcelog.org/;
-    license = stdenv.lib.licenses.gpl2;
+    license = with licenses; gpl2;
+    maintainers = with maintainers; [ nckx ];
   };
 }
diff --git a/pkgs/os-specific/linux/numactl/default.nix b/pkgs/os-specific/linux/numactl/default.nix
index b9240805865..d895a960010 100644
--- a/pkgs/os-specific/linux/numactl/default.nix
+++ b/pkgs/os-specific/linux/numactl/default.nix
@@ -1,26 +1,20 @@
-{ fetchurl, stdenv }:
+{ stdenv, fetchurl, autoreconfHook }:
 
 stdenv.mkDerivation rec {
-  name = "numactl-1.0.2";
+  name = "numactl-2.0.10";
+
   src = fetchurl {
     url = "ftp://oss.sgi.com/www/projects/libnuma/download/${name}.tar.gz";
-    sha256 = "0hbrrh7a8cradj1xdl3wvyp9afx1hzsk90g2lkwd5pn6bniai31j";
+    sha256 = "0qfv2ks6d3gm0mw5sj4cbhsd7cbsb7qm58xvchl2wfzifkzcinnv";
   };
 
-  patchPhase = ''
-    sed -i "Makefile" -es"|^ *prefix *:=.*$|prefix := $out|g"
-  '';
-
-  preInstall = ''
-    # The `install' rule expects this directory to be available.
-    mkdir -p "$out/share/man/man5"
-  '';
+  nativeBuildInputs = [ autoreconfHook ];
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "Library and tools for non-uniform memory access (NUMA) machines";
-    license = [ "LGPLv2.1" # library
-                "GPLv2"    # command-line tools
-	      ];
     homepage = http://oss.sgi.com/projects/libnuma/;
+    license = licenses.gpl2;
+    platforms = with platforms; linux;
+    maintainers = with maintainers; [ wkennington ];
   };
 }
diff --git a/pkgs/os-specific/linux/schedtool/default.nix b/pkgs/os-specific/linux/schedtool/default.nix
new file mode 100644
index 00000000000..b2d85376c6a
--- /dev/null
+++ b/pkgs/os-specific/linux/schedtool/default.nix
@@ -0,0 +1,20 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "schedtool-1.3.0";
+
+  src = fetchurl {
+    url = "http://freequaos.host.sk/schedtool/${name}.tar.bz2";
+    sha256 = "1ky8q3jg4lsxbnlmm51q3jkxh160zy0l6a4xkdy2yncxc4m2l02f";
+  };
+
+  makeFlags = [ "DESTDIR=$(out)" "DESTPREFIX=" ];
+
+  meta = with stdenv.lib; {
+    description = "Query or alter a process' scheduling policy under Linux";
+    homepage = "http://freequaos.host.sk/schedtool/";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ abbradar ];
+  };
+}
diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix
index 4b322be0a7e..baa76d96937 100644
--- a/pkgs/os-specific/linux/systemd/default.nix
+++ b/pkgs/os-specific/linux/systemd/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl, pkgconfig, intltool, gperf, libcap, dbus, kmod
 , zlib, xz, pam, acl, cryptsetup, libuuid, m4, utillinux, libffi
-, glib, kbd, libxslt, coreutils, libgcrypt, sysvtools
+, glib, kbd, libxslt, coreutils, libgcrypt
 , kexectools, libmicrohttpd, linuxHeaders
 , pythonPackages ? null, pythonSupport ? false
 }:
@@ -80,7 +80,7 @@ stdenv.mkDerivation rec {
           --replace /sbin/fsck ${utillinux.bin}/sbin/fsck \
           --replace /bin/echo ${coreutils}/bin/echo \
           --replace /bin/cat ${coreutils}/bin/cat \
-          --replace /sbin/sulogin ${sysvtools}/sbin/sulogin \
+          --replace /sbin/sulogin ${utillinux}/sbin/sulogin \
           --replace /sbin/kexec ${kexectools}/sbin/kexec
       done
 
diff --git a/pkgs/os-specific/linux/trace-cmd/default.nix b/pkgs/os-specific/linux/trace-cmd/default.nix
new file mode 100644
index 00000000000..1a22d094867
--- /dev/null
+++ b/pkgs/os-specific/linux/trace-cmd/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchgit, asciidoc, docbook_xsl, libxslt }:
+
+stdenv.mkDerivation rec {
+  name    = "trace-cmd-${version}";
+  version = "2.5.3";
+
+  src = fetchgit {
+    url    = "git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git";
+    rev    = "refs/tags/trace-cmd-v${version}";
+    sha256 = "32db3df07d0371c2b072029c6c86c4204be8cbbcb53840fa8c42dbf2e35c047b";
+  };
+
+  buildInputs = [ asciidoc libxslt ];
+
+  configurePhase = "true";
+  buildPhase     = "make prefix=$out MANPAGE_DOCBOOK_XSL=${docbook_xsl}/xml/xsl/docbook/manpages/docbook.xsl all doc";
+  installPhase   = "make prefix=$out install install_doc";
+
+  meta = {
+    description = "user-space tools for the Linux kernel ftrace subsystem";
+    license     = stdenv.lib.licenses.gpl2;
+    platforms   = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
+  };
+}
diff --git a/pkgs/os-specific/linux/trinity/default.nix b/pkgs/os-specific/linux/trinity/default.nix
new file mode 100644
index 00000000000..9b7e2a6876a
--- /dev/null
+++ b/pkgs/os-specific/linux/trinity/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  name = "trinity-${version}";
+  version = "1.5";
+
+  src = fetchFromGitHub {
+    owner = "kernelslacker";
+    repo = "trinity";
+    rev = "v${version}";
+    sha256 = "0diwkda6n7yw8plfanivncwangk2kv1acxv0kyk3ly5jhlajwc0s";
+  };
+
+  patchPhase = ''
+    patchShebangs ./configure.sh
+    patchShebangs ./scripts/
+    substituteInPlace Makefile --replace '/usr/bin/wc' 'wc'
+  '';
+
+  configurePhase = "./configure.sh";
+
+  installPhase = "make DESTDIR=$out install";
+
+  meta = with stdenv.lib; {
+    description = "A Linux System call fuzz tester";
+    homepage = http://codemonkey.org.uk/projects/trinity/;
+    license = licenses.gpl2;
+    maintainers = [ maintainers.dezgeg ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/os-specific/linux/v86d/default.nix b/pkgs/os-specific/linux/v86d/default.nix
index f7e0c5ca5e2..0ef992a4b44 100644
--- a/pkgs/os-specific/linux/v86d/default.nix
+++ b/pkgs/os-specific/linux/v86d/default.nix
@@ -1,32 +1,38 @@
-{stdenv, fetchurl, klibc, kernel, withKlibc ? true}:
+{ stdenv, fetchurl
+, kernel, klibc
+}:
 
 stdenv.mkDerivation rec {
   name = "v86d-${version}-${kernel.version}";
   version = "0.1.10";
 
   src = fetchurl {
-    url = "mirror://gentoo/distfiles//v86d-${version}.tar.bz2";
-    sha256 = "0p3kwqjis941pns9948dxfnjnl5lwd8f2b6x794whs7g32p68jb3";
+    url = "https://github.com/mjanusz/v86d/archive/v86d-${version}.tar.gz";
+    sha256 = "1flnpp8rc945cxr6jr9dlm8mi8gr181zrp2say4269602s1a4ymg";
   };
 
-  buildInputs = stdenv.lib.optional withKlibc klibc;
-
-  configurePhase = ''
-    bash ./configure $configureFlags
+  patchPhase = ''
+    patchShebangs configure
   '';
 
-  configureFlags = if withKlibc then [ "--with-klibc" ] else [ "--default" ];
+  configureFlags = [ "--with-klibc" "--with-x86emu" ];
 
   makeFlags = [
     "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source"
     "DESTDIR=$(out)"
   ];
 
-  meta = {
-    description = "A userspace helper that runs x86 code in an emulated environment";
-    homepage = http://dev.gentoo.org/~spock/projects/uvesafb/;
-    license = stdenv.lib.licenses.gpl2;
+  configurePhase = ''
+    ./configure $configureFlags
+  '';
+
+  buildInputs = [ klibc ];
+
+  meta = with stdenv.lib; {
+    description = "A daemon to run x86 code in an emulated environment";
+    homepage = https://github.com/mjanusz/v86d;
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ codyopel ];
     platforms = [ "i686-linux" "x86_64-linux" ];
   };
 }
-
diff --git a/pkgs/os-specific/linux/wpa_supplicant/0001-P2P-Validate-SSID-element-length-before-copying-it-C.patch b/pkgs/os-specific/linux/wpa_supplicant/0001-P2P-Validate-SSID-element-length-before-copying-it-C.patch
new file mode 100644
index 00000000000..de1964ca769
--- /dev/null
+++ b/pkgs/os-specific/linux/wpa_supplicant/0001-P2P-Validate-SSID-element-length-before-copying-it-C.patch
@@ -0,0 +1,42 @@
+From 9ed4eee345f85e3025c33c6e20aa25696e341ccd Mon Sep 17 00:00:00 2001
+From: Jouni Malinen <jouni@qca.qualcomm.com>
+Date: Tue, 7 Apr 2015 11:32:11 +0300
+Subject: [PATCH] P2P: Validate SSID element length before copying it
+ (CVE-2015-1863)
+
+This fixes a possible memcpy overflow for P2P dev->oper_ssid in
+p2p_add_device(). The length provided by the peer device (0..255 bytes)
+was used without proper bounds checking and that could have resulted in
+arbitrary data of up to 223 bytes being written beyond the end of the
+dev->oper_ssid[] array (of which about 150 bytes would be beyond the
+heap allocation) when processing a corrupted management frame for P2P
+peer discovery purposes.
+
+This could result in corrupted state in heap, unexpected program
+behavior due to corrupted P2P peer device information, denial of service
+due to process crash, exposure of memory contents during GO Negotiation,
+and potentially arbitrary code execution.
+
+Thanks to Google security team for reporting this issue and smart
+hardware research group of Alibaba security team for discovering it.
+
+Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
+---
+ src/p2p/p2p.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c
+index f584fae..a45fe73 100644
+--- a/src/p2p/p2p.c
++++ b/src/p2p/p2p.c
+@@ -778,6 +778,7 @@ int p2p_add_device(struct p2p_data *p2p, const u8 *addr, int freq,
+ 	if (os_memcmp(addr, p2p_dev_addr, ETH_ALEN) != 0)
+ 		os_memcpy(dev->interface_addr, addr, ETH_ALEN);
+ 	if (msg.ssid &&
++	    msg.ssid[1] <= sizeof(dev->oper_ssid) &&
+ 	    (msg.ssid[1] != P2P_WILDCARD_SSID_LEN ||
+ 	     os_memcmp(msg.ssid + 2, P2P_WILDCARD_SSID, P2P_WILDCARD_SSID_LEN)
+ 	     != 0)) {
+-- 
+1.9.1
+
diff --git a/pkgs/os-specific/linux/wpa_supplicant/build-fix.patch b/pkgs/os-specific/linux/wpa_supplicant/build-fix.patch
new file mode 100644
index 00000000000..a186cdad969
--- /dev/null
+++ b/pkgs/os-specific/linux/wpa_supplicant/build-fix.patch
@@ -0,0 +1,12 @@
+diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile
+index 0f82af9..70564ff 100644
+--- a/wpa_supplicant/Makefile
++++ b/wpa_supplicant/Makefile
+@@ -1558,6 +1558,7 @@ OBJS += $(CONFIG_MAIN).o
+ ifdef CONFIG_PRIVSEP
+ OBJS_priv += $(OBJS_d) ../src/drivers/drivers.o
+ OBJS_priv += $(OBJS_l2)
++OBJS_priv += ../src/crypto/crypto_openssl.o
+ OBJS_priv += ../src/utils/os_$(CONFIG_OS).o
+ OBJS_priv += ../src/utils/$(CONFIG_ELOOP).o
+ OBJS_priv += ../src/utils/common.o
diff --git a/pkgs/os-specific/linux/wpa_supplicant/default.nix b/pkgs/os-specific/linux/wpa_supplicant/default.nix
index 988242e3c42..f6142bd630f 100644
--- a/pkgs/os-specific/linux/wpa_supplicant/default.nix
+++ b/pkgs/os-specific/linux/wpa_supplicant/default.nix
@@ -1,47 +1,91 @@
-{ stdenv, fetchurl, lib, openssl, dbus_libs, pkgconfig, libnl
-, readlineSupport ? true, readline
+{ stdenv, fetchurl, lib, openssl, pkgconfig, libnl
+, dbus_libs ? null, readline ? null, pcsclite ? null
 }:
 
-assert readlineSupport -> readline != null;
-
+with stdenv.lib;
 stdenv.mkDerivation rec {
-  version = "2.3";
+  version = "2.4";
 
   name = "wpa_supplicant-${version}";
 
   src = fetchurl {
     url = "http://hostap.epitest.fi/releases/${name}.tar.gz";
-    sha256 = "0skvkl6c10ls4s48b2wmf47h9j1y40nlzxnzn8hyaw2j0prmpapa";
+    sha256 = "08li21q1wjn5chrv289w666il9ah1w419y3dkq2rl4wnq0rci385";
   };
 
-  extraConfig =
-    ''
-      CONFIG_DEBUG_SYSLOG=y
-      CONFIG_CTRL_IFACE_DBUS=y
-      CONFIG_CTRL_IFACE_DBUS_NEW=y
-      CONFIG_CTRL_IFACE_DBUS_INTRO=y
-      CONFIG_DRIVER_NL80211=y
-      CONFIG_LIBNL32=y
-      ${stdenv.lib.optionalString readlineSupport "CONFIG_READLINE=y"}
-    '';
+  # TODO: Patch epoll so that the dbus actually responds
+  # TODO: Figure out how to get privsep working, currently getting SIGBUS
+  extraConfig = ''
+    CONFIG_LIBNL32=y
+    CONFIG_EAP_FAST=y
+    CONFIG_EAP_PWD=y
+    CONFIG_EAP_PAX=y
+    CONFIG_EAP_SAKE=y
+    CONFIG_EAP_GPSK=y
+    CONFIG_EAP_GPSK_SHA256=y
+    CONFIG_WPS=y
+    CONFIG_WPS_ER=y
+    CONFIG_WPS_NFS=y
+    CONFIG_EAP_IKEV2=y
+    CONFIG_EAP_EKE=y
+    CONFIG_HT_OVERRIDES=y
+    CONFIG_VHT_OVERRIDES=y
+    CONFIG_ELOOP=eloop
+    #CONFIG_ELOOP_EPOLL=y
+    CONFIG_L2_PACKET=linux
+    CONFIG_IEEE80211W=y
+    CONFIG_TLS=openssl
+    CONFIG_TLSV11=y
+    CONFIG_TLSV12=y
+    CONFIG_IEEE80211R=y
+    CONFIG_DEBUG_SYSLOG=y
+    #CONFIG_PRIVSEP=y
+    CONFIG_IEEE80211N=y
+    CONFIG_IEEE80211AC=y
+    CONFIG_INTERNETWORKING=y
+    CONFIG_HS20=y
+    CONFIG_P2P=y
+    CONFIG_TDLS=y
+  '' + optionalString (pcsclite != null) ''
+    CONFIG_EAP_SIM=y
+    CONFIG_EAP_AKA=y
+    CONFIG_EAP_AKA_PRIME=y
+    CONFIG_PCSC=y
+  '' + optionalString (dbus_libs != null) ''
+    CONFIG_CTRL_IFACE_DBUS=y
+    CONFIG_CTRL_IFACE_DBUS_NEW=y
+    CONFIG_CTRL_IFACE_DBUS_INTRO=y
+  '' + (if readline != null then ''
+    CONFIG_READLINE=y
+  '' else ''
+    CONFIG_WPA_CLI_EDIT=y
+  '');
 
   preBuild = ''
     cd wpa_supplicant
     cp -v defconfig .config
     echo "$extraConfig" >> .config
-    cat .config
+    cat -n .config
     substituteInPlace Makefile --replace /usr/local $out
-    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I$(echo "${libnl}"/include/libnl*/)"
+    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE \
+      -I$(echo "${libnl}"/include/libnl*/) \
+      -I${pcsclite}/include/PCSC/"
   '';
 
-  buildInputs = [ openssl dbus_libs libnl ]
-    ++ lib.optional readlineSupport readline;
+  buildInputs = [ openssl libnl dbus_libs readline pcsclite ];
 
   nativeBuildInputs = [ pkgconfig ];
 
-  patches = [];
+  patches = [
+    ./0001-P2P-Validate-SSID-element-length-before-copying-it-C.patch
+    ./build-fix.patch
+  ];
 
   postInstall = ''
+    # Copy the wpa_priv binary which is not installed
+    mkdir -p $out/bin
+    cp -v wpa_priv $out/bin
+
     mkdir -p $out/share/man/man5 $out/share/man/man8
     cp -v "doc/docbook/"*.5 $out/share/man/man5/
     cp -v "doc/docbook/"*.8 $out/share/man/man8/
@@ -52,10 +96,11 @@ stdenv.mkDerivation rec {
     cp -v "systemd/"*.service $out/etc/systemd/system
   '';
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = http://hostap.epitest.fi/wpa_supplicant/;
     description = "A tool for connecting to WPA and WPA2-protected wireless networks";
-    maintainers = with stdenv.lib.maintainers; [marcweber urkud];
-    platforms = stdenv.lib.platforms.linux;
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ marcweber urkud wkennington ];
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/os-specific/linux/xf86-input-wacom/default.nix b/pkgs/os-specific/linux/xf86-input-wacom/default.nix
index 5242aabe507..a3d5aeeb40f 100644
--- a/pkgs/os-specific/linux/xf86-input-wacom/default.nix
+++ b/pkgs/os-specific/linux/xf86-input-wacom/default.nix
@@ -3,11 +3,11 @@
 , ncurses, pkgconfig, randrproto, xorgserver, xproto, udev, libXinerama, pixman }:
 
 stdenv.mkDerivation rec {
-  name = "xf86-input-wacom-0.28.0";
+  name = "xf86-input-wacom-0.29.0";
 
   src = fetchurl {
     url = "mirror://sourceforge/linuxwacom/${name}.tar.bz2";
-    sha256 = "0fr4ssdam8nxkahznqril8q2pbakb4r9ghhg61yl7997yy7006bw";
+    sha256 = "15lbzjkaf690i69qy0n0ibwczbclqq1nx0418c6a567by5v7wl48";
   };
 
   buildInputs = [ inputproto libX11 libXext libXi libXrandr libXrender
diff --git a/pkgs/os-specific/linux/zfs/generic.nix b/pkgs/os-specific/linux/zfs/generic.nix
index ba3884a5e9b..9a97bef22bb 100644
--- a/pkgs/os-specific/linux/zfs/generic.nix
+++ b/pkgs/os-specific/linux/zfs/generic.nix
@@ -77,6 +77,9 @@ stdenv.mkDerivation rec {
     for i in $out/etc/systemd/system/*; do
       substituteInPlace $i --replace "zfs-import-cache.service" "zfs-import.target"
     done
+
+    # Fix pkgconfig
+    ln -s ../share/pkgconfig $out/lib/pkgconfig
   '';
 
   meta = {