about 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-firmware/default.nix35
-rw-r--r--pkgs/os-specific/linux/android-udev-rules/default.nix4
-rw-r--r--pkgs/os-specific/linux/apparmor/2.9/default.nix183
-rw-r--r--pkgs/os-specific/linux/autofs/autofs-v5.nix2
-rw-r--r--pkgs/os-specific/linux/bluez/bluez5.nix4
-rw-r--r--pkgs/os-specific/linux/bluez/bluez5_28.nix79
-rw-r--r--pkgs/os-specific/linux/cgmanager/default.nix36
-rw-r--r--pkgs/os-specific/linux/conky/default.nix113
-rw-r--r--pkgs/os-specific/linux/cryptsetup/default.nix6
-rw-r--r--pkgs/os-specific/linux/eudev/default.nix4
-rw-r--r--pkgs/os-specific/linux/firmware/firmware-linux-nonfree/default.nix11
-rw-r--r--pkgs/os-specific/linux/gradm/default.nix4
-rw-r--r--pkgs/os-specific/linux/hostapd/default.nix7
-rw-r--r--pkgs/os-specific/linux/hwdata/default.nix8
-rw-r--r--pkgs/os-specific/linux/kbd/default.nix1
-rw-r--r--pkgs/os-specific/linux/kernel/common-config.nix54
-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.nix4
-rw-r--r--pkgs/os-specific/linux/kernel/linux-3.18.nix5
-rw-r--r--pkgs/os-specific/linux/kernel/linux-3.19.nix4
-rw-r--r--pkgs/os-specific/linux/kernel/linux-testing.nix6
-rw-r--r--pkgs/os-specific/linux/kernel/patches.nix14
-rw-r--r--pkgs/os-specific/linux/kmod-blacklist-ubuntu/default.nix4
-rw-r--r--pkgs/os-specific/linux/lockdep/default.nix6
-rw-r--r--pkgs/os-specific/linux/lttng-modules/6f0af2643c40b57280796eaa4fe60ce4f678b6dc.patch71
-rw-r--r--pkgs/os-specific/linux/lttng-modules/build-fix.patch30
-rw-r--r--pkgs/os-specific/linux/lttng-modules/default.nix15
-rw-r--r--pkgs/os-specific/linux/lvm2/default.nix4
-rw-r--r--pkgs/os-specific/linux/lxc/default.nix61
-rw-r--r--pkgs/os-specific/linux/lxc/install-localstatedir-in-store.patch15
-rw-r--r--pkgs/os-specific/linux/macchanger/default.nix21
-rw-r--r--pkgs/os-specific/linux/mdadm/default.nix9
-rw-r--r--pkgs/os-specific/linux/microcode/amd.nix33
-rw-r--r--pkgs/os-specific/linux/microcode/converter.nix29
-rw-r--r--pkgs/os-specific/linux/microcode/intel-microcode2ucode.c154
-rw-r--r--pkgs/os-specific/linux/microcode/intel.nix27
-rw-r--r--pkgs/os-specific/linux/mingetty/default.nix5
-rw-r--r--pkgs/os-specific/linux/musl/default.nix14
-rw-r--r--pkgs/os-specific/linux/nvidiabl/default.nix1
-rw-r--r--pkgs/os-specific/linux/ocz-toolbox/default.nix37
-rw-r--r--pkgs/os-specific/linux/pam_console/configure.ac27
-rw-r--r--pkgs/os-specific/linux/pam_console/default.nix31
-rw-r--r--pkgs/os-specific/linux/pam_login/default.nix20
-rw-r--r--pkgs/os-specific/linux/pam_login/sys-stat-h.patch12
-rw-r--r--pkgs/os-specific/linux/pax-utils/default.nix4
-rw-r--r--pkgs/os-specific/linux/plymouth/default.nix41
-rw-r--r--pkgs/os-specific/linux/s6-linux-utils/default.nix4
-rw-r--r--pkgs/os-specific/linux/spl/default.nix6
-rw-r--r--pkgs/os-specific/linux/spl/git.nix6
-rw-r--r--pkgs/os-specific/linux/spl/time.patch18
-rw-r--r--pkgs/os-specific/linux/sysdig/default.nix4
-rw-r--r--pkgs/os-specific/linux/sysklogd/default.nix1
-rw-r--r--pkgs/os-specific/linux/systemd/fixes.patch2
-rw-r--r--pkgs/os-specific/linux/sysvinit/default.nix1
-rw-r--r--pkgs/os-specific/linux/udisks/1-default.nix2
-rw-r--r--pkgs/os-specific/linux/udisks/2-default.nix2
-rw-r--r--pkgs/os-specific/linux/usbutils/default.nix21
-rw-r--r--pkgs/os-specific/linux/util-linux/default.nix10
-rw-r--r--pkgs/os-specific/linux/util-linux/unshare-fix-map-root-user.patch66
-rw-r--r--pkgs/os-specific/linux/zfs/default.nix4
-rw-r--r--pkgs/os-specific/linux/zfs/git.nix6
-rw-r--r--pkgs/os-specific/linux/zfs/mount_zfs_prefix.patch2
64 files changed, 846 insertions, 585 deletions
diff --git a/pkgs/os-specific/linux/alsa-firmware/default.nix b/pkgs/os-specific/linux/alsa-firmware/default.nix
new file mode 100644
index 000000000000..ab81ece5f71c
--- /dev/null
+++ b/pkgs/os-specific/linux/alsa-firmware/default.nix
@@ -0,0 +1,35 @@
+{stdenv, fetchurl}:
+
+stdenv.mkDerivation rec {
+  name = "alsa-firmware-1.0.29";
+
+  src = fetchurl {
+    urls = [
+      "ftp://ftp.alsa-project.org/pub/firmware/${name}.tar.bz2"
+      "http://alsa.cybermirror.org/firmware/${name}.tar.bz2"
+    ];
+    sha256 = "0gfcyj5anckjn030wcxx5v2xk2s219nyf99s9m833275b5wz2piw";
+  };
+
+  configureFlags = ''
+    --with-hotplug-dir=$(out)/lib/firmware
+  '';
+
+  dontStrip = true;
+
+  postInstall = ''
+    # These are lifted from the Arch PKGBUILD
+    # remove files which conflicts with linux-firmware
+    rm -rf $out/lib/firmware/{ct{efx,speq}.bin,ess,korg,sb16,yamaha}
+    # remove broken symlinks (broken upstream)
+    rm -rf $out/lib/firmware/turtlebeach
+    # remove empty dir
+    rm -rf $out/bin
+  '';
+
+  meta = {
+    homepage = http://www.alsa-project.org/main/index.php/Main_Page;
+    description = "Soundcard firmwares from the alsa project";
+    license = stdenv.lib.licenses.gpl2Plus;
+  };
+}
diff --git a/pkgs/os-specific/linux/android-udev-rules/default.nix b/pkgs/os-specific/linux/android-udev-rules/default.nix
index 534ba9970043..b30e0f61b1b5 100644
--- a/pkgs/os-specific/linux/android-udev-rules/default.nix
+++ b/pkgs/os-specific/linux/android-udev-rules/default.nix
@@ -5,8 +5,8 @@ stdenv.mkDerivation {
 
   src = fetchgit {
     url = "git://github.com/M0Rf30/android-udev-rules";
-    rev = "82f78561f388363a925e6663211988d9527de0c6";
-    sha256 = "badd7a152acf92c75335917c07125ffb1b5fda0bed5ec1e474d76e48a8d9f0db";
+    rev = "2cc51a456ccfbca338c4e6b76211645aaac631e9";
+    sha256 = "dbf1614cebb466d1adbcc5f17cefc0c37f148f9e3b46443b3e82f6cd19a1514f";
   };
 
   installPhase = ''
diff --git a/pkgs/os-specific/linux/apparmor/2.9/default.nix b/pkgs/os-specific/linux/apparmor/2.9/default.nix
new file mode 100644
index 000000000000..788297ba3396
--- /dev/null
+++ b/pkgs/os-specific/linux/apparmor/2.9/default.nix
@@ -0,0 +1,183 @@
+{ stdenv, fetchurl, autoconf, automake, libtool, pkgconfig, perl, which
+, glibc, flex, bison, python27, swig, dbus, pam
+}:
+
+let
+  apparmor-series = "2.9";
+  apparmor-patchver = "1";
+  apparmor-version = "${apparmor-series}.${apparmor-patchver}";
+
+  apparmor-meta = component: with stdenv.lib; {
+      homepage = http://apparmor.net/;
+      description = "Linux application security system - ${component}";
+      license = licenses.gpl2;
+      maintainers = with maintainers; [ phreedom thoughtpolice joachifm ];
+      platforms = platforms.linux;
+  };
+
+  apparmor-sources = fetchurl {
+    url = "https://launchpad.net/apparmor/${apparmor-series}/${apparmor-version}/+download/apparmor-${apparmor-version}.tar.gz";
+    sha256 = "a63b8724c36c29ed438c9e3ca403bfeeb6c998a45990e300aa1b10faa23a0a22";
+  };
+
+  prePatchCommon = ''
+    substituteInPlace ./common/Make.rules --replace "/usr/bin/pod2man" "${perl}/bin/pod2man"
+    substituteInPlace ./common/Make.rules --replace "/usr/bin/pod2html" "${perl}/bin/pod2html"
+    substituteInPlace ./common/Make.rules --replace "/usr/include/linux/capability.h" "${glibc}/include/linux/capability.h"
+    substituteInPlace ./common/Make.rules --replace "/usr/share/man" "share/man"
+  '';
+
+  libapparmor = stdenv.mkDerivation {
+    name = "libapparmor-${apparmor-version}";
+    src = apparmor-sources;
+
+    buildInputs = [
+      autoconf
+      automake
+      bison
+      flex
+      dbus # requires patch to dbus ...
+      glibc
+      libtool
+      perl
+      pkgconfig
+      python27
+      swig
+      which
+    ];
+
+    prePatch = prePatchCommon + ''
+      substituteInPlace ./libraries/libapparmor/src/Makefile.am --replace "/usr/include/netinet/in.h" "${glibc}/include/netinet/in.h"
+      substituteInPlace ./libraries/libapparmor/src/Makefile.in --replace "/usr/include/netinet/in.h" "${glibc}/include/netinet/in.h"
+      '';
+
+    buildPhase = ''
+      cd ./libraries/libapparmor
+      ./autogen.sh
+      ./configure --prefix="$out" --with-python
+      make
+      '';
+
+    installPhase = ''
+      make install
+    '';
+
+    meta = apparmor-meta "library";
+  };
+
+  apparmor-utils = stdenv.mkDerivation {
+    name = "apparmor-utils-${apparmor-version}";
+    src = apparmor-sources;
+
+    buildInputs = [
+      python27
+      libapparmor
+      which
+    ];
+
+    prePatch = prePatchCommon;
+
+    buildPhase = ''
+      cd ./utils
+      make LANGS=""
+    '';
+
+    installPhase = ''
+      make install LANGS="" DESTDIR="$out" BINDIR="$out/bin" VIM_INSTALL_PATH="$out/share" PYPREFIX=""
+    '';
+
+    meta = apparmor-meta "user-land utilities";
+  };
+
+  apparmor-parser = stdenv.mkDerivation {
+    name = "apparmor-parser-${apparmor-version}";
+    src = apparmor-sources;
+
+    buildInputs = [
+      libapparmor
+      bison
+      flex
+      which
+    ];
+
+    prePatch = prePatchCommon + ''
+      substituteInPlace ./parser/Makefile --replace "/usr/bin/bison" "${bison}/bin/bison"
+      substituteInPlace ./parser/Makefile --replace "/usr/bin/flex" "${flex}/bin/flex"
+      substituteInPlace ./parser/Makefile --replace "/usr/include/linux/capability.h" "${glibc}/include/linux/capability.h"
+      ## techdoc.pdf still doesn't build ...
+      substituteInPlace ./parser/Makefile --replace "manpages htmlmanpages pdf" "manpages htmlmanpages"
+    '';
+
+    buildPhase = ''
+      cd ./parser
+      make LANGS="" USE_SYSTEM=1 INCLUDEDIR=${libapparmor}/include
+    '';
+
+    installPhase = ''
+      make install LANGS="" USE_SYSTEM=1 INCLUDEDIR=${libapparmor}/include DESTDIR="$out" DISTRO="unknown"
+    '';
+
+    meta = apparmor-meta "rule parser";
+  };
+
+  apparmor-pam = stdenv.mkDerivation {
+    name = "apparmor-pam-${apparmor-version}";
+    src = apparmor-sources;
+
+    buildInputs = [
+      libapparmor
+      pam
+      pkgconfig
+      which
+    ];
+
+    buildPhase = ''
+      cd ./changehat/pam_apparmor
+      make USE_SYSTEM=1
+    '';
+
+    installPhase = ''
+      make install DESTDIR="$out"
+    '';
+
+    meta = apparmor-meta "PAM service";
+  };
+
+  apparmor-profiles = stdenv.mkDerivation {
+    name = "apparmor-profiles-${apparmor-version}";
+    src = apparmor-sources;
+
+    buildInputs = [ which ];
+
+    buildPhase = ''
+      cd ./profiles
+      make
+    '';
+
+    installPhase = ''
+      make install DESTDIR="$out" EXTRAS_DEST="$out/share/apparmor/extra-profiles"
+    '';
+
+    meta = apparmor-meta "profiles";
+  };
+
+  apparmor-kernel-patches = stdenv.mkDerivation {
+    name = "apparmor-kernel-patches-${apparmor-version}";
+    src = apparmor-sources;
+
+    phases = ''unpackPhase installPhase'';
+
+    installPhase = ''
+      mkdir "$out"
+      cp -R ./kernel-patches "$out"
+    '';
+
+    meta = apparmor-meta "kernel patches";
+  };
+
+in
+
+{
+  inherit libapparmor apparmor-utils apparmor-parser apparmor-pam
+  apparmor-profiles apparmor-kernel-patches;
+}
diff --git a/pkgs/os-specific/linux/autofs/autofs-v5.nix b/pkgs/os-specific/linux/autofs/autofs-v5.nix
index 5c5c2f026afd..787cd34180e7 100644
--- a/pkgs/os-specific/linux/autofs/autofs-v5.nix
+++ b/pkgs/os-specific/linux/autofs/autofs-v5.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation {
     configureFlags="--disable-move-mount --with-path=$PATH"
     export MOUNT=/var/run/current-system/sw/bin/mount
     export UMOUNT=/var/run/current-system/sw/bin/umount
-    export MODPROBE=/var/run/current-system/sw/sbin/modprobe
+    export MODPROBE=/var/run/current-system/sw/bin/modprobe
     # Grrr, rpcgen can't find cpp. (NIXPKGS-48)
     mkdir rpcgen
     echo "#! $shell" > rpcgen/rpcgen
diff --git a/pkgs/os-specific/linux/bluez/bluez5.nix b/pkgs/os-specific/linux/bluez/bluez5.nix
index e8be1b6b0e66..61d3667f1658 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.25";
+  name = "bluez-5.29";
    
   src = fetchurl {
     url = "mirror://kernel/linux/bluetooth/${name}.tar.xz";
-    sha256 = "0c7xs4imwfgyx59qxbinfi403vhki1n8src1g87qlqz28lzjz9jw";
+    sha256 = "1r7h8qr52n372r73fdyk804r92hqg9g6pvflwmak64y6brnnl8fz";
   };
 
   pythonPath = with pythonPackages;
diff --git a/pkgs/os-specific/linux/bluez/bluez5_28.nix b/pkgs/os-specific/linux/bluez/bluez5_28.nix
new file mode 100644
index 000000000000..7f5a30144c8b
--- /dev/null
+++ b/pkgs/os-specific/linux/bluez/bluez5_28.nix
@@ -0,0 +1,79 @@
+{ stdenv, fetchurl, pkgconfig, dbus, glib, alsaLib, python,
+  pythonPackages, pythonDBus, readline, libsndfile, udev, libical,
+  systemd, enableWiimote ? false }:
+
+assert stdenv.isLinux;
+
+stdenv.mkDerivation rec {
+  name = "bluez-5.28";
+   
+  src = fetchurl {
+    url = "mirror://kernel/linux/bluetooth/${name}.tar.xz";
+    sha256 = "1a8qzh38wpq5c0rydpx9isf0jc6g14g2qs18j1rmi8a79f7v9fl5";
+  };
+
+  pythonPath = with pythonPackages;
+    [ pythonDBus pygobject pygobject3 recursivePthLoader ];
+
+  buildInputs =
+    [ pkgconfig dbus.libs glib alsaLib python pythonPackages.wrapPython
+      readline libsndfile udev libical
+      # Disables GStreamer; not clear what it gains us other than a
+      # zillion extra dependencies.
+      # gstreamer gst_plugins_base 
+    ];
+
+  preConfigure = ''
+      substituteInPlace tools/hid2hci.rules --replace /sbin/udevadm ${systemd}/bin/udevadm
+      substituteInPlace tools/hid2hci.rules --replace "hid2hci " "$out/lib/udev/hid2hci "
+    '';
+
+  configureFlags = [
+    "--localstatedir=/var"
+    "--enable-library"
+    "--enable-cups"
+    "--with-dbusconfdir=$(out)/etc"
+    "--with-dbussystembusdir=$(out)/share/dbus-1/system-services"
+    "--with-dbussessionbusdir=$(out)/share/dbus-1/services"
+    "--with-systemdsystemunitdir=$(out)/etc/systemd/system"
+    "--with-systemduserunitdir=$(out)/etc/systemd/user"
+    "--with-udevdir=$(out)/lib/udev"
+    ] ++
+    stdenv.lib.optional enableWiimote [ "--enable-wiimote" ];
+
+  # Work around `make install' trying to create /var/lib/bluetooth.
+  installFlags = "statedir=$(TMPDIR)/var/lib/bluetooth";
+
+  makeFlags = "rulesdir=$(out)/lib/udev/rules.d";
+
+  # FIXME: Move these into a separate package to prevent Bluez from
+  # depending on Python etc.
+  postInstall = ''
+    mkdir $out/test
+    cp -a test $out
+    pushd $out/test
+    for a in \
+            simple-agent \
+            test-adapter \
+            test-device \
+            test-thermometer \
+            list-devices \
+            monitor-bluetooth \
+            ; do
+      ln -s ../test/$a $out/bin/bluez-$a
+    done
+    popd
+    wrapPythonProgramsIn $out/test "$out/test $pythonPath"
+
+    # for bluez4 compatibility for NixOS
+    mkdir $out/sbin
+    ln -s ../libexec/bluetooth/bluetoothd $out/sbin/bluetoothd
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = http://www.bluez.org/;
+    repositories.git = https://git.kernel.org/pub/scm/bluetooth/bluez.git;
+    description = "Bluetooth support for Linux";
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/os-specific/linux/cgmanager/default.nix b/pkgs/os-specific/linux/cgmanager/default.nix
new file mode 100644
index 000000000000..79be500a13d7
--- /dev/null
+++ b/pkgs/os-specific/linux/cgmanager/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, fetchurl, pkgconfig, libnih, dbus }:
+
+stdenv.mkDerivation rec {
+  name = "cgmanager-0.36";
+
+  src = fetchurl {
+    url = "https://linuxcontainers.org/downloads/cgmanager/${name}.tar.gz";
+    sha256 = "039azd4ghpmiccd95ki8fna321kccapff00rib6hrdgg600pyw7l";
+  };
+
+  buildInputs = [ pkgconfig libnih dbus ];
+
+  configureFlags = [
+    "--with-init-script=systemd"
+    "--sysconfdir=/etc/"
+    "--localstatedir=/var"
+  ];
+
+  installFlags = [ "DESTDIR=\${out}" ];
+
+  postInstall = ''
+    mv $out/$out/* $out
+    DIR=$out/$out
+    while rmdir $DIR 2>/dev/null; do
+      DIR="$(dirname "$DIR")"
+    done
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://linuxcontainers.org/cgmanager/introduction/;
+    description = "a central privileged daemon that manages all your cgroups";
+    license = licenses.lgpl21;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ wkennington ];
+  };
+}
diff --git a/pkgs/os-specific/linux/conky/default.nix b/pkgs/os-specific/linux/conky/default.nix
index 52e5d95346ed..c54d4aa6319b 100644
--- a/pkgs/os-specific/linux/conky/default.nix
+++ b/pkgs/os-specific/linux/conky/default.nix
@@ -1,31 +1,59 @@
 { stdenv, fetchurl, pkgconfig
 
 # dependencies
-, glib, ncurses
+, glib
 
 # optional features without extra dependencies
-, mpdSupport   ? true
+, mpdSupport          ? true
+, ibmSupport          ? true # IBM/Lenovo notebooks
+
+# This should be optional, but it is not due to a bug in conky
+# Please, try to make it optional again on update
+, ncurses
+#, ncursesSupport      ? true      , ncurses       ? null
 
 # optional features with extra dependencies
-, x11Support   ? false, x11           ? null
-, xdamage      ? false, libXdamage    ? null
-, wireless     ? false, wirelesstools ? null
-, luaSupport   ? false, lua5          ? null
-
-, rss          ? false
-, weatherMetar ? false
-, weatherXoap  ? false
-, curl ? null, libxml2 ? null
+, x11Support          ? true      , x11           ? null
+, xdamageSupport      ? x11Support, libXdamage    ? null
+, imlib2Support       ? x11Support, imlib2        ? null
+, luaSupport          ? true      , lua           ? null
+
+, luaImlib2Support    ? luaSupport && imlib2Support
+, luaCairoSupport     ? luaSupport && x11Support, cairo ? null
+, toluapp ? null
+
+, alsaSupport         ? true      , alsaLib       ? null
+
+, wirelessSupport     ? true      , wirelesstools ? null
+
+, curlSupport         ? true      , curl ? null
+, rssSupport          ? curlSupport
+, weatherMetarSupport ? curlSupport
+, weatherXoapSupport  ? curlSupport
+, libxml2 ? null
 }:
 
-assert luaSupport -> lua5          != null;
-assert wireless   -> wirelesstools != null;
-assert x11Support -> x11           != null;
-assert xdamage    -> x11Support && libXdamage != null;
+#assert ncursesSupport      -> ncurses != null;
+
+assert x11Support          -> x11 != null;
+assert xdamageSupport      -> x11Support && libXdamage != null;
+assert imlib2Support       -> x11Support && imlib2     != null;
+assert luaSupport          -> lua != null;
+assert luaImlib2Support    -> luaSupport && imlib2Support
+                                         && toluapp != null;
+assert luaCairoSupport     -> luaSupport && toluapp != null
+                                         && cairo   != null;
+assert luaCairoSupport || luaImlib2Support
+                           -> lua.luaversion == "5.1";
 
-assert rss          -> curl != null && libxml2 != null;
-assert weatherMetar -> curl != null;
-assert weatherXoap  -> curl != null && libxml2 != null;
+assert alsaSupport         -> alsaLib != null;
+
+assert wirelessSupport     -> wirelesstools != null;
+
+assert curlSupport         -> curl != null;
+assert rssSupport          -> curlSupport && libxml2 != null;
+assert weatherMetarSupport -> curlSupport;
+assert weatherXoapSupport  -> curlSupport && libxml2 != null;
 
 with stdenv.lib;
 
@@ -39,30 +67,47 @@ stdenv.mkDerivation rec {
 
   NIX_LDFLAGS = "-lgcc_s";
 
-  buildInputs = [ pkgconfig glib ncurses ]
-    ++ optional  luaSupport   lua5
-    ++ optional  wireless     wirelesstools
-    ++ optional  x11Support   x11
-    ++ optional  xdamage      libXdamage
+  buildInputs = [ pkgconfig glib ]
+    ++ [ ncurses ]
+    #++ optional  ncursesSupport     ncurses
+    ++ optional  x11Support         x11
+    ++ optional  xdamageSupport     libXdamage
+    ++ optional  imlib2Support      imlib2
+    ++ optional  luaSupport         lua
+    ++ optionals luaImlib2Support   [ toluapp imlib2 ]
+    ++ optionals luaCairoSupport    [ toluapp cairo ]
+
+    ++ optional  alsaSupport        alsaLib
 
-    ++ optionals rss          [ curl libxml2 ]
-    ++ optional  weatherMetar curl
-    ++ optionals weatherXoap  [ curl libxml2 ]
+    ++ optional  wirelessSupport    wirelesstools
+
+    ++ optional  curlSupport        curl
+    ++ optional  rssSupport         libxml2
+    ++ optional  weatherXoapSupport libxml2
     ;
 
   configureFlags =
     let flag = state: flags: if state then map (x: "--enable-${x}")  flags
                                       else map (x: "--disable-${x}") flags;
-     in flag mpdSupport   [ "mpd" ]
+     in flag mpdSupport          [ "mpd" ]
+     ++ flag ibmSupport          [ "ibm" ]
+
+     #++ flag ncursesSupport      [ "ncurses" ]
+     ++ flag x11Support          [ "x11" "xft" "argb" "double-buffer" "own-window" ] # conky won't compile without --enable-own-window
+     ++ flag xdamageSupport      [ "xdamage" ]
+     ++ flag imlib2Support       [ "imlib2" ]
+     ++ flag luaSupport          [ "lua" ]
+     ++ flag luaImlib2Support    [ "lua-imlib2" ]
+     ++ flag luaCairoSupport     [ "lua-cairo" ]
+
+     ++ flag alsaSupport         [ "alsa" ]
 
-     ++ flag luaSupport   [ "lua" ]
-     ++ flag wireless     [ "wlan" ]
-     ++ flag x11Support   [ "x11" "xft" "argb" "double-buffer" "own-window" ] # conky won't compile without --enable-own-window
-     ++ flag xdamage      [ "xdamage" ]
+     ++ flag wirelessSupport     [ "wlan" ]
 
-     ++ flag rss          [ "rss" ]
-     ++ flag weatherMetar [ "weather-metar" ]
-     ++ flag weatherXoap  [ "weather-xoap" ]
+     ++ flag curlSupport         [ "curl" ]
+     ++ flag rssSupport          [ "rss" ]
+     ++ flag weatherMetarSupport [ "weather-metar" ]
+     ++ flag weatherXoapSupport  [ "weather-xoap" ]
      ;
 
   meta = {
diff --git a/pkgs/os-specific/linux/cryptsetup/default.nix b/pkgs/os-specific/linux/cryptsetup/default.nix
index d3a0b827ed10..50ea3f6a0675 100644
--- a/pkgs/os-specific/linux/cryptsetup/default.nix
+++ b/pkgs/os-specific/linux/cryptsetup/default.nix
@@ -5,11 +5,11 @@
 assert enablePython -> python != null;
 
 stdenv.mkDerivation rec {
-  name = "cryptsetup-1.6.3";
+  name = "cryptsetup-1.6.7";
 
   src = fetchurl {
-    url = "http://cryptsetup.googlecode.com/files/${name}.tar.bz2";
-    sha256 = "1n1qk5chyjspbiianrdb55fhb4wl0vfyqz2br05vfb24v4qlgbx2";
+    url = "mirror://kernel/linux/utils/cryptsetup/v1.6/${name}.tar.xz";
+    sha256 = "0878vwblazms1dac2ds7vyz8pgi1aac8870ccnl2s0v2sv428g62";
   };
 
   configureFlags = [ "--enable-cryptsetup-reencrypt" ]
diff --git a/pkgs/os-specific/linux/eudev/default.nix b/pkgs/os-specific/linux/eudev/default.nix
index 16eb933e176c..e2bcf9837e7a 100644
--- a/pkgs/os-specific/linux/eudev/default.nix
+++ b/pkgs/os-specific/linux/eudev/default.nix
@@ -3,10 +3,10 @@ let
   s = # Generated upstream information
   rec {
     baseName="eudev";
-    version="2.1.1";
+    version = "3.0";
     name="${baseName}-${version}";
     url="http://dev.gentoo.org/~blueness/eudev/eudev-${version}.tar.gz";
-    sha256="0shf5vqiz9fdxl95aa1a8vh0xjxwim3psc39wr2xr8lnahf11vva";
+    sha256 = "0afva1vh3lwhw9bryh41dxg82kfnxj1ifa91p3gjwffc2fpqmnvl";
   };
   buildInputs = [
     glib pkgconfig gperf utillinux
diff --git a/pkgs/os-specific/linux/firmware/firmware-linux-nonfree/default.nix b/pkgs/os-specific/linux/firmware/firmware-linux-nonfree/default.nix
index be3d6a997b3a..6ac468774ad1 100644
--- a/pkgs/os-specific/linux/firmware/firmware-linux-nonfree/default.nix
+++ b/pkgs/os-specific/linux/firmware/firmware-linux-nonfree/default.nix
@@ -1,12 +1,13 @@
 { stdenv, fetchgit }:
 
-stdenv.mkDerivation {
-  name = "firmware-linux-nonfree-2015-03-09";
+stdenv.mkDerivation rec {
+  name = "firmware-linux-nonfree-${version}";
+  version = "2015-03-20";
 
   src = fetchgit {
     url = "git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git";
-    rev = "020e534ec90106d42a890cd9d090b24e3d158c53";
-    sha256 = "101mpps0jcv2dd4jh1w3j4h78d4iv8n8r1cnf4br2vg66zl3zg9v";
+    rev = "f404336ba808cbd57547196e13367079a23b822c";
+    sha256 = "0avz5vxax2b3s4gafib47vih1lbq78agdmpjcjnnnykw2kschkwa";
   };
 
   preInstall = ''
@@ -22,4 +23,6 @@ stdenv.mkDerivation {
     platforms = platforms.linux;
     maintainers = with maintainers; [ wkennington ];
   };
+
+  passthru = { inherit version; };
 }
diff --git a/pkgs/os-specific/linux/gradm/default.nix b/pkgs/os-specific/linux/gradm/default.nix
index 718a9672c90d..d34a028220c9 100644
--- a/pkgs/os-specific/linux/gradm/default.nix
+++ b/pkgs/os-specific/linux/gradm/default.nix
@@ -3,11 +3,11 @@
 
 stdenv.mkDerivation rec {
   name    = "gradm-${version}";
-  version = "3.1-201502222102";
+  version = "3.1-201503211320";
 
   src  = fetchurl {
     url    = "http://grsecurity.net/stable/${name}.tar.gz";
-    sha256 = "1dvzjjyq8phhjcm425j9hw0m0azg34lm02p0yn058jiipx731xrp";
+    sha256 = "17yd307jqva8jqib2xr3i9kmp58f2cb4jd7an5rbk5zr1k48ap9j";
   };
 
   buildInputs = [ gcc coreutils findutils binutils pam flex bison bash ];
diff --git a/pkgs/os-specific/linux/hostapd/default.nix b/pkgs/os-specific/linux/hostapd/default.nix
index f8081127d515..84535e8d25ee 100644
--- a/pkgs/os-specific/linux/hostapd/default.nix
+++ b/pkgs/os-specific/linux/hostapd/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, libnl, openssl, pkgconfig }:
-stdenv.mkDerivation rec {
 
+stdenv.mkDerivation rec {
   name = "hostapd-${version}";
-  version = "2.3";
+  version = "2.4";
 
   src = fetchurl {
     url = "http://hostap.epitest.fi/releases/${name}.tar.gz";
-    sha256 = "1pxlkfj1r2k5lxph2x9l02jrn652b3whcfh6l604rbbghxv2nk69";
+    sha256 = "0zv5pnfrp6z7jjbskzgdb2rlmlbvdxmmis7ca94x5jy9s5mypq3g";
   };
 
   buildInputs = [ libnl openssl pkgconfig ];
@@ -19,6 +19,7 @@ stdenv.mkDerivation rec {
     echo CONFIG_IEEE80211N=y | tee -a .config
     export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE $(pkg-config --cflags libnl-3.0)"
   '';
+
   preInstall = "mkdir -p $out/bin";
 
   meta = with stdenv.lib; {
diff --git a/pkgs/os-specific/linux/hwdata/default.nix b/pkgs/os-specific/linux/hwdata/default.nix
index 325a44f97aa4..1987e914ad9a 100644
--- a/pkgs/os-specific/linux/hwdata/default.nix
+++ b/pkgs/os-specific/linux/hwdata/default.nix
@@ -1,11 +1,11 @@
-{stdenv, fetchurl}:
+{ stdenv, fetchurl }:
 
 stdenv.mkDerivation {
-  name = "hwdata-0.249";
+  name = "hwdata-0.276";
 
   src = fetchurl {
-    url = "https://git.fedorahosted.org/cgit/hwdata.git/snapshot/hwdata-0.249-1.tar.bz2";
-    sha256 = "1ak3h3psg3wk9yk0dqnzdzik3jadzja3ah22vjfmf71p3b5xc8ai";
+    url = "https://git.fedorahosted.org/cgit/hwdata.git/snapshot/hwdata-0.276.tar.xz";
+    sha256 = "0pg0ms6kb2mm25mdklsb0xn2spcwi2mhygzc7bkpji72qq8srzsh";
   };
 
   preConfigure = "patchShebangs ./configure";
diff --git a/pkgs/os-specific/linux/kbd/default.nix b/pkgs/os-specific/linux/kbd/default.nix
index 673ad5d31650..d2413be6f5ab 100644
--- a/pkgs/os-specific/linux/kbd/default.nix
+++ b/pkgs/os-specific/linux/kbd/default.nix
@@ -54,5 +54,6 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = ftp://ftp.altlinux.org/pub/people/legion/kbd/;
     description = "Linux keyboard utilities and keyboard maps";
+    platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/os-specific/linux/kernel/common-config.nix b/pkgs/os-specific/linux/kernel/common-config.nix
index c1939f3218e9..a2af42761b95 100644
--- a/pkgs/os-specific/linux/kernel/common-config.nix
+++ b/pkgs/os-specific/linux/kernel/common-config.nix
@@ -1,3 +1,21 @@
+/*
+
+  WARNING/NOTE: whenever you want to add an option here you need to
+  either
+
+  * mark it as an optional one with `?` suffix,
+  * or make sure it works for all the versions in nixpkgs,
+  * or check for which kernel versions it will work (using kernel
+    changelog, google or whatever) and mark it with `versionOlder` or
+    `versionAtLeast`.
+
+  Then do test your change by building all the kernels (or at least
+  their configs) in nixpkgs or else you will guarantee lots and lots
+  of pain to users trying to switch to an older kernel because of some
+  hardware problems with a new one.
+
+*/
+
 { stdenv, version, kernelPlatform, extraConfig, features }:
 
 with stdenv.lib;
@@ -171,7 +189,6 @@ with stdenv.lib;
   XFS_RT? y # XFS Realtime subvolume support
   OCFS2_DEBUG_MASKLOG? n
   BTRFS_FS_POSIX_ACL y
-  UBIFS_FS_XATTR? y
   UBIFS_FS_ADVANCED_COMPR? y
   ${optionalString (versionAtLeast version "3.6") ''
     NFS_SWAP y
@@ -194,12 +211,17 @@ with stdenv.lib;
   ${optionalString (versionAtLeast version "3.14") ''
     CEPH_FS_POSIX_ACL y
   ''}
-  SQUASHFS_FILE_DIRECT y
-  SQUASHFS_DECOMP_MULTI_PERCPU y
+  ${optionalString (versionAtLeast version "3.13") ''
+    SQUASHFS_FILE_DIRECT y
+    SQUASHFS_DECOMP_MULTI_PERCPU y
+  ''}
   SQUASHFS_XATTR y
   SQUASHFS_ZLIB y
   SQUASHFS_LZO y
   SQUASHFS_XZ y
+  ${optionalString (versionAtLeast version "3.19") ''
+    SQUASHFS_LZ4 y
+  ''}
 
   # Security related features.
   STRICT_DEVMEM y # Filter access to /dev/mem
@@ -218,6 +240,16 @@ with stdenv.lib;
   SECURITY_APPARMOR y
   DEFAULT_SECURITY_APPARMOR y
 
+  # Microcode loading support
+  MICROCODE y
+  MICROCODE_INTEL y
+  MICROCODE_AMD y
+  ${optionalString (versionAtLeast version "3.11") ''
+    MICROCODE_EARLY y
+    MICROCODE_INTEL_EARLY y
+    MICROCODE_AMD_EARLY y
+  ''}
+
   # Misc. options.
   8139TOO_8129 y
   8139TOO_PIO n # PIO is slower
@@ -235,7 +267,9 @@ with stdenv.lib;
   BT_HCIUART_BCSP? y
   BT_HCIUART_H4? y # UART (H4) protocol support
   BT_HCIUART_LL? y
-  BT_RFCOMM_TTY? y # RFCOMM TTY support
+  ${optionalString (versionAtLeast version "3.4") ''
+    BT_RFCOMM_TTY? y # RFCOMM TTY support
+  ''}
   CRASH_DUMP? n
   ${optionalString (versionOlder version "3.1") ''
     DMAR? n # experimental
@@ -258,7 +292,6 @@ with stdenv.lib;
   LOGO n # not needed
   MEDIA_ATTACH y
   MEGARAID_NEWGEN y
-  MICROCODE_AMD y
   MODVERSIONS y
   MOUSE_PS2_ELANTECH y # Elantech PS/2 protocol extension
   MTRR_SANITIZER y
@@ -269,12 +302,17 @@ with stdenv.lib;
   ${optionalString (versionAtLeast version "3.6") ''
     RC_DEVICES? y # Enable IR devices
   ''}
+  ${optionalString (versionAtLeast version "3.10") ''
+    RT2800USB_RT55XX y
+  ''}
   SCSI_LOGGING y # SCSI logging facility
   SERIAL_8250 y # 8250/16550 and compatible serial support
   SLIP_COMPRESSED y # CSLIP compressed headers
   SLIP_SMART y
   THERMAL_HWMON y # Hardware monitoring support
-  USB_DEBUG? n
+  ${optionalString (versionOlder version "3.15") ''
+    USB_DEBUG? n
+  ''}
   USB_EHCI_ROOT_HUB_TT y # Root Hub Transaction Translators
   USB_EHCI_TT_NEWSCHED y # Improved transaction translator scheduling
   X86_CHECK_BIOS_CORRUPTION y
@@ -310,7 +348,9 @@ with stdenv.lib;
   FTRACE_SYSCALLS y
   SCHED_TRACER y
   STACK_TRACER y
-  UPROBE_EVENT y
+  ${optionalString (versionAtLeast version "3.10") ''
+    UPROBE_EVENT y
+  ''}
   FUNCTION_PROFILER y
   RING_BUFFER_BENCHMARK n
 
diff --git a/pkgs/os-specific/linux/kernel/grsec-path.patch b/pkgs/os-specific/linux/kernel/grsec-path.patch
index 6f59cf8d80bd..aaf7d80dc919 100644
--- a/pkgs/os-specific/linux/kernel/grsec-path.patch
+++ b/pkgs/os-specific/linux/kernel/grsec-path.patch
@@ -1,17 +1,18 @@
 diff --git a/kernel/kmod.c b/kernel/kmod.c
-index 67f7981..03f127d 100644
+index a26e825..29baec1 100644
 --- a/kernel/kmod.c
 +++ b/kernel/kmod.c
-@@ -246,9 +246,9 @@ static int ____call_usermodehelper(void *data)
+@@ -294,10 +294,9 @@ 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) &&
 -	     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, "..")) {
++        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);
  		retval = -EPERM;
- 		goto fail;
+ 		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 29067459ac25..853b784a3357 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.71";
+  version = "3.10.73";
   extraMeta.branch = "3.10";
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.xz";
-    sha256 = "1h6s6bp7l71k7wnm59zgm1vk5hgja7cjs85smb3dix9vwffzjbhv";
+    sha256 = "0xy8738sdbw7lbqwkmbhr2zghva5nyfqq163r6jmjr6cfw116kin";
   };
 
   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 e8c383b857ed..951b55c2f35a 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.38";
+  version = "3.12.39";
   extraMeta.branch = "3.12";
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.xz";
-    sha256 = "0vwvvjzl6qx4nd4577lawmmb8lj3z0zfghm345dh20plhblcl3ck";
+    sha256 = "0svd2rnkrzpmnrv5qd5vfz4wkff6973s68zg5a1blmjs4p5asvl6";
   };
 
   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 62886ad5628f..ea5a9f927d4f 100644
--- a/pkgs/os-specific/linux/kernel/linux-3.14.nix
+++ b/pkgs/os-specific/linux/kernel/linux-3.14.nix
@@ -1,13 +1,13 @@
 { stdenv, fetchurl, ... } @ args:
 
 import ./generic.nix (args // rec {
-  version = "3.14.35";
+  version = "3.14.37";
   # Remember to update grsecurity!
   extraMeta.branch = "3.14";
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.xz";
-    sha256 = "1d15m28iyv8g5g7gpipzswi9g2qyndrjxvgsx6adp2268cxd5my8";
+    sha256 = "1pq4i97vys38rl8ylx4s08qgh9yz3cl840j1f70yzakmc2017byc";
   };
 
   features.iwlwifi = true;
diff --git a/pkgs/os-specific/linux/kernel/linux-3.18.nix b/pkgs/os-specific/linux/kernel/linux-3.18.nix
index 93ddecbf4a54..06145488d50f 100644
--- a/pkgs/os-specific/linux/kernel/linux-3.18.nix
+++ b/pkgs/os-specific/linux/kernel/linux-3.18.nix
@@ -1,13 +1,12 @@
 { stdenv, fetchurl, ... } @ args:
 
 import ./generic.nix (args // rec {
-  version = "3.18.9";
-  # Remember to update grsecurity!
+  version = "3.18.10";
   extraMeta.branch = "3.18";
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.xz";
-    sha256 = "00cm64s17d03rlzkgqs0fq91vm95csfa2xw4zhp7y0md9fd73dxi";
+    sha256 = "0kmh0ybjh1l35pm421v2q3z9fyhss85agh1rkmnh9bim2bq1ac6h";
   };
 
   features.iwlwifi = true;
diff --git a/pkgs/os-specific/linux/kernel/linux-3.19.nix b/pkgs/os-specific/linux/kernel/linux-3.19.nix
index c81643a28ff9..10c6215f871f 100644
--- a/pkgs/os-specific/linux/kernel/linux-3.19.nix
+++ b/pkgs/os-specific/linux/kernel/linux-3.19.nix
@@ -1,13 +1,13 @@
 { stdenv, fetchurl, ... } @ args:
 
 import ./generic.nix (args // rec {
-  version = "3.19.1";
+  version = "3.19.3";
   # Remember to update grsecurity!
   extraMeta.branch = "3.19";
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.xz";
-    sha256 = "0qx7vxmlcwr4nvzf4wq0da7xwzqw4b67h9a5rfpxgg9mayk3czvi";
+    sha256 = "0nis1r9fg562ysirzlyvfxvirpcfhxhhpfv3s13ccz20qiqiy46f";
   };
 
   features.iwlwifi = true;
diff --git a/pkgs/os-specific/linux/kernel/linux-testing.nix b/pkgs/os-specific/linux/kernel/linux-testing.nix
index 73280d1dd300..de13f8394d82 100644
--- a/pkgs/os-specific/linux/kernel/linux-testing.nix
+++ b/pkgs/os-specific/linux/kernel/linux-testing.nix
@@ -1,13 +1,13 @@
 { stdenv, fetchurl, ... } @ args:
 
 import ./generic.nix (args // rec {
-  version = "4.0-rc2";
-  modDirVersion = "4.0.0-rc2";
+  version = "4.0-rc6";
+  modDirVersion = "4.0.0-rc6";
   extraMeta.branch = "4.0";
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v4.x/testing/linux-${version}.tar.xz";
-    sha256 = "1njjl31g27ddjdp5z14fhx4mpm69jqkxy43k7liisvxdc9j75jj9";
+    sha256 = "1f6xqrc9lqssr2gyzd6d82dk2niikbr1swg68vfc250am0l55vw8";
   };
 
   features.iwlwifi = true;
diff --git a/pkgs/os-specific/linux/kernel/patches.nix b/pkgs/os-specific/linux/kernel/patches.nix
index c2d35ce4d2ed..6a4b707e7779 100644
--- a/pkgs/os-specific/linux/kernel/patches.nix
+++ b/pkgs/os-specific/linux/kernel/patches.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchgit, apparmor }:
+{ stdenv, fetchurl }:
 
 let
 
@@ -65,17 +65,17 @@ rec {
   };
 
   grsecurity_stable = grsecPatch
-    { kversion  = "3.14.35";
-      revision  = "201503071140";
+    { kversion  = "3.14.37";
+      revision  = "201503270048";
       branch    = "stable";
-      sha256    = "076kmzyrmg8g82xhaccysdgblfkdd21rfn8wvdpf6kxavg8xn855";
+      sha256    = "1ryxh89m392mwqlwqiy3jszyhq9cxmvkv320di7hi50aqx8k2lqf";
     };
 
   grsecurity_unstable = grsecPatch
-    { kversion  = "3.18.9";
-      revision  = "201503071142";
+    { kversion  = "3.19.3";
+      revision  = "201503270049";
       branch    = "test";
-      sha256    = "0acrz6v827y8pdrl26wb652hmq0qglkwdgq0ffrw6k052f5lpfx2";
+      sha256    = "0m76p947gr0bqk6xxb237bpf4ikxjzycjzq4i2szm4n86k9sfac0";
     };
 
   grsec_fix_path =
diff --git a/pkgs/os-specific/linux/kmod-blacklist-ubuntu/default.nix b/pkgs/os-specific/linux/kmod-blacklist-ubuntu/default.nix
index 682c36401de8..686f63720fc1 100644
--- a/pkgs/os-specific/linux/kmod-blacklist-ubuntu/default.nix
+++ b/pkgs/os-specific/linux/kmod-blacklist-ubuntu/default.nix
@@ -19,8 +19,8 @@ stdenv.mkDerivation {
 
     substituteInPlace "$out"/modprobe.conf \
       --replace /sbin/lsmod /run/booted-system/sw/bin/lsmod \
-      --replace /sbin/rmmod /run/booted-system/sw/sbin/rmmod \
-      --replace /sbin/modprobe /run/booted-system/sw/sbin/modprobe \
+      --replace /sbin/rmmod /run/booted-system/sw/bin/rmmod \
+      --replace /sbin/modprobe /run/booted-system/sw/bin/modprobe \
       --replace " grep " " ${gnugrep}/bin/grep " \
       --replace " xargs " " ${findutils}/bin/xargs "
   '';
diff --git a/pkgs/os-specific/linux/lockdep/default.nix b/pkgs/os-specific/linux/lockdep/default.nix
index 6fa59e4ae5fb..612291e62e42 100644
--- a/pkgs/os-specific/linux/lockdep/default.nix
+++ b/pkgs/os-specific/linux/lockdep/default.nix
@@ -2,12 +2,12 @@
 
 stdenv.mkDerivation rec {
   name    = "lockdep-${version}";
-  version = "3.17";
-  fullver = "3.17.0"; # The library ver is 3.17.0, but the kernel is 3.17
+  version = "3.19.1";
+  fullver = "3.19.1";
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.xz";
-    sha256 = "0lb2yyh3j932789jq4gxx9xshgy6rfdnl3lm8yr43kaz7k4kw5gm";
+    sha256 = "0qx7vxmlcwr4nvzf4wq0da7xwzqw4b67h9a5rfpxgg9mayk3czvi";
   };
 
   preConfigure = "cd tools/lib/lockdep";
diff --git a/pkgs/os-specific/linux/lttng-modules/6f0af2643c40b57280796eaa4fe60ce4f678b6dc.patch b/pkgs/os-specific/linux/lttng-modules/6f0af2643c40b57280796eaa4fe60ce4f678b6dc.patch
deleted file mode 100644
index 2c9cb9835d1c..000000000000
--- a/pkgs/os-specific/linux/lttng-modules/6f0af2643c40b57280796eaa4fe60ce4f678b6dc.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-From 6f0af2643c40b57280796eaa4fe60ce4f678b6dc Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Andr=C3=A9=20Goddard=20Rosa?= <andre.goddard@gmail.com>
-Date: Thu, 13 Nov 2014 21:33:02 -0800
-Subject: [PATCH] Fix compilation on Linux kernel >= 3.18.0
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Since kernel commit 8a9522d2fe compilation fails as kvm_age_page
-tracepoint had its signature changed, so update it accordingly.
-
-Tested pointing to kernels:
-    git reset --hard v3.17; make init/version.o
-    git reset --hard v3.18-rc1; make init/version.o
-
-Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
-Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
----
- instrumentation/events/lttng-module/kvm.h | 29 +++++++++++++++++++++++++++++
- 1 file changed, 29 insertions(+)
- mode change 100644 => 100755 instrumentation/events/lttng-module/kvm.h
-
-diff --git a/instrumentation/events/lttng-module/kvm.h b/instrumentation/events/lttng-module/kvm.h
-old mode 100644
-new mode 100755
-index c0d42e2..4f95095
---- a/instrumentation/events/lttng-module/kvm.h
-+++ b/instrumentation/events/lttng-module/kvm.h
-@@ -232,6 +232,34 @@ LTTNG_TRACEPOINT_EVENT(kvm_fpu,
- 	TP_printk("%s", __print_symbolic(__entry->load, kvm_fpu_load_symbol))
- )
- 
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0))
-+
-+LTTNG_TRACEPOINT_EVENT(kvm_age_page,
-+	TP_PROTO(ulong gfn, int level, struct kvm_memory_slot *slot, int ref),
-+	TP_ARGS(gfn, level, slot, ref),
-+
-+	TP_STRUCT__entry(
-+		__field(        u64,    hva             )
-+		__field(        u64,    gfn             )
-+		__field(        u8,     level           )
-+		__field(        u8,     referenced      )
-+	),
-+
-+	TP_fast_assign(
-+		tp_assign(gfn, gfn)
-+		tp_assign(level, level)
-+		tp_assign(hva, ((gfn - slot->base_gfn) <<
-+			PAGE_SHIFT) + slot->userspace_addr)
-+		tp_assign(referenced, ref)
-+	),
-+
-+	TP_printk("hva %llx gfn %llx level %u %s",
-+		__entry->hva, __entry->gfn, __entry->level,
-+		__entry->referenced ? "YOUNG" : "OLD")
-+)
-+
-+#else
-+
- LTTNG_TRACEPOINT_EVENT(kvm_age_page,
- 	TP_PROTO(ulong hva, struct kvm_memory_slot *slot, int ref),
- 	TP_ARGS(hva, slot, ref),
-@@ -254,6 +282,7 @@ LTTNG_TRACEPOINT_EVENT(kvm_age_page,
- 		  __entry->referenced ? "YOUNG" : "OLD")
- )
- #endif
-+#endif
- 
- #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38))
- 
diff --git a/pkgs/os-specific/linux/lttng-modules/build-fix.patch b/pkgs/os-specific/linux/lttng-modules/build-fix.patch
deleted file mode 100644
index 76f449b8b2c6..000000000000
--- a/pkgs/os-specific/linux/lttng-modules/build-fix.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-[PATCH] Update compaction instrumentation for 3.14.x stable kernels
-
-Conditional compilation introduced by lttng-modules commit
-
-  0007344741ef65259bc52dea72259173dfbf96c0
-
-needs to be applied to kernels 3.14.25 and up in the 3.14.x branch.
-
-Signed-off-by: Simon Marchi <simon.marchi at polymtl.ca>
-Reported-by: Bjørn Forsman <bjorn.forsman at gmail.com>
----
- instrumentation/events/lttng-module/compaction.h | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/instrumentation/events/lttng-module/compaction.h b/instrumentation/events/lttng-module/compaction.h
-index ee23aa9..773a6ad 100644
---- a/instrumentation/events/lttng-module/compaction.h
-+++ b/instrumentation/events/lttng-module/compaction.h
-@@ -46,7 +46,8 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_compaction_isolate_template, mm_compaction_is
- 	TP_ARGS(nr_scanned, nr_taken)
- )
- 
--#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0))
-+#if LTTNG_KERNEL_RANGE(3,14,25, 3,15,0) || \
-+	(LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0))
- LTTNG_TRACEPOINT_EVENT(mm_compaction_migratepages,
- 
- 	TP_PROTO(unsigned long nr_all,
--- 
-2.1.3
diff --git a/pkgs/os-specific/linux/lttng-modules/default.nix b/pkgs/os-specific/linux/lttng-modules/default.nix
index 871edf87b7a0..5fe065d3cc66 100644
--- a/pkgs/os-specific/linux/lttng-modules/default.nix
+++ b/pkgs/os-specific/linux/lttng-modules/default.nix
@@ -1,21 +1,18 @@
-{ stdenv, fetchurl, kernel }:
+{ stdenv, fetchgit, kernel }:
 
 assert stdenv.lib.versionAtLeast kernel.version "3.4";  # fails on 3.2
-assert builtins.substring 0 4 kernel.version != "3.12";
 
 stdenv.mkDerivation rec {
   pname = "lttng-modules-${version}";
   name = "${pname}-${kernel.version}";
-  version = "2.6.0-rc1"; # "git describe bf2ba318fff"
+  version = "2.6.0-5-g1b2a542";
 
-  src = fetchurl {
-    url = "https://github.com/lttng/lttng-modules/archive/v${version}.tar.gz";
-    sha256 = "01gha02ybbzr86v6s6bqn649jiw5k89kb363b9s1iv8igrdlzhl1";
+  src = fetchgit {
+    url = "https://github.com/lttng/lttng-modules.git";
+    rev = "1b2a5429de815c95643df2eadf91253909708728";
+    sha256 = "0zccaiadnk0xl6xrqaqlg9rpkwjgbq2fiyc3psylzqimnx0ydxc2";
   };
 
-  # from upstream ML, should be in the next release
-  patches = [ ./build-fix.patch ./6f0af2643c40b57280796eaa4fe60ce4f678b6dc.patch ];
-
   preConfigure = ''
     export KERNELDIR="${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
     export INSTALL_MOD_PATH="$out"
diff --git a/pkgs/os-specific/linux/lvm2/default.nix b/pkgs/os-specific/linux/lvm2/default.nix
index 1d4ecdec98d4..228f7b34be01 100644
--- a/pkgs/os-specific/linux/lvm2/default.nix
+++ b/pkgs/os-specific/linux/lvm2/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, pkgconfig, udev, utillinux, coreutils, enable_dmeventd ? false }:
 
 let
-  version = "2.02.114";
+  version = "2.02.118";
 in
 
 stdenv.mkDerivation {
@@ -9,7 +9,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "ftp://sources.redhat.com/pub/lvm2/releases/LVM2.${version}.tgz";
-    sha256 = "19bl536yylyi873p46prfwv086bg0sg0q5l4c7x6lnlwzfnb176y";
+    sha256 = "1ishsibxn1l5fymrrc5fd3z05x1z2zh0y8939wpvwz0qp9rwxazn";
   };
 
   configureFlags =
diff --git a/pkgs/os-specific/linux/lxc/default.nix b/pkgs/os-specific/linux/lxc/default.nix
index 04ca4514a0f4..9939a5525747 100644
--- a/pkgs/os-specific/linux/lxc/default.nix
+++ b/pkgs/os-specific/linux/lxc/default.nix
@@ -1,38 +1,63 @@
-{ stdenv, autoreconfHook, fetchurl, libcap, apparmor, perl, docbook2x
-, docbook_xml_dtd_45, gnutls, pkgconfig
+{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, perl, docbook2x
+, docbook_xml_dtd_45, systemd
+, libapparmor ? null, gnutls ? null, libseccomp ? null, cgmanager ? null
+, libnih ? null, dbus ? null, libcap ? null
 }:
 
+let
+  enableCgmanager = cgmanager != null && libnih != null && dbus != null;
+in
+with stdenv.lib;
 stdenv.mkDerivation rec {
-  name = "lxc-1.0.7";
+  name = "lxc-1.1.1";
 
-  src = fetchurl {
-    url = "http://github.com/lxc/lxc/archive/${name}.tar.gz";
-    sha256 = "1wm8n1b8j3x37757h2yyz53k3b6r2r301fmkviqf4xp0jaav1cd0";
+  src = fetchFromGitHub {
+    owner = "lxc";
+    repo = "lxc";
+    rev = name;
+    sha256 = "04zpznd364862y3dwn97klvwfw9i2b6n1lh4fkci0z74c6z9svql";
   };
 
-  buildInputs = [ libcap apparmor perl docbook2x gnutls autoreconfHook pkgconfig ];
+  buildInputs = [
+    autoreconfHook pkgconfig perl docbook2x systemd
+    libapparmor gnutls libseccomp cgmanager libnih dbus libcap
+  ];
 
-  patches = [ ./install-localstatedir-in-store.patch ./support-db2x.patch ];
+  patches = [ ./support-db2x.patch ];
 
-  preConfigure = ''
-    export XML_CATALOG_FILES=${docbook_xml_dtd_45}/xml/dtd/docbook/catalog.xml
-    substituteInPlace doc/rootfs/Makefile.am --replace '@LXCROOTFSMOUNT@' '$out/lib/lxc/rootfs'
-    substituteInPlace configure.ac --replace '$sysconfdir/' '/etc/'
-    substituteInPlace configure.ac --replace '$${sysconfdir}/' '/etc/'
-  '';
+  XML_CATALOG_FILES = "${docbook_xml_dtd_45}/xml/dtd/docbook/catalog.xml";
 
   configureFlags = [
     "--localstatedir=/var"
+    "--sysconfdir=/etc"
     "--with-rootfs-path=/var/lib/lxc/rootfs"
+  ] ++ optional (libapparmor != null) "--enable-apparmor"
+    ++ optional (gnutls != null) "--enable-gnutls"
+    ++ optional (libseccomp != null) "--enable-seccomp"
+    ++ optional (enableCgmanager) "--enable-cgmanager"
+    ++ optional (libcap != null) "--enable-capabilities"
+    ++ [
     "--enable-doc"
     "--enable-tests"
-    "--enable-apparmor"
   ];
 
+  installFlags = [ "DESTDIR=\${out}" ];
+
+  postInstall = ''
+    mv $out/$out/* $out
+    DIR=$out/$out
+    while rmdir $DIR 2>/dev/null; do
+      DIR="$(dirname "$DIR")"
+    done
+
+    # Remove the unneeded var/lib directories
+    rm -rf $out/var
+  '';
+
   meta = {
     homepage = "http://lxc.sourceforge.net";
     description = "userspace tools for Linux Containers, a lightweight virtualization system";
-    license = stdenv.lib.licenses.lgpl21Plus;
+    license = licenses.lgpl21Plus;
 
     longDescription = ''
       LXC is the userspace control package for Linux Containers, a
@@ -42,7 +67,7 @@ stdenv.mkDerivation rec {
       mechanisms to Linux’s existing process management infrastructure.
     '';
 
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.simons ];
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ simons wkennington ];
   };
 }
diff --git a/pkgs/os-specific/linux/lxc/install-localstatedir-in-store.patch b/pkgs/os-specific/linux/lxc/install-localstatedir-in-store.patch
deleted file mode 100644
index d45335a02324..000000000000
--- a/pkgs/os-specific/linux/lxc/install-localstatedir-in-store.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/Makefile.am b/Makefile.am
-index eac2bfd..8f040d3 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -25,8 +25,8 @@ pcdatadir = $(libdir)/pkgconfig
- pcdata_DATA = lxc.pc
- 
- install-data-local:
--	$(MKDIR_P) $(DESTDIR)$(LXCPATH)
--	$(MKDIR_P) $(DESTDIR)$(localstatedir)/cache/lxc
-+	$(MKDIR_P) $(out)$(LXCPATH)
-+	$(MKDIR_P) $(out)$(localstatedir)/cache/lxc
- 
- ChangeLog::
- 	@touch ChangeLog
diff --git a/pkgs/os-specific/linux/macchanger/default.nix b/pkgs/os-specific/linux/macchanger/default.nix
index 1f046de40edd..b6ae89afbaf6 100644
--- a/pkgs/os-specific/linux/macchanger/default.nix
+++ b/pkgs/os-specific/linux/macchanger/default.nix
@@ -1,22 +1,27 @@
-{ stdenv, fetchurl }:
+{ stdenv, fetchFromGitHub, autoreconfHook, texinfo }:
 
 let
   pname = "macchanger";
-  version = "1.6.0";
+  version = "1.7.0";
 in
 
 stdenv.mkDerivation rec {
   name = "${pname}-${version}";
-  src = fetchurl {
-    url = "mirror://gnu/${pname}/${name}.tar.gz";
-    sha256 = "31534f138f1d21fa247be74ba6bef3fbfa47bbcd5033e99bd10c432fe58e51f7";
+
+  src = fetchFromGitHub {
+    owner = "alobbs";
+    repo = "macchanger";
+    rev = version;
+    sha256 = "1hypx6sxhd2b1nsxj314hpkhj7q4x9p2kfaaf20rjkkkig0nck9r";
   };
 
+  buildInputs = [ autoreconfHook texinfo ];
+
   meta = {
     description = "A utility for viewing/manipulating the MAC address of network interfaces";
-    maintainers = with stdenv.lib.maintainers; [ joachifm ];
-    license = with stdenv.lib.licenses; gpl2Plus;
+    maintainers = [ stdenv.lib.maintainers.joachifm ];
+    license = stdenv.lib.licenses.gpl2Plus;
     homepage = "https://www.gnu.org/software/macchanger";
-    platform = with stdenv.lib.platforms; linux;
+    platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/os-specific/linux/mdadm/default.nix b/pkgs/os-specific/linux/mdadm/default.nix
index 48e1c1784900..a7965a70b1c7 100644
--- a/pkgs/os-specific/linux/mdadm/default.nix
+++ b/pkgs/os-specific/linux/mdadm/default.nix
@@ -3,6 +3,15 @@
 stdenv.mkDerivation rec {
   name = "mdadm-3.3";
 
+  # WARNING -- WARNING -- WARNING -- WARNING -- WARNING -- WARNING -- WARNING
+  #  Do NOT update this if you're not ABSOLUTELY certain that it will work.
+  #  Please check the update using the NixOS VM test, BEFORE pushing:
+  #    nix-build nixos/release.nix -A tests.installer.swraid.x86_64-linux
+  # Discussion:
+  #   https://github.com/NixOS/nixpkgs/commit/7719f7f
+  #   https://github.com/NixOS/nixpkgs/commit/666cf99
+  #   https://github.com/NixOS/nixpkgs/pull/6006
+  # WARNING -- WARNING -- WARNING -- WARNING -- WARNING -- WARNING -- WARNING
   src = fetchurl {
     url = "mirror://kernel/linux/utils/raid/mdadm/${name}.tar.bz2";
     sha256 = "0igdqflihiq1dp5qlypzw0xfl44f4n3bckl7r2x2wfgkplcfa1ww";
diff --git a/pkgs/os-specific/linux/microcode/amd.nix b/pkgs/os-specific/linux/microcode/amd.nix
index 0ca33fa31f04..76a340529910 100644
--- a/pkgs/os-specific/linux/microcode/amd.nix
+++ b/pkgs/os-specific/linux/microcode/amd.nix
@@ -1,25 +1,30 @@
-{ stdenv, fetchurl }:
+{ stdenv, fetchurl, firmwareLinuxNonfree, libarchive }:
 
 stdenv.mkDerivation rec {
-  name = "amd-ucode-2012-09-10";
+  name = "amd-ucode-${firmwareLinuxNonfree.version}";
 
-  src = fetchurl {
-    urls =
-      [ "http://pkgs.fedoraproject.org/repo/pkgs/microcode_ctl/${name}.tar/559bc355d3799538584add80df2996f0/${name}.tar"
-        "http://www.amd64.org/pub/microcode/${name}.tar"
-      ];
-    sha256 = "065phvhx5hx5ssdd1x2p5m1yv26ak7l5aaw6yk6h95x9mxn5r111";
-  };
+  src = firmwareLinuxNonfree;
+
+  sourceRoot = ".";
+
+  buildInputs = [ libarchive ];
+
+  buildPhase = ''
+    mkdir -p kernel/x86/microcode
+    find ${firmwareLinuxNonfree}/lib/firmware/amd-ucode -name \*.bin \
+      -exec sh -c 'cat {} >> kernel/x86/microcode/AuthenticAMD.bin' \;
+  '';
 
   installPhase = ''
-    mkdir -p $out/lib/firmware/amd-ucode $out/share/doc/amd-ucode
-    mv microcode_amd_fam15h.bin microcode_amd.bin $out/lib/firmware/amd-ucode/
-    mv LICENSE $out/share/doc/amd-ucode
+    mkdir -p $out
+    echo kernel/x86/microcode/AuthenticAMD.bin | bsdcpio -o -H newc -R 0:0 > $out/amd-ucode.img
   '';
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "AMD Processor microcode patch";
     homepage = http://www.amd64.org/support/microcode.html;
-    license = stdenv.lib.licenses.unfreeRedistributableFirmware;
+    license = licenses.unfreeRedistributableFirmware;
+    maintainers = with maintainers; [ wkennington ];
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/os-specific/linux/microcode/converter.nix b/pkgs/os-specific/linux/microcode/converter.nix
deleted file mode 100644
index da4d96772171..000000000000
--- a/pkgs/os-specific/linux/microcode/converter.nix
+++ /dev/null
@@ -1,29 +0,0 @@
-{ stdenv, fetchurl }:
-
-stdenv.mkDerivation {
-  name = "microcode2ucode-20120205";
-  src = fetchurl {
-    url = "http://pkgs.fedoraproject.org/repo/pkgs/microcode_ctl/intel-microcode2ucode.c/0efc5f6c74a4d7e61ca22683c93c98cf/intel-microcode2ucode.c";
-    sha256 = "c51b1b1d8b4b28e7d5d007917c1e444af1a2ff04a9408aa9067c0e57d70164de";
-  };
-
-  sourceRoot = ".";
-
-  unpackPhase = ''
-    # nothing to unpack
-  '';
-
-  buildPhase = ''
-    gcc -Wall -O2 $src -o intel-microcode2ucode
-  '';
-
-  installPhase = ''
-    mkdir -p "$out/bin"
-    cp intel-microcode2ucode "$out/bin/"
-  '';
-
-  meta = {
-    homepage = http://www.intel.com;
-    description = "Microcode converter for Intel .dat files";
-  };
-}
diff --git a/pkgs/os-specific/linux/microcode/intel-microcode2ucode.c b/pkgs/os-specific/linux/microcode/intel-microcode2ucode.c
new file mode 100644
index 000000000000..c1660fae38a1
--- /dev/null
+++ b/pkgs/os-specific/linux/microcode/intel-microcode2ucode.c
@@ -0,0 +1,154 @@
+/*
+ * Convert Intel microcode.dat into a single binary microcode.bin file
+ *
+ * Based on code by Kay Sievers <kay.sievers@vrfy.org>
+ * Changed to create a single file by Thomas Bächler <thomas@archlinux.org>
+ */
+
+
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
+
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <limits.h>
+#include <stdbool.h>
+#include <inttypes.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <sys/stat.h>
+
+struct microcode_header_intel {
+	unsigned int hdrver;
+	unsigned int rev;
+	unsigned int date;
+	unsigned int sig;
+	unsigned int cksum;
+	unsigned int ldrver;
+	unsigned int pf;
+	unsigned int datasize;
+	unsigned int totalsize;
+	unsigned int reserved[3];
+};
+
+union mcbuf {
+	struct microcode_header_intel hdr;
+	unsigned int i[0];
+	char c[0];
+};
+
+int main(int argc, char *argv[])
+{
+	const char *filename = "/lib/firmware/microcode.dat";
+	FILE *f;
+	char line[LINE_MAX];
+	char buf[4000000];
+	union mcbuf *mc;
+	size_t bufsize, count, start;
+	int rc = EXIT_SUCCESS;
+
+	if (argv[1] != NULL)
+		filename = argv[1];
+
+	count = 0;
+	mc = (union mcbuf *) buf;
+	f = fopen(filename, "re");
+	if (f == NULL) {
+		printf("open %s: %m\n", filename);
+		rc = EXIT_FAILURE;
+		goto out;
+	}
+
+	while (fgets(line, sizeof(line), f) != NULL) {
+		if (sscanf(line, "%x, %x, %x, %x",
+		    &mc->i[count],
+		    &mc->i[count + 1],
+		    &mc->i[count + 2],
+		    &mc->i[count + 3]) != 4)
+			continue;
+		count += 4;
+	}
+	fclose(f);
+
+	bufsize = count * sizeof(int);
+	printf("%s: %lu(%luk) bytes, %zu integers\n",
+	       filename,
+	       bufsize,
+	       bufsize / 1024,
+	       count);
+
+	if (bufsize < sizeof(struct microcode_header_intel))
+		goto out;
+
+	f = fopen("microcode.bin", "we");
+	if (f == NULL) {
+		printf("open microcode.bin: %m\n");
+		rc = EXIT_FAILURE;
+		goto out;
+	}
+
+	start = 0;
+	for (;;) {
+		size_t size;
+		unsigned int family, model, stepping;
+		unsigned int year, month, day;
+
+		mc = (union mcbuf *) &buf[start];
+
+		if (mc->hdr.totalsize)
+			size = mc->hdr.totalsize;
+		else
+			size = 2000 + sizeof(struct microcode_header_intel);
+
+		if (mc->hdr.ldrver != 1 || mc->hdr.hdrver != 1) {
+			printf("unknown version/format:\n");
+			rc = EXIT_FAILURE;
+			break;
+		}
+
+		/*
+		 *  0- 3 stepping
+		 *  4- 7 model
+		 *  8-11 family
+		 * 12-13 type
+		 * 16-19 extended model
+		 * 20-27 extended family
+		 */
+		family = (mc->hdr.sig >> 8) & 0xf;
+		if (family == 0xf)
+			family += (mc->hdr.sig >> 20) & 0xff;
+		model = (mc->hdr.sig >> 4) & 0x0f;
+		if (family == 0x06)
+			model += ((mc->hdr.sig >> 16) & 0x0f) << 4;
+		stepping = mc->hdr.sig & 0x0f;
+
+		year = mc->hdr.date & 0xffff;
+		month = mc->hdr.date >> 24;
+		day = (mc->hdr.date >> 16) & 0xff;
+
+		printf("\n");
+		printf("signature: 0x%02x\n", mc->hdr.sig);
+		printf("flags:     0x%02x\n", mc->hdr.pf);
+		printf("revision:  0x%02x\n", mc->hdr.rev);
+		printf("date:      %04x-%02x-%02x\n", year, month, day);
+		printf("size:      %zu\n", size);
+
+		if (fwrite(mc, size, 1, f) != 1) {
+			printf("write microcode.bin: %m\n");
+			rc = EXIT_FAILURE;
+			goto out;
+		}
+
+		start += size;
+		if (start >= bufsize)
+			break;
+	}
+	fclose(f);
+	printf("\n");
+out:
+	return rc;
+}
diff --git a/pkgs/os-specific/linux/microcode/intel.nix b/pkgs/os-specific/linux/microcode/intel.nix
index b72194548e07..ea9ff1d58d1a 100644
--- a/pkgs/os-specific/linux/microcode/intel.nix
+++ b/pkgs/os-specific/linux/microcode/intel.nix
@@ -1,31 +1,34 @@
-{ stdenv, fetchurl, microcode2ucode }:
+{ stdenv, fetchurl, libarchive }:
 
-let version = "20140624"; in
-
-stdenv.mkDerivation {
+stdenv.mkDerivation rec {
   name = "microcode-intel-${version}";
+  version = "20150121";
 
   src = fetchurl {
-    url = "http://downloadmirror.intel.com/23984/eng/microcode-${version}.tgz";
-    sha256 = "0dza0bdlx7q88yhnynvfgkrhgf7ycrq6mlp6hwnpp2j3h33jlrml";
+    url = "http://downloadmirror.intel.com/24661/eng/microcode-${version}.tgz";
+    sha256 = "1cznv3f25cxkwxdc930ab0ifvq0c76fryppadi4p26a2pf9knd93";
   };
 
-  buildInputs = [ microcode2ucode ];
+  buildInputs = [ libarchive ];
 
   sourceRoot = ".";
 
   buildPhase = ''
-    intel-microcode2ucode microcode.dat
+    gcc -O2 -Wall -o intel-microcode2ucode ${./intel-microcode2ucode.c}
+    ./intel-microcode2ucode microcode.dat
   '';
 
   installPhase = ''
-    mkdir -p $out/lib/firmware
-    cp -r intel-ucode "$out/lib/firmware/"
+    mkdir -p $out kernel/x86/microcode
+    mv microcode.bin kernel/x86/microcode/GenuineIntel.bin
+    echo kernel/x86/microcode/GenuineIntel.bin | bsdcpio -o -H newc -R 0:0 > $out/intel-ucode.img
   '';
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = http://www.intel.com/;
     description = "Microcode for Intel processors";
-    license = stdenv.lib.licenses.unfree;
+    license = licenses.unfreeRedistributableFirmware;
+    maintainers = with maintainers; [ wkennington ];
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/os-specific/linux/mingetty/default.nix b/pkgs/os-specific/linux/mingetty/default.nix
index 192e2c7ac5f9..4e2888fa942a 100644
--- a/pkgs/os-specific/linux/mingetty/default.nix
+++ b/pkgs/os-specific/linux/mingetty/default.nix
@@ -1,8 +1,8 @@
-{stdenv, fetchurl}:
+{ stdenv, fetchurl }:
 
 stdenv.mkDerivation {
   name = "mingetty-1.08";
-  
+
   src = fetchurl {
     url = mirror://sourceforge/mingetty/mingetty-1.08.tar.gz;
     sha256 = "05yxrp44ky2kg6qknk1ih0kvwkgbn9fbz77r3vci7agslh5wjm8g";
@@ -19,5 +19,6 @@ stdenv.mkDerivation {
 
   meta = {
     homepage = http://sourceforge.net/projects/mingetty;
+    platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/os-specific/linux/musl/default.nix b/pkgs/os-specific/linux/musl/default.nix
index 97407c887cea..1dae1d215ec2 100644
--- a/pkgs/os-specific/linux/musl/default.nix
+++ b/pkgs/os-specific/linux/musl/default.nix
@@ -2,17 +2,21 @@
 
 stdenv.mkDerivation rec {
   name    = "musl-${version}";
-  version = "1.1.4";
+  version = "1.1.8";
 
   src = fetchurl {
     url    = "http://www.musl-libc.org/releases/${name}.tar.gz";
-    sha256 = "1kgmi17zpzgjhywmmqxazj8qsx8cf9siwa65jqd2i6rs7jnnb335";
+    sha256 = "04vq4a1hm81kbxfcqa30s6xpzbqf3568gbysfxcmb72v8438b4ps";
   };
 
   enableParallelBuilding = true;
-  configurePhase = ''
-    ./configure --enable-shared --enable-static --prefix=$out --syslibdir=$out/lib
-  '';
+
+  configureFlags = [
+    "--enable-shared"
+    "--enable-static"
+  ];
+
+  dontDisableStatic = true;
 
   meta = {
     description = "An efficient, small, quality libc implementation";
diff --git a/pkgs/os-specific/linux/nvidiabl/default.nix b/pkgs/os-specific/linux/nvidiabl/default.nix
index 6260134bf111..a5a43926e045 100644
--- a/pkgs/os-specific/linux/nvidiabl/default.nix
+++ b/pkgs/os-specific/linux/nvidiabl/default.nix
@@ -15,6 +15,7 @@ stdenv.mkDerivation {
   makeFlags = [
     "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
     "DESTDIR=$(out)"
+    "KVER=${kernel.modDirVersion}"
   ];
 
   meta = {
diff --git a/pkgs/os-specific/linux/ocz-toolbox/default.nix b/pkgs/os-specific/linux/ocz-toolbox/default.nix
deleted file mode 100644
index 4537cdac3e99..000000000000
--- a/pkgs/os-specific/linux/ocz-toolbox/default.nix
+++ /dev/null
@@ -1,37 +0,0 @@
-{ stdenv, fetchurl, libXrender, fontconfig, freetype, libXext, libX11 }:
-
-let arch = if stdenv.system == "x86_64-linux" then "64"
-           else if stdenv.system == "i686-linux" then "32"
-           else abort "OCZ Toolbox only support {x86-64,i686}-linux targets";
-in stdenv.mkDerivation rec {
-  version = "4.9.0.634";
-  name = "ocz-toolbox-${version}";
-
-  src = fetchurl {
-    url = "http://ocz.com/consumer/download/firmware/OCZToolbox_v${version}_linux.tar.gz";
-    sha256 = "0h51p5bg9h2smxxy1r4xkzzjjavhgql7yy12qmjk0vbh13flgx3y";
-  };
-
-  prePatch = ''
-    cd linux${arch}
-  '';
-
-  libPath = stdenv.lib.makeLibraryPath [ stdenv.cc.cc libXrender fontconfig freetype libXext libX11 ];
-
-  installPhase = ''
-    install -Dm755 OCZToolbox $out/bin/OCZToolbox
-    patchelf \
-      --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
-      --set-rpath "$libPath" \
-      $out/bin/OCZToolbox
-  '';
-
-  dontStrip = true;
-
-  meta = with stdenv.lib; {
-    description = "Update firmware and BIOS, secure erase, view SMART attributes, and view drive details of your OCZ SSD";
-    homepage = "http://ocz.com/consumer/download/firmware";
-    license = licenses.unfree;
-    maintainers = with maintainers; [ abbradar ];
-  };
-}
diff --git a/pkgs/os-specific/linux/pam_console/configure.ac b/pkgs/os-specific/linux/pam_console/configure.ac
deleted file mode 100644
index 0d2d0288acff..000000000000
--- a/pkgs/os-specific/linux/pam_console/configure.ac
+++ /dev/null
@@ -1,27 +0,0 @@
-AC_PREREQ([2.59])
-AC_INIT([pam_console], [@PV@])
-AM_INIT_AUTOMAKE([pam_console], [@PV@])
-
-AC_CONFIG_HEADER([config.h])
-
-AC_GNU_SOURCE
-
-AM_CONDITIONAL([HAVE_VERSIONING], [test "x" = "y"])
-
-PKG_CHECK_MODULES([GLIB], [glib-2.0])
-
-m4_undefine([AC_PROG_CXX])
-m4_defun([AC_PROG_CXX],[])
-m4_undefine([AC_PROG_F77])
-m4_defun([AC_PROG_F77],[])
-AC_PROG_LIBTOOL
-
-AC_PROG_YACC
-
-SECUREDIR=${libdir}/security
-SCONFIGDIR=${sysconfdir}/security
-
-AC_SUBST([SECUREDIR])
-AC_SUBST([SCONFIGDIR])
-
-AC_OUTPUT([Makefile])
diff --git a/pkgs/os-specific/linux/pam_console/default.nix b/pkgs/os-specific/linux/pam_console/default.nix
deleted file mode 100644
index 7c1e83c0ed60..000000000000
--- a/pkgs/os-specific/linux/pam_console/default.nix
+++ /dev/null
@@ -1,31 +0,0 @@
-{stdenv, fetchurl, pam, autoconf, automake, libtool, pkgconfig, glib, bison, flex}:
-
-let
-
-  # Configure script borrowed from the good folks at Gentoo 
-  # (http://sources.gentoo.org/viewcvs.py/*checkout*/gentoo-x86/sys-auth/pam_console/files/pam_console-configure.ac).
-  configure = ./configure.ac;
-
-in
-   
-stdenv.mkDerivation {
-  name = "pam_console-0.99.5-1";
-   
-  src = fetchurl {
-    url = http://cvs.fedora.redhat.com/repo/dist/pam/pam-redhat-0.99.5-1.tar.bz2/e2edde7861c48195728bc531e5a277e0/pam-redhat-0.99.5-1.tar.bz2;
-    sha256 = "077xdhwspc785fas4yfw50mpy92rdfh35kq9awlrpbzq1fnapsfs";
-  };
-
-  buildInputs = [pam autoconf automake libtool pkgconfig glib bison flex];
-
-  makeFlags = "LEX=flex";
-
-  preConfigure = "
-    cd pam_console
-    cp ${configure} configure.ac
-    touch NEWS AUTHORS ChangeLog
-    # Don't try to create /var/run/console.
-    substituteInPlace Makefile.am --replace 'mkdir -m $(LOCKMODE) -p -p $(DESTDIR)$(LOCKDIR)' ''
-    autoreconf --install
-  ";
-}
diff --git a/pkgs/os-specific/linux/pam_login/default.nix b/pkgs/os-specific/linux/pam_login/default.nix
deleted file mode 100644
index 46da3053d20c..000000000000
--- a/pkgs/os-specific/linux/pam_login/default.nix
+++ /dev/null
@@ -1,20 +0,0 @@
-{stdenv, fetchurl, pam}:
-   
-stdenv.mkDerivation {
-  name = "pam_login-3.35";
-   
-  src = fetchurl {
-    url = ftp://ftp.suse.com/pub/people/kukuk/pam/pam_login/pam_login-3.35.tar.bz2;
-    sha256 = "1w2hpwjhmwjhf8rg789xpl0hibahqlr3ccivfy3m4kgrm5gf04kv";
-  };
-
-  patches = [ ./sys-stat-h.patch ];
-
-  # To overcome a gcc 4.4 warning:
-  # "#ident is a deprecated GCC extension"
-  postPatch = ''
-    sed -i s/-Werror// configure
-  '';
-
-  buildInputs = [pam];
-}
diff --git a/pkgs/os-specific/linux/pam_login/sys-stat-h.patch b/pkgs/os-specific/linux/pam_login/sys-stat-h.patch
deleted file mode 100644
index 163fd7ce8e25..000000000000
--- a/pkgs/os-specific/linux/pam_login/sys-stat-h.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-Include the needed <sys/stat.h> since recent glibc is stricter about that.
-
---- pam_login-3.35/src/login.c~	2007-05-04 14:07:49.000000000 +0200
-+++ pam_login-3.35/src/login.c	2010-04-27 11:38:13.000000000 +0200
-@@ -47,6 +47,7 @@
- #include <signal.h>
- #include <stdio.h>
- #include <string.h>
-+#include <sys/stat.h>
- #include <sys/ioctl.h>
- #include <sys/param.h>
- #include <sys/resource.h>
diff --git a/pkgs/os-specific/linux/pax-utils/default.nix b/pkgs/os-specific/linux/pax-utils/default.nix
index 28bf24babdc3..266fee9e493c 100644
--- a/pkgs/os-specific/linux/pax-utils/default.nix
+++ b/pkgs/os-specific/linux/pax-utils/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "pax-utils-${version}";
-  version = "1.0.1";
+  version = "1.0.3";
 
   src = fetchurl {
     url = "http://dev.gentoo.org/~vapier/dist/${name}.tar.xz";
-    sha256 = "0v14dvkg19yabh0ijy8fbrvapxvc36dwhvp90py3baq7qb44wrc7";
+    sha256 = "0w2nddgany3s0znyj6zizlvn8y5vba9x49jm5nliv13p3x7ajdc5";
   };
 
   makeFlags = [
diff --git a/pkgs/os-specific/linux/plymouth/default.nix b/pkgs/os-specific/linux/plymouth/default.nix
index a04407ba5c2a..00d330ca955e 100644
--- a/pkgs/os-specific/linux/plymouth/default.nix
+++ b/pkgs/os-specific/linux/plymouth/default.nix
@@ -1,6 +1,5 @@
-{ stdenv, fetchurl, autoconf, automake, cairo, docbook_xsl, gtk
-, libdrm, libpng , libtool, libxslt, makeWrapper, pango, pkgconfig
-, udev
+{ stdenv, fetchurl, autoreconfHook, cairo, docbook_xsl, gtk
+, libdrm, libpng, libxslt, makeWrapper, pango, pkgconfig, udev
 }:
 
 stdenv.mkDerivation rec {
@@ -13,7 +12,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [
-    autoconf automake cairo docbook_xsl gtk libdrm libpng libtool
+    autoreconfHook cairo docbook_xsl gtk libdrm libpng
     libxslt makeWrapper pango pkgconfig udev
   ];
 
@@ -22,23 +21,23 @@ stdenv.mkDerivation rec {
       -i configure.ac
   '';
 
-  configurePhase = ''
-    ./configure \
-      --prefix=$out \
-      -bindir=$out/bin \
-      -sbindir=$out/sbin \
-      --exec-prefix=$out \
-      --libdir=$out/lib \
-      --libexecdir=$out/lib \
-      --sysconfdir=$out/etc \
-      --localstatedir=/var \
-      --with-log-viewer \
-      --without-system-root-install \
-      --without-rhgb-compat-link \
-      --enable-tracing \
-      --enable-systemd-integration \
-      --enable-pango \
-      --enable-gtk
+  postPatch = ''
+    configureFlags="
+      --prefix=$out
+      --bindir=$out/bin
+      --sbindir=$out/sbin
+      --exec-prefix=$out
+      --libdir=$out/lib
+      --libexecdir=$out/lib
+      --sysconfdir=$out/etc
+      --localstatedir=/var
+      --with-log-viewer
+      --without-system-root-install
+      --without-rhgb-compat-link
+      --enable-tracing
+      --enable-systemd-integration
+      --enable-pango
+      --enable-gtk"
   '';
 
   meta = with stdenv.lib; {
diff --git a/pkgs/os-specific/linux/s6-linux-utils/default.nix b/pkgs/os-specific/linux/s6-linux-utils/default.nix
index 42a4357c74cf..9bccedb01200 100644
--- a/pkgs/os-specific/linux/s6-linux-utils/default.nix
+++ b/pkgs/os-specific/linux/s6-linux-utils/default.nix
@@ -2,7 +2,7 @@
 
 let
 
-  version = "2.0.0.0";
+  version = "2.0.2.0";
 
 in stdenv.mkDerivation rec {
 
@@ -10,7 +10,7 @@ in stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "http://www.skarnet.org/software/s6-linux-utils/${name}.tar.gz";
-    sha256 = "0lfgfwnk81vjlkvmr1gzknz9swgcrp5s7x19dfkw6shvi95fyirh";
+    sha256 = "0y6dq4wb5v1c6ps6a7jyq08r2pjksrvz6n3dnfa9c91gzm4m1dxb";
   };
 
   dontDisableStatic = true;
diff --git a/pkgs/os-specific/linux/spl/default.nix b/pkgs/os-specific/linux/spl/default.nix
index 618b59b32aa5..4e13aa2687c6 100644
--- a/pkgs/os-specific/linux/spl/default.nix
+++ b/pkgs/os-specific/linux/spl/default.nix
@@ -1,14 +1,14 @@
 { callPackage, fetchFromGitHub, ... } @ args:
 
 callPackage ./generic.nix (args // rec {
-  version = "0.6.3-1.2";
+  version = "0.6.3-1.3";
 
   src = fetchFromGitHub {
     owner = "zfsonlinux";
     repo = "spl";
     rev = "spl-${version}";
-    sha256 = "0id0m3sfpkz8w7b2pc51px8kvz8xnaf8msps57ddarxidmxvb45g";
+    sha256 = "1d4gdlkhshlyfkswbqx06fhs8m5lxgk3vhds6g7ipd3q93ngrczx";
   };
 
-  patches = [ ./install_prefix.patch ./const.patch ./time.patch ];
+  patches = [ ./install_prefix.patch ./const.patch ];
 })
diff --git a/pkgs/os-specific/linux/spl/git.nix b/pkgs/os-specific/linux/spl/git.nix
index 0a4e79b41a4d..be09b424a6b7 100644
--- a/pkgs/os-specific/linux/spl/git.nix
+++ b/pkgs/os-specific/linux/spl/git.nix
@@ -1,12 +1,12 @@
 { callPackage, fetchgit, ... } @ args:
 
 callPackage ./generic.nix (args // rec {
-  version = "2015-03-03";
+  version = "2015-03-25";
 
   src = fetchgit {
     url = git://github.com/zfsonlinux/spl.git;
-    rev = "6ab08667a44458f775da9f0ecceddbcea1275746";
-    sha256 = "1n168kgagc6fkm9pqfwvlbqgw85z8ksjfy3bff69pi0cn1g9d739";
+    rev = "a4f54cf036d9a966ff87abe9a0063f2b457c2389";
+    sha256 = "0n10icwmnx3y6201fncswhd1mfvs6xyk8praj27z0wnzxs1i4k96";
   };
 
   patches = [ ./const.patch ./install_prefix-git.patch ];
diff --git a/pkgs/os-specific/linux/spl/time.patch b/pkgs/os-specific/linux/spl/time.patch
deleted file mode 100644
index 6b1e23bc05ef..000000000000
--- a/pkgs/os-specific/linux/spl/time.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-diff --git a/module/spl/spl-time.c b/module/spl/spl-time.c
-index 0ed49cc..b0fad4f 100644
---- a/module/spl/spl-time.c
-+++ b/module/spl/spl-time.c
-@@ -40,12 +40,7 @@ extern unsigned long long monotonic_clock(void);
- void
- __gethrestime(timestruc_t *ts)
- {
--	struct timespec tspec;
--
--	getnstimeofday(&tspec);
--
--	ts->tv_sec = tspec.tv_sec;
--	ts->tv_nsec = tspec.tv_nsec;
-+	*ts = current_kernel_time();
- }
- EXPORT_SYMBOL(__gethrestime);
- 
diff --git a/pkgs/os-specific/linux/sysdig/default.nix b/pkgs/os-specific/linux/sysdig/default.nix
index 4f94b4074201..5a7d07000046 100644
--- a/pkgs/os-specific/linux/sysdig/default.nix
+++ b/pkgs/os-specific/linux/sysdig/default.nix
@@ -3,10 +3,10 @@ let
   inherit (stdenv.lib) optional optionalString;
   s = rec {
     baseName="sysdig";
-    version = "0.1.98";
+    version = "0.1.99";
     name="${baseName}-${version}";
     url="https://github.com/draios/sysdig/archive/${version}.tar.gz";
-    sha256 = "0pq27mjvdiq20zjjhvq5fkvbq4xqcyzcrh2nkhx6gdb906h1mj4l";
+    sha256 = "02faw8s07i7jjydqzqfs0r9lc2qmny3sn26741bz0hmazs9h9w76";
   };
   buildInputs = [
     cmake zlib luajit
diff --git a/pkgs/os-specific/linux/sysklogd/default.nix b/pkgs/os-specific/linux/sysklogd/default.nix
index b7bbdee369a1..fd1d932990eb 100644
--- a/pkgs/os-specific/linux/sysklogd/default.nix
+++ b/pkgs/os-specific/linux/sysklogd/default.nix
@@ -21,5 +21,6 @@ stdenv.mkDerivation {
 
   meta = {
     description = "A system logging daemon";
+    platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/os-specific/linux/systemd/fixes.patch b/pkgs/os-specific/linux/systemd/fixes.patch
index 182927486c57..c1c768dbacb9 100644
--- a/pkgs/os-specific/linux/systemd/fixes.patch
+++ b/pkgs/os-specific/linux/systemd/fixes.patch
@@ -229,7 +229,7 @@ index 70a5918..1926e52 100644
  
 -        cmdline[i++] = "/sbin/fsck";
 -        cmdline[i++] =  arg_repair;
-+        cmdline[i++] = "/run/current-system/sw/sbin/fsck";
++        cmdline[i++] = "/run/current-system/sw/bin/fsck";
          cmdline[i++] = "-T";
  
          /*
diff --git a/pkgs/os-specific/linux/sysvinit/default.nix b/pkgs/os-specific/linux/sysvinit/default.nix
index 7b4ecbb027e1..042e601ec14f 100644
--- a/pkgs/os-specific/linux/sysvinit/default.nix
+++ b/pkgs/os-specific/linux/sysvinit/default.nix
@@ -43,5 +43,6 @@ stdenv.mkDerivation {
   meta = {
     homepage = http://www.nongnu.org/sysvinit/;
     description = "Utilities related to booting and shutdown";
+    platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/os-specific/linux/udisks/1-default.nix b/pkgs/os-specific/linux/udisks/1-default.nix
index 780eeb68d1df..b3df300e519e 100644
--- a/pkgs/os-specific/linux/udisks/1-default.nix
+++ b/pkgs/os-specific/linux/udisks/1-default.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
 
       substituteInPlace src/main.c --replace \
         "/sbin:/bin:/usr/sbin:/usr/bin" \
-        "${utillinux}/bin:${mdadm}/sbin:/var/run/current-system/sw/bin:/var/run/current-system/sw/sbin"
+        "${utillinux}/bin:${mdadm}/sbin:/var/run/current-system/sw/bin:/var/run/current-system/sw/bin"
     '';
 
   buildInputs =
diff --git a/pkgs/os-specific/linux/udisks/2-default.nix b/pkgs/os-specific/linux/udisks/2-default.nix
index 7888fc51be07..2dc99504c584 100644
--- a/pkgs/os-specific/linux/udisks/2-default.nix
+++ b/pkgs/os-specific/linux/udisks/2-default.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
     ''
       substituteInPlace src/main.c --replace \
         "@path@" \
-        "${utillinux}/bin:${mdadm}/sbin:/var/run/current-system/sw/bin:/var/run/current-system/sw/sbin"
+        "${utillinux}/bin:${mdadm}/sbin:/var/run/current-system/sw/bin:/var/run/current-system/sw/bin"
     '';
 
   nativeBuildInputs = [ pkgconfig intltool ];
diff --git a/pkgs/os-specific/linux/usbutils/default.nix b/pkgs/os-specific/linux/usbutils/default.nix
index aff730e387a5..710a01ed03d2 100644
--- a/pkgs/os-specific/linux/usbutils/default.nix
+++ b/pkgs/os-specific/linux/usbutils/default.nix
@@ -1,36 +1,25 @@
-{ stdenv, fetchurl, pkgconfig, libusb1 }:
-
-let
-
-  # Obtained from http://www.linux-usb.org/usb.ids.bz2.
-  usbids = fetchurl {
-    url = http://tarballs.nixos.org/usb.ids.20130821.bz2;
-    sha256 = "0x7mf4h5h5wjzhygfr4lc8yz0cwm7mahxrnp5nkxcmawmyxwsg53";
-  };
-
-in
+{ stdenv, fetchurl, pkgconfig, libusb1, hwdata }:
 
 stdenv.mkDerivation rec {
-  name = "usbutils-007";
+  name = "usbutils-008";
 
   src = fetchurl {
     url = "mirror://kernel/linux/utils/usb/usbutils/${name}.tar.xz";
-    sha256 = "197gpbxnspy6ncqv5mziaikcfqgb3irbqqlfwjgzvh5v4hbs14vm";
+    sha256 = "132clk14j4nm8crln2jymdbbc2vhzar2j2hnxyh05m79pbq1lx24";
   };
 
   buildInputs = [ pkgconfig libusb1 ];
 
-  preBuild = "bunzip2 < ${usbids} > usb.ids";
-
   postInstall =
     ''
       rm $out/sbin/update-usbids.sh
       substituteInPlace $out/bin/lsusb.py \
-        --replace /usr/share/usb.ids $out/share/usb.ids
+        --replace /usr/share/usb.ids ${hwdata}/data/hwdata/usb.ids
     '';
 
   meta = {
     homepage = http://www.linux-usb.org/;
     description = "Tools for working with USB devices, such as lsusb";
+    platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/os-specific/linux/util-linux/default.nix b/pkgs/os-specific/linux/util-linux/default.nix
index 81eeee68fbad..327f07442d2d 100644
--- a/pkgs/os-specific/linux/util-linux/default.nix
+++ b/pkgs/os-specific/linux/util-linux/default.nix
@@ -1,15 +1,14 @@
 { stdenv, fetchurl, zlib, ncurses ? null, perl ? null, pam }:
 
 stdenv.mkDerivation rec {
-  name = "util-linux-2.25.2";
+  name = "util-linux-2.26";
 
   src = fetchurl {
-    url = "mirror://kernel/linux/utils/util-linux/v2.25/${name}.tar.xz";
-    sha256 = "e0457f715b73f4a349e1acb08cb410bf0edc9a74a3f75c357070f31f70e33cd6";
+    url = "mirror://kernel/linux/utils/util-linux/v2.26/${name}.tar.xz";
+    sha256 = "a23c6f39dea0ed215ccd589509ffc7bb6f706f6e1a04760f493fb0fd7e93c489";
   };
 
   patches = [ ./rtcwake-search-PATH-for-shutdown.patch
-              ./unshare-fix-map-root-user.patch
             ];
 
   #FIXME: make it also work on non-nixos?
@@ -35,7 +34,7 @@ stdenv.mkDerivation rec {
     --enable-mesg
     --enable-ddate
     --disable-use-tty-group
-    --enable-fs-paths-default=/var/setuid-wrappers:/var/run/current-system/sw/sbin:/sbin
+    --enable-fs-paths-default=/var/setuid-wrappers:/var/run/current-system/sw/bin:/sbin
     ${if ncurses == null then "--without-ncurses" else ""}
   '';
 
@@ -53,5 +52,6 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = http://www.kernel.org/pub/linux/utils/util-linux/;
     description = "A set of system utilities for Linux";
+    platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/os-specific/linux/util-linux/unshare-fix-map-root-user.patch b/pkgs/os-specific/linux/util-linux/unshare-fix-map-root-user.patch
deleted file mode 100644
index 1d1531e110cb..000000000000
--- a/pkgs/os-specific/linux/util-linux/unshare-fix-map-root-user.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-In rare cases droping groups with setgroups(0, NULL) is an operation
-that can grant a user additional privileges.  User namespaces were
-allwoing that operation to unprivileged users and that had to be
-fixed.
-
-Update unshare --map-root-user to disable the setgroups operation
-before setting the gid_map.
-
-This is needed as after the security fix gid_map is restricted to
-privileged users unless setgroups has been disabled.
-
-Signed-off-by: "Eric W. Biederman" <ebiederm@xxxxxxxxxxxx>
----
- include/pathnames.h |  1 +
- sys-utils/unshare.c | 19 +++++++++++++++++++
- 2 files changed, 20 insertions(+)
-
-diff --git a/include/pathnames.h b/include/pathnames.h
-index 1cc4e15e6e4f..1c53e4554268 100644
---- a/include/pathnames.h
-+++ b/include/pathnames.h
-@@ -92,6 +92,7 @@
- 
- #define _PATH_PROC_UIDMAP	"/proc/self/uid_map"
- #define _PATH_PROC_GIDMAP	"/proc/self/gid_map"
-+#define _PATH_PROC_SETGROUPS	"/proc/self/setgroups"
- 
- #define _PATH_PROC_ATTR_CURRENT	"/proc/self/attr/current"
- #define _PATH_PROC_ATTR_EXEC	"/proc/self/attr/exec"
-diff --git a/sys-utils/unshare.c b/sys-utils/unshare.c
-index 95e4afbd055e..d409a7c936b6 100644
---- a/sys-utils/unshare.c
-+++ b/sys-utils/unshare.c
-@@ -39,6 +39,24 @@
- #include "pathnames.h"
- #include "all-io.h"
- 
-+static void disable_setgroups(void)
-+{
-+	const char *file = _PATH_PROC_SETGROUPS;
-+	const char *deny = "deny";
-+	int fd;
-+
-+	fd = open(file, O_WRONLY);
-+	if (fd < 0) {
-+		if (errno == ENOENT)
-+			return;
-+		 err(EXIT_FAILURE, _("cannot open %s"), file);
-+	}
-+
-+	if (write_all(fd, deny, strlen(deny)))
-+		err(EXIT_FAILURE, _("write failed %s"), file);
-+	close(fd);
-+}
-+
- static void map_id(const char *file, uint32_t from, uint32_t to)
- {
- 	char *buf;
-@@ -178,6 +196,7 @@ int main(int argc, char *argv[])
- 	}
- 
- 	if (maproot) {
-+		disable_setgroups();
- 		map_id(_PATH_PROC_UIDMAP, 0, real_euid);
- 		map_id(_PATH_PROC_GIDMAP, 0, real_egid);
- 	}
diff --git a/pkgs/os-specific/linux/zfs/default.nix b/pkgs/os-specific/linux/zfs/default.nix
index 11b77c3d66f4..3f4568022860 100644
--- a/pkgs/os-specific/linux/zfs/default.nix
+++ b/pkgs/os-specific/linux/zfs/default.nix
@@ -1,13 +1,13 @@
 { callPackage, fetchFromGitHub, ... } @ args:
 
 callPackage ./generic.nix (args // rec {
-  version = "0.6.3-1.2";
+  version = "0.6.3-1.3";
 
   src = fetchFromGitHub {
     owner = "zfsonlinux";
     repo = "zfs";
     rev = "zfs-${version}";
-    sha256 = "1iqkh08ikmsg8zi7s2pr46z9z7lshbb65pv2ihg1llwmgcm42r9r";
+    sha256 = "08m5ah8a6zp96djz2xj9rb94zq973dwwfpc26jy0adzdq2q20zb4";
   };
 
   patches = [
diff --git a/pkgs/os-specific/linux/zfs/git.nix b/pkgs/os-specific/linux/zfs/git.nix
index 1318722d395e..fb7b7f76ee44 100644
--- a/pkgs/os-specific/linux/zfs/git.nix
+++ b/pkgs/os-specific/linux/zfs/git.nix
@@ -1,12 +1,12 @@
 { callPackage, stdenv, fetchgit, spl_git, ... } @ args:
 
 callPackage ./generic.nix (args // rec {
-  version = "2015-03-10";
+  version = "2015-03-25";
 
   src = fetchgit {
     url = git://github.com/zfsonlinux/zfs.git;
-    rev = "7f3e4662832269b687ff20dafc6a33f8e1d28912";
-    sha256 = "1z0aizn212m6vygp4iqd3dv2xpqb883bvz12sw6hg7w8isq83ila";
+    rev = "7d90f569b3f05def7cbd0a52ce8ac3040364d702";
+    sha256 = "09qcfd3h6zjwvgr1prs41qi8wlzvdv8x4sfrcf95bjj6h25v7n51";
   };
 
   patches = [
diff --git a/pkgs/os-specific/linux/zfs/mount_zfs_prefix.patch b/pkgs/os-specific/linux/zfs/mount_zfs_prefix.patch
index 49ad88fc3a43..82b5999cf9ec 100644
--- a/pkgs/os-specific/linux/zfs/mount_zfs_prefix.patch
+++ b/pkgs/os-specific/linux/zfs/mount_zfs_prefix.patch
@@ -16,7 +16,7 @@ diff -crN '--exclude=.git' zfs-0.60-rc11/cmd/mount_zfs/Makefile.am zfs/cmd/mount
   # Ignore the prefix for the mount helper.  It must be installed in /sbin/
   # because this path is hardcoded in the mount(8) for security reasons.
 + #
-+ # ... except on nixos, where it really is /var/run/current-system/sw/sbin,
++ # ... except on nixos, where it really is /var/run/current-system/sw/bin,
 + # which is where this will end up if we put it in ${out}/sbin.
   #
   sbin_PROGRAMS = mount.zfs