From 48f51f118506db271567cc19739bc6e66edb6483 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 1 Feb 2016 17:54:35 +0100 Subject: [PATCH] linux: Compress kernel modules This reduces the kernel package from 185 to 62 MiB, for a neglible boot time cost. --- pkgs/os-specific/linux/kernel/common-config.nix | 6 ++++++ pkgs/os-specific/linux/kmod/default.nix | 6 ++---- 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 bd4513ead9ee..fc54715ea7b8 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 1b12a0076b45..12449a0a7dda 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 ];