about summary refs log tree commit diff
path: root/pkgs/os-specific
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-02-01 17:54:35 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-02-01 18:19:23 +0100
commit48f51f118506db271567cc19739bc6e66edb6483 (patch)
treeaac1814e1c340f0c258e451eb72491b77b631dd5 /pkgs/os-specific
parentb21ef9c9e6ad9c754cd8dbf8bc58f4271fb80835 (diff)
linux: Compress kernel modules
This reduces the kernel package from 185 to 62 MiB, for a neglible
boot time cost.
Diffstat (limited to 'pkgs/os-specific')
-rw-r--r--pkgs/os-specific/linux/kernel/common-config.nix6
-rw-r--r--pkgs/os-specific/linux/kmod/default.nix6
2 files changed, 8 insertions, 4 deletions
diff --git a/pkgs/os-specific/linux/kernel/common-config.nix b/pkgs/os-specific/linux/kernel/common-config.nix
index bd4513ead9ee7..fc54715ea7b8b 100644
--- a/pkgs/os-specific/linux/kernel/common-config.nix
+++ b/pkgs/os-specific/linux/kernel/common-config.nix
@@ -21,6 +21,12 @@
 with stdenv.lib;
 
 ''
+  # Compress kernel modules for a sizable disk space savings.
+  ${optionalString (versionAtLeast version "3.18") ''
+    MODULE_COMPRESS y
+    MODULE_COMPRESS_XZ y
+  ''}
+
   # Debugging.
   DEBUG_KERNEL y
   TIMER_STATS y
diff --git a/pkgs/os-specific/linux/kmod/default.nix b/pkgs/os-specific/linux/kmod/default.nix
index 1b12a0076b459..12449a0a7ddab 100644
--- a/pkgs/os-specific/linux/kmod/default.nix
+++ b/pkgs/os-specific/linux/kmod/default.nix
@@ -8,11 +8,9 @@ stdenv.mkDerivation rec {
     sha256 = "10lzfkmnpq6a43a3gkx7x633njh216w0bjwz31rv8a1jlgg1sfxs";
   };
 
-  # Disable xz/zlib support to prevent needing them in the initrd.
-  
-  buildInputs = [ pkgconfig libxslt /* xz zlib */ ];
+  buildInputs = [ pkgconfig libxslt xz /* zlib */ ];
 
-  configureFlags = [ "--sysconfdir=/etc" /* "--with-xz" "--with-zlib" */ ];
+  configureFlags = [ "--sysconfdir=/etc" "--with-xz" /* "--with-zlib" */ ];
 
   patches = [ ./module-dir.patch ];