All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Engelhardt <jengelh@medozas.de>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: Steve Brokenshire <sbrokenshire@xestia.co.uk>,
	linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org
Subject: Re: [PATCH] Compress kernel modules on installation.
Date: Mon, 19 Jan 2009 21:21:37 +0100 (CET)	[thread overview]
Message-ID: <alpine.LSU.2.00.0901192120400.12940@fbirervta.pbzchgretzou.qr> (raw)
In-Reply-To: <20090118210416.GE2978@uranus.ravnborg.org>


On Sunday 2009-01-18 22:04, Sam Ravnborg wrote:
>
>Can I ask you to redo this patch.
>I want a way to swith off compression, but it should default be enable.
>So if KBUILD_MODULE_NOCOMPRESS is undefined we will compress the modules
>when we install them.
>
>And add documentation to Documentation/kbuild/kbuild.txt too...

changes to previous:
- added choice for compress (none, -1, -2, ..., -9)
- documentation

parent ad2507ab58aa5a3e50b0482889882ff3adf6ef33 (v2.6.29-rc2-24-gad2507a)
commit 3fc20a79496c3c5c8d4b906ea7e2496de448002d
Author: Jan Engelhardt <jengelh@medozas.de>
Date:   Mon Jan 19 21:18:39 2009 +0100

kbuild: install modules gzipped

This saves lots of disk space. Yes we had discussions about gzip -6
having a better compression-per-time ratio, but the point is that
people doing the compression in the first place often do not care
about the amount of compression time as long as the final filesize
will be smaller (that's what LZMA does over bzip2, and what bzip2
does over gzip). The KBUILD_MODULES_COMPRESS make variable can be set
over the command line to tune the compression level to your need,
including disabling it entirely.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
---
 Documentation/kbuild/kbuild.txt |   11 +++++++++++
 scripts/Makefile.modinst        |    6 +++++-
 2 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/Documentation/kbuild/kbuild.txt b/Documentation/kbuild/kbuild.txt
index 923f9dd..453ba6c 100644
--- a/Documentation/kbuild/kbuild.txt
+++ b/Documentation/kbuild/kbuild.txt
@@ -125,6 +125,17 @@ KBUILD_EXTRA_SYMBOLS
 For modules use symbols from another modules.
 See more details in modules.txt.
 
+KBUILD_MODULES_COMPRESS
+--------------------------------------------------
+By default, kbuild will compress modules with gzip -9 compression to
+reduce disk space. The KBUILD_MODULES_COMPRESS make parameter can be
+used to set an alternate compression level or disable compression
+entirely.
+Example for using the standard gzip compression level:
+	make KBUILD_MODULES_COMPRESS="-6"
+Disabling compression:
+	make KBUILD_MODULES_COMPRESS=""
+
 ALLSOURCE_ARCHS
 --------------------------------------------------
 For tags/TAGS/cscope targets, you can specify more than one archs
diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst
index 18b4bf8..e0708b1 100644
--- a/scripts/Makefile.modinst
+++ b/scripts/Makefile.modinst
@@ -16,9 +16,13 @@ PHONY += $(modules)
 __modinst: $(modules)
 	@:
 
+KBUILD_MODULES_COMPRESS  ?= -9
 quiet_cmd_modules_install = INSTALL $@
       cmd_modules_install = mkdir -p $(2); \
-			    $(mod_strip_cmd) $@ $(2)/$(notdir $@) || cp $@ $(2)
+			    $(mod_strip_cmd) $@ $(2)/$(notdir $@) || cp $@ $(2); \
+			    $(if ${KBUILD_MODULES_COMPRESS}, \
+			    	gzip -f ${KBUILD_MODULES_COMPRESS} \
+			    	$(2)/$(notdir $@), )
 
 # Modules built outside the kernel source tree go into extra by default
 INSTALL_MOD_DIR ?= extra
-- 
# Created with git-export-patch

  parent reply	other threads:[~2009-01-19 20:21 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-25 21:42 [PATCH] Compress kernel modules on installation Steve Brokenshire
2008-02-25 22:17 ` Oleg Verych
2008-02-25 22:19   ` Willy Tarreau
2008-02-25 22:32     ` Oleg Verych
2008-02-25 23:21       ` Willy Tarreau
2008-02-25 22:21 ` Willy Tarreau
2008-02-26  9:14   ` Adrian Bunk
2008-02-26 10:22     ` Willy Tarreau
2008-02-26 12:30       ` Adrian Bunk
2008-02-26 13:04         ` Willy Tarreau
2008-02-26 11:28 ` Sam Ravnborg
2008-04-01 19:42   ` Steve Brokenshire
2008-12-26 19:30   ` Jan Engelhardt
2008-12-26 19:48     ` Sam Ravnborg
2008-12-26 19:50       ` Jan Engelhardt
2008-12-26 22:57         ` Sam Ravnborg
2008-12-26 23:12           ` Jan Engelhardt
2009-01-18 21:04         ` Sam Ravnborg
2009-01-18 21:09           ` Arjan van de Ven
2009-01-18 21:15             ` Michael Tokarev
2009-01-18 21:18               ` Jan Engelhardt
2009-01-18 21:25                 ` Michael Tokarev
2009-01-19 20:21           ` Jan Engelhardt [this message]
2009-01-20  3:30       ` Steve Brokenshire
2009-01-25 16:51         ` Steve Brokenshire
2009-01-25 18:02           ` Jan Engelhardt
2009-01-26 21:39             ` Steve Brokenshire
2008-12-26 20:23 Roland
2008-12-26 21:09 ` Jan Engelhardt
2008-12-26 23:10   ` Roland
2008-12-26 23:28     ` Bill Davidsen
2008-12-26 22:02 ` david
2008-12-26 21:15   ` Jan Engelhardt
2008-12-26 22:28     ` david
2008-12-26 23:23       ` Jan Engelhardt
2008-12-27  0:58         ` david
2009-01-01  8:27   ` Willy Tarreau
2008-12-26 23:49 Roland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LSU.2.00.0901192120400.12940@fbirervta.pbzchgretzou.qr \
    --to=jengelh@medozas.de \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@ravnborg.org \
    --cc=sbrokenshire@xestia.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.